# CGraph

> CGraph is an open-source MCP server for developer tools. Local MCP server serving a code graph: symbol search, callers, blast radius, impact. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted
- **Repository:** https://github.com/nxtsoft/cgraph
- **MCP Registry name:** io.github.Nxtsoft/cgraph
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

CGraph precomputes the relationships inside a codebase so an agent can ask what calls a symbol or what breaks if it changes without reading dozens of files. A scan turns a source tree into a deterministic graph, with no LLM in extraction, and a resident daemon with file watching serves warm queries in about 10 ms. The README reports a 10,000-node graph building in about two seconds.

Extraction uses tree-sitter for many languages, with structured parsing for a few config formats, and community detection groups files into modules. Exports include JSON, interactive HTML, SVG, Obsidian markdown, Neo4j Cypher and Mermaid diagrams. It also reports retrieval benchmark results, with Recall@20 close to RepoMap and below Qwen3-Embedding-8B.

The engine is C++, and the MCP server runs over stdio from the npm package `cgraph-mcp`.

## Features

- **Impact analysis:** graph_impact lists every transitive dependent of a symbol.
- **Centrality-ranked search:** Ranks search results by how load-bearing code is.
- **Token-budgeted bundles:** Returns source bundles sized to a token budget.
- **Module clustering:** Leiden and Louvain community detection groups code into modules.
- **Many export formats:** Writes JSON, HTML, SVG, Obsidian, Cypher and Mermaid outputs.
- **Deterministic builds:** The same input yields the same graph every time.

## Good for

- Find everything affected by changing a function
- Let an agent navigate by graph instead of grep
- Get an architecture overview of a large repository
- Export a dependency diagram as Mermaid or SVG
- Trace call flows from entry points

## Install

### Claude Code (Terminal)

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

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "cgraph": {
      "command": "npx",
      "args": [
        "-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"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

- `graph_impact`: Returns every transitive dependent of a symbol.

## FAQ

### Does it use an LLM to build the graph?

No. The README says extraction is deterministic with no LLM involved.

### How fast are queries?

About 10 ms warm from the daemon, according to the README.

### What can it export?

JSON, HTML, SVG, Obsidian markdown, Cypher, Mermaid and design Markdown.

### How is retrieval quality measured?

On Agent Retrieval Bench, with Recall@20 of 0.636 for version 0.9.1.

### Is CGraph free?

Yes. CGraph is open source, so you can use and self-host it for free.

### How do I add CGraph to Claude Code?

Run this command in your terminal: claude mcp add cgraph -- npx -y cgraph-mcp

### What are the best alternatives to CGraph?

The closest alternatives to CGraph are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/cgraph
