AI Agent Integration
Once CGraph is built, registering it with a coding agent is a one-line MCP setup. The agent then has eight graph tools alongside its usual file and shell access.
Register the MCP server
Point your agent's MCP configuration at the built cgraph-mcp binary.
claude mcp add cgraph -- "$PWD/build/default/src/mcp/cgraph-mcp"Use the absolute path to cgraph-mcp unless it's on your PATH. Claude Code
sets CLAUDE_PROJECT_DIR, which CGraph uses to resolve the project root
automatically — so no --root is needed there.
What the agent gains
With the server registered, the agent can navigate the codebase as a graph:
| Ask | Tool |
|---|---|
"What is Parser and where is it used?" | graph_query, graph_explain |
| "What breaks if I change this signature?" | graph_impact |
| "How do these two modules connect?" | graph_path |
| "Give me the relevant context, within budget." | graph_context |
| "Is the graph up to date?" | graph_status, graph_update |
Why this beats grepping
An agent without a graph re-derives structure from search on every turn. With
CGraph it asks precise questions and gets precise answers from a warm, persistent
graph — fewer tokens spent rediscovering the codebase, more spent on the task.
See Context Packing for how graph_context fits
a neighborhood into the agent's budget.
Requirements
- A built
cgraph-mcp(see Installation). - An agent that supports MCP servers over stdio.
- The daemon (
graphd) reachable —cgraph-mcpdiscovers it next to the binary or viaCGRAPH_DAEMON_PATH.