# AI Agent Integration
> Wiring CGraph into Claude Code, Codex, and Cursor over MCP.
[Source](https://open.nxtsoft.io/docs/cgraph/ai-agents)

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 Code

```bash
claude mcp add cgraph -- "$PWD/build/default/src/mcp/cgraph-mcp"
```

  
  #### other agents

```text
Configure an MCP server that runs the cgraph-mcp binary over stdio.
Command: /absolute/path/to/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](/docs/cgraph/context-packing) for how `graph_context` fits
a neighborhood into the agent's budget.

## Requirements

- A built `cgraph-mcp` (see [Installation](/docs/cgraph/installation)).
- An agent that supports MCP servers over stdio.
- The daemon (`graphd`) reachable — `cgraph-mcp` discovers it next to the binary
  or via `CGRAPH_DAEMON_PATH`.
