# codegraph MCP server

> Turns source code into a resolved map of files, symbols, references, and dependencies to provide structural context for coding agents.

- Repository: https://github.com/lzehrung/codegraph
- Page: https://hostedmcp.org/servers/lzehrung/codegraph
- Transport: stdio
- Stars: 9
- License: MIT

## Install

### Claude Code

```sh
claude mcp add codegraph -- npx -y @lzehrung/codegraph
```

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

```json
{
  "mcpServers": {
    "codegraph": {
      "command": "npx",
      "args": [
        "-y",
        "@lzehrung/codegraph"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "codegraph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@lzehrung/codegraph"
      ]
    }
  }
}
```

### VS Code CLI

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

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

```json
{
  "mcpServers": {
    "codegraph": {
      "command": "npx",
      "args": [
        "-y",
        "@lzehrung/codegraph"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add codegraph -- npx -y @lzehrung/codegraph
```

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

```toml
[mcp_servers.codegraph]
command = "npx"
args = ["-y", "@lzehrung/codegraph"]
```

### Gemini CLI

```sh
gemini mcp add -s user codegraph npx -- -y @lzehrung/codegraph
```

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

```json
{
  "mcpServers": {
    "codegraph": {
      "command": "npx",
      "args": [
        "-y",
        "@lzehrung/codegraph"
      ]
    }
  }
}
```

## FAQ

### What is codegraph not?

It is not an AST, a compiler, or a linter.

### Can I use codegraph without Node.js or npm?

Yes, standalone installers are available that download a self-contained bundle including Node.js, the CLI, and the matching native runtime.

### Does codegraph change my code?

No, tools like refactor-plan and rename-preview provide read-only evidence and edits without making actual code changes.
