code-graph-mcp

An MCP server that builds a code knowledge graph: semantic search, call graph, HTTP route tracing and change impact analysis.

  • 95 ★ on the repository
  • Last commit
  • MIT
MCP server

Extended access

Why this level

  • Reads the whole project source and keeps a local index, with the plugin it adds hooks on file edits
All reasons and checks

sdsrss/code-graph-mcp

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add mcp/code-graph-mcp

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Reads the whole project source and keeps a local index, with the plugin it adds hooks on file edits

This is third-party code. Review the repository files before installing.

What it does

code-graph-mcp indexes a codebase into a structured graph built on Tree-sitter parse trees. The agent gets tools for semantic search, call graph traversal in both directions, reference lookup, tracing HTTP routes to handler functions and finding dead code. Impact analysis shows what a change touches. Deep parsing with calls, imports and inheritance covers TypeScript, JavaScript, Go, Python, Rust and Java, and is smoke-tested for C#, Kotlin, Ruby, PHP, Swift and Dart. Search combines BM25 and vector similarity through sqlite-vec. The index updates incrementally through a Merkle tree and answers are compressed in levels to save context tokens.

Who it is for. Developers of large codebases where an agent burns dozens of calls on reading files and should get the structure straight away.

Good fit when

  • You need to find a function by describing what it does and get it in one call.
  • You need to trace a call chain two levels deep before a refactor.
  • You need to find which handler serves a route in Express, Flask, FastAPI, `net/http` or axum.
  • Before deleting code you want to find unused symbols and the blast radius of the edit.

Not a fit when

  • The project is small and it is simpler for the agent to open a few files than to maintain an index.
  • The language is off the list: for HTML, CSS and JSON only file-level full-text search works.
  • You need routes in actix, rocket or Java Spring: those frameworks are not extracted yet.

Example request

Use code-graph to find where payments are handled in the project and show which functions call that handler.

MCP

Transport
stdio
Authentication
not required

Limitations

Parsing depth depends on the language: full for six languages, smoke-tested for six others, and C and C++ are limited. Routes are extracted from Express and Connect, Go `net/http`, Flask, FastAPI and axum. The actix, rocket and Java Spring frameworks are not extracted yet. The index is stored locally and updated on the next tool query after files change. Expect disk and CPU load during the first index of a large project. The recommended install is the Claude Code plugin, and other clients need only an MCP config.

How to disable. Uninstall the plugin with `/plugin uninstall code-graph-mcp` or remove the server with `claude mcp remove code-graph-mcp`. The local index is erased by hand.

FAQ

Why is the plugin better than bare MCP?

The plugin adds the `explore` and `index` skills, the `code-explorer` agent, auto-indexing, a statusline and updates. The MCP-only mode gives just the tools.

How do I connect it to Cursor or Windsurf?

Through an MCP config with the `npx` command and the `@sdsrs/code-graph` package. Other options: `npx -y @sdsrs/code-graph` or global `npm install -g @sdsrs/code-graph`.

How do I save tokens?

Nearly every tool takes `compact: true`, which drops code bodies from the response. The author cites savings of 75 to 90 percent on comparable tasks.

When does the index update?

A file watcher records edits and the next graph tool query re-indexes them before answering. `get_index_status` does not trigger indexing.

What is the hybrid search?

A combination of BM25 full-text search and vector search through sqlite-vec with RRF rank fusion.

Discussion

No questions or reviews yet.

An MCP server that builds a code graph of functions, classes, calls and routes and answers the agent's structural queries locally

MCP serverExtended access48.5KRepository stars

Local code graph for agents: an MCP server returns entry points, symbol links and change impact in one call

MCP serverExtended access77.5KRepository stars
Official

A local code graph with version history: an MCP server that tells the agent who calls a function and what an edit breaks

MCP serverExtended access516Repository stars

An MCP server that turns a large codebase into a semantic feature graph for precise navigation and meaning-based search

MCP serverExtended access2KRepository stars

Code dependency graph for VS Code, the CLI and MCP: imports, calls, cycles, dead code and change impact.

CLIMinimal access63Repository stars

README in short

The README lists languages and parsing depth, the graph features, install methods and call-count benchmarks. For Claude Code the plugin is recommended.

README badge

Report a problem