# code-graph

> code-graph is an MCP server for developer tools. Local dependency graph that shows agents which callers, routes and tables a change touches. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, Linux, macOS, Windows
- **Website:** https://code-graph.cyberchronos00.workers.dev
- **Repository:** https://github.com/cyberchronos00/code-graph
- **MCP Registry name:** io.github.cyberchronos00/cg-code-graph
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

Before an edit, ask what reaches a table, a connection, a config key or a method, and follow each hop as a file and line. The graph is deterministic, so re-indexing the same tree gives the same answer, and the database stays on your machine with no hosted index.

Routes, calls, data access and platform boundaries sit in one index that can span several linked repositories. Extractors cover PHP (Laravel), Python (Django, FastAPI, Flask), TypeScript and JavaScript (Next.js, NestJS, Express, Nuxt and others), Dart/Flutter, Kotlin, Java (Spring Boot), Swift, Rust, and C and C++; Go and others can be imported through SCIP.

It also checks planned changes: a YAML plan lists the nodes and edges you intend to add, plus forbidden paths, and plan_check reports what is missing, what conflicts and, after you implement and re-index, whether the plan was met.

## Features

- **Impact queries:** Ask what reaches a table, config key or method, with each hop given as file:line.
- **Deterministic index:** The same source tree produces the same graph every time.
- **Plan checks:** A YAML plan is checked for gaps, conflicts and forbidden paths, then verified after implementation.
- **Multi-repo graph:** Routes, calls, tables and config keys share one index across linked repositories.
- **Wide language support:** PHP, Python, TypeScript, Dart, Kotlin, Java, Swift, Rust and C/C++, with SCIP import for others.

## Good for

- Check what a refactor will affect before an agent edits code
- Trace which routes and jobs write to a given table
- Verify an implementation matches an agreed change plan
- Map dependencies across several linked repositories

## Install

### Claude Code (Terminal)

```sh
claude mcp add cg-code-graph -- uvx cg-code-graph
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "cg-code-graph": {
      "command": "uvx",
      "args": [
        "cg-code-graph"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "cg-code-graph": {
      "command": "uvx",
      "args": [
        "cg-code-graph"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "cg-code-graph": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "cg-code-graph"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "cg-code-graph": {
      "command": "uvx",
      "args": [
        "cg-code-graph"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "cg-code-graph": {
      "command": "uvx",
      "args": [
        "cg-code-graph"
      ]
    }
  }
}
```

## Tools

- `plan_check`: Checks a planned change against the graph and reports gaps, conflicts and verification.

## FAQ

### Does it send my code anywhere?

The graph database stays on your machine and queries do not need a hosted index.

### How do I install it?

It is a Python 3.11+ package named cg-code-graph that provides the cg and cg-mcp commands; pipx or uv tool install both work.

### Which languages does it read?

PHP, Python, TypeScript/JavaScript, Dart, Kotlin, Java, Swift, Rust and C/C++, with other languages importable through SCIP.

### How do I add code-graph to Claude Code?

Run this command in your terminal: claude mcp add cg-code-graph -- uvx cg-code-graph

### What are the best alternatives to code-graph?

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

## Where this comes from

- Description: written from the project's README and the project's website.
- 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/code-graph
