# codegraph

Builds a semantic graph of your project and hands it to the agent through 42 tools. Useful when the agent should see how functions connect instead of grepping files.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 132
- Author: codegraph-ai
- License: Apache-2.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codegraph-ai/CodeGraph
- Updated: 2026-10-06
- HTML: https://affpapa.org/en/nevibecode/mcp/codegraph

## What it does

CodeGraph parses a repository and assembles a graph: functions, classes, imports, call chains. Parsing runs on tree-sitter and covers 38 languages. The agent gets a structured view of the code instead of reading files one by one.

The server runs as a standard MCP server and indexes the current working directory. Flags cover the common cases: `--workspace` for several projects, `--exclude` to skip directories, `--max-files` with a 5000-file cap, `--profile` to narrow the exposed tool set. With `--graph-only` it builds the graph alone, no embeddings, so semantic search and memory tools are unavailable.

The embedding model is set by `--embedding-model`, `bge-small` by default. Stored vectors carry the settings that produced them, so a process configured differently ignores them and re-embeds in the background. Leave an old `--watch` daemon running and sessions attached to it lose semantic search until it restarts.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add codegraph -- npx -y @astudioplus/codegraph-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add codegraph -- npx -y @astudioplus/codegraph-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "codegraph": {
            "command": "npx",
            "args": [
                "-y",
                "@astudioplus/codegraph-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "codegraph": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@astudioplus/codegraph-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add codegraph npx -y @astudioplus/codegraph-mcp
```

## When to use it
- find every caller of a function before editing it
- see what a change to a shared module will touch
- give the agent code context without reading dozens of files
- flag missing tests and stale docs on a pull request
- search a TypeScript codebase in plain language

## Example prompts
- Show me every caller of `parseConfig` in this project
- What breaks if I change the signature of `handleRequest`?
- Find where the dependency graph gets assembled

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
