# cgraphy MCP server

> Indexes codebases into a knowledge graph to provide token-budgeted context and structural insights for AI coding agents.

- Repository: https://github.com/pmgarg/cgraphy
- Page: https://hostedmcp.org/servers/pmgarg/cgraphy
- Transport: stdio
- Stars: 0
- License: MIT
- Latest version: 0.1.1

## Install

### Claude Code

```sh
claude mcp add cgraphy -- uvx cgraphy
```

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

```json
{
  "mcpServers": {
    "cgraphy": {
      "command": "uvx",
      "args": [
        "cgraphy"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "cgraphy": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "cgraphy"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"cgraphy","type":"stdio","command":"uvx","args":["cgraphy"]}'
```

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

```json
{
  "mcpServers": {
    "cgraphy": {
      "command": "uvx",
      "args": [
        "cgraphy"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add cgraphy -- uvx cgraphy
```

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

```toml
[mcp_servers.cgraphy]
command = "uvx"
args = ["cgraphy"]
```

### Gemini CLI

```sh
gemini mcp add -s user cgraphy uvx -- cgraphy
```

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

```json
{
  "mcpServers": {
    "cgraphy": {
      "command": "uvx",
      "args": [
        "cgraphy"
      ]
    }
  }
}
```

## Tools (8)

- `cgraphy_overview`
- `cgraphy_search`
- `cgraphy_context`
- `cgraphy_read`
- `cgraphy_impact`
- `cgraphy_diff_context`
- `cgraphy_enrich`
- `cgraphy_store_summaries`

## FAQ

### What languages does cgraphy support?

It provides full-fidelity extraction for Python, TypeScript/JavaScript, Java, Go, C, C++, and Rust, plus generic extraction for over 20 more languages via tree-sitter.

### Does cgraphy require an external database or API key?

No, it uses a local SQLite file for storage and requires no API keys for basic operation, as semantic summaries are written by the host agent.

### How does cgraphy help manage token usage?

It uses a token-budgeted context expansion that grows around a symbol and stops exactly at your specified budget.

### Can cgraphy use git history to understand code?

Yes, it can mine commit history to identify files that change together, creating logical coupling edges.

### How do I install cgraphy?

You can install it via pip using `pip install cgraphy` or via uv using `uv tool install cgraphy`.
