# CGraph MCP server

> Enables AI agents to navigate codebases using a queryable knowledge graph for symbol search, dependency analysis, and impact assessment.

- Repository: https://github.com/Nxtsoft/CGraph
- Page: https://hostedmcp.org/servers/nxtsoft/cgraph
- Transport: stdio
- Stars: 2
- License: MIT
- Latest version: 0.9.7

## Install

### Claude Code

```sh
claude mcp add cgraph -- npx -y cgraph-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "cgraph": {
      "command": "npx",
      "args": [
        "-y",
        "cgraph-mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "cgraph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "cgraph-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"cgraph","type":"stdio","command":"npx","args":["-y","cgraph-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "cgraph": {
      "command": "npx",
      "args": [
        "-y",
        "cgraph-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add cgraph -- npx -y cgraph-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.cgraph]
command = "npx"
args = ["-y", "cgraph-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user cgraph npx -- -y cgraph-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "cgraph": {
      "command": "npx",
      "args": [
        "-y",
        "cgraph-mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `CGRAPH_CLIENT` | no | no |  |
| `CGRAPH_PROJECT_ROOT` | no | no |  |
| `VCPKG_ROOT` | no | no |  |

## FAQ

### How fast is the graph retrieval?

Queries such as impact and path analysis are served in approximately 10 ms from a daemon or MCP server.

### Does CGraph use an LLM to extract code structure?

No, the extraction process is deterministic and does not use an LLM in the extraction path.

### What programming languages are supported?

It supports a wide range of languages including C, C++, C#, Go, Java, JavaScript, Python, Rust, Scala, TypeScript, and more via tree-sitter.
