Skip to content

Commit de41e0e

Browse files
docs(mcp): document postprocess operations surface
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent 40d0b0c commit de41e0e

6 files changed

Lines changed: 29 additions & 11 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# code-context-graph
22

3-
Local code analysis tool that parses codebases via Tree-sitter into a knowledge graph. Supports 12 languages, 31 MCP tools, and custom annotation search.
3+
Local code analysis tool that parses codebases via Tree-sitter into a knowledge graph. Supports 12 languages, 33 MCP tools, and custom annotation search.
44

55
Inspired by [code-review-graph](https://github.com/tirth8205/code-review-graph) — a Python-based code analysis tool. This project reimplements and extends the concept in Go with multi-DB support, custom annotation system, and MCP integration for AI-powered code understanding.
66

77
## Features
88

99
- **12 languages**: Go, Python, TypeScript, Java, Ruby, JavaScript, C, C++, Rust, Kotlin, PHP, Lua/Luau
10-
- **31 MCP tools**: parse, search, impact analysis, flow tracing, dead code detection, namespace file management, and more
10+
- **33 MCP tools**: parse, search, impact analysis, flow tracing, dead code detection, postprocess operations, namespace file management, and more
1111
- **Custom annotations**: `@intent`, `@domainRule`, `@sideEffect`, `@mutates`, `@index` — search code by business context ([details](guide/annotations.md))
1212
- **Webhook sync**: GitHub / Gitea push events → auto clone + build with per-repo branch filtering and `.ccg.yaml` `include_paths` auto-loading ([details](guide/webhook.md))
1313
- **Eval**: Golden corpus-based parser accuracy (P/R/F1) and search quality (P@K, MRR, nDCG) evaluation ([details](guide/cli-reference.md#eval))
@@ -176,7 +176,7 @@ For remote HTTP mode:
176176
}
177177
```
178178

179-
Claude Code automatically connects and gets access to 31 MCP tools. See [MCP Tools Reference](guide/mcp-tools.md) for the full list.
179+
Claude Code automatically connects and gets access to 33 MCP tools. See [MCP Tools Reference](guide/mcp-tools.md) for the full list.
180180

181181
## Architecture
182182

@@ -187,7 +187,7 @@ Source Code → Tree-sitter Parser → Nodes + Edges + Annotations
187187
188188
FTS Search
189189
190-
MCP Server (31 tools)
190+
MCP Server (33 tools)
191191
↓ ↓
192192
stdio Streamable HTTP
193193
↓ ↓
@@ -204,7 +204,7 @@ See [Architecture Details](guide/architecture.md) for component breakdown and DB
204204
| Guide | Description |
205205
|-------|-------------|
206206
| [CLI Reference](guide/cli-reference.md) | All commands, flags, and config file (`.ccg.yaml`) |
207-
| [MCP Tools](guide/mcp-tools.md) | 31 MCP tools, Skills, AI-Driven Annotation |
207+
| [MCP Tools](guide/mcp-tools.md) | 33 MCP tools, Skills, AI-Driven Annotation |
208208
| [Annotations](guide/annotations.md) | Annotation system — tags, examples, search |
209209
| [Webhook](guide/webhook.md) | Webhook sync, branch filtering, HMAC, graceful shutdown |
210210
| [Docker](guide/docker.md) | Docker build, MCP server, PostgreSQL deployment |

guide/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Documentation index for code-context-graph.
55
| Document | Description |
66
|----------|-------------|
77
| [CLI Reference](cli-reference.md) | Full CLI commands, options, and configuration file (`.ccg.yaml`) |
8-
| [MCP Tools](mcp-tools.md) | 31 MCP tools, Claude Code Skills, AI-driven annotation |
8+
| [MCP Tools](mcp-tools.md) | 33 MCP tools, Claude Code Skills, AI-driven annotation |
99
| [Annotations](annotations.md) | Custom annotation system — tags, examples, search |
1010
| [Webhook](webhook.md) | GitHub / Gitea webhook sync, branch filtering, graceful shutdown |
1111
| [Docker](docker.md) | Docker image build, MCP server setup, PostgreSQL integration |

guide/architecture.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Source Code → Tree-sitter Parser → Nodes + Edges + Annotations
99
1010
FTS Search
1111
12-
MCP Server (31 tools)
12+
MCP Server (33 tools)
1313
↓ ↓
1414
stdio Streamable HTTP
1515
↓ ↓
@@ -77,7 +77,7 @@ Golden corpus-based parser accuracy and search quality evaluation framework.
7777

7878
### MCP Server (`internal/mcp/`)
7979

80-
Exposes 31 tools via MCP protocol. Supports two transport modes: stdio and Streamable HTTP.
80+
Exposes 33 tools via MCP protocol. Supports two transport modes: stdio and Streamable HTTP.
8181

8282
### Reliability
8383

guide/development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ internal/
104104
ctxns/ — Context namespace
105105
docs/ — Documentation generation
106106
eval/ — Parser/search quality evaluation (golden corpus, P/R/F1, P@K, MRR, nDCG)
107-
mcp/ — MCP server (29 tools)
107+
mcp/ — MCP server (33 tools)
108108
model/ — DB models
109109
parse/treesitter/ — Tree-sitter parser (12 languages, including Lua/Luau)
110110
pathutil/ — Path utilities

guide/mcp-tools.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MCP Tools
22

3-
code-context-graph provides 31 MCP tools. Automatically connects from Claude Code after configuring `.mcp.json`.
3+
code-context-graph provides 33 MCP tools. Automatically connects from Claude Code after configuring `.mcp.json`.
44

55
## Setup
66

@@ -30,7 +30,7 @@ code-context-graph provides 31 MCP tools. Automatically connects from Claude Cod
3030
}
3131
```
3232

33-
## Tools (31)
33+
## Tools (33)
3434

3535
### Core
3636

@@ -39,6 +39,8 @@ code-context-graph provides 31 MCP tools. Automatically connects from Claude Cod
3939
| `parse_project` | Parse source files |
4040
| `build_or_update_graph` | Full/incremental build with postprocessing |
4141
| `run_postprocess` | Rebuild stored flows, communities, and/or full-text search derived state |
42+
| `get_postprocess_policy` | Inspect automatic postprocess policy state and recent failures |
43+
| `reset_postprocess_policy` | Record a reset marker to clear fail-closed streak for one tool |
4244
| `get_node` | Get node by qualified name |
4345
| `search` | Full-text search |
4446
| `query_graph` | Predefined graph queries (callers, callees, imports, etc.) |
@@ -54,6 +56,10 @@ See [Postprocess Failure Policy](postprocess-failure-policy.md) for the detailed
5456
status tables, failure causes, skip behavior, and policy escalation rules for
5557
`build_or_update_graph` and `run_postprocess`.
5658

59+
CCG does not expose a Prometheus `/metrics` endpoint yet. For postprocess
60+
operations, use `get_postprocess_policy` and the HTTP `/status` summary as the
61+
current machine-readable operational surfaces.
62+
5763
### Analysis
5864

5965
| Tool | Description |

guide/postprocess-failure-policy.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ Policy state is persisted as:
3737
- current effective state in `ccg_postprocess_policy_state`
3838
- append-only execution history in `ccg_postprocess_run_logs`
3939

40+
For operators, CCG now exposes two lightweight control surfaces:
41+
42+
- `get_postprocess_policy` returns the current fail-closed entries and recent failures.
43+
- `reset_postprocess_policy` records a reset marker run for one tool in the current namespace.
44+
45+
The reset path does not delete execution history. It inserts an `ok` marker with
46+
source `reset`, which safely breaks the consecutive-failure streak used by the
47+
automatic resolver.
48+
49+
Run logs are also pruned opportunistically after writes so each `(namespace,
50+
tool)` keeps only a bounded recent history instead of growing forever.
51+
4052
## Namespace isolation and shared state
4153

4254
Automatic policy decisions and postprocess results are scoped to the current

0 commit comments

Comments
 (0)