Skip to content

Summary

MCP server that parses a multi-language codebase with Tree-sitter into a knowledge graph, so agents can resolve definitions, trace callers, query structure in plain English and patch code.

Features

  • Tree-sitter parsing of 13 fully supported languages into a code knowledge graph
  • Deterministic resolve, definition and callers tools that need no LLM
  • Natural-language questions translated to Cypher with a model you choose
  • Incremental reingest of edited files and their dependents
  • Embedded SQLite graph by default; Memgraph or Neo4j optional
  • Optional data-flow capture for traceback explanation and root-cause ranking

Installation

Set up this MCP server in your favorite AI agent — copy a ready-made configuration below.

Any MCP-compatible agent

Most agents (Claude, Cursor, Windsurf, VS Code, and more) read a standard mcpServers configuration.

  1. Open your agent's MCP configuration file.
  2. Merge the snippet below into it, filling in the environment variables with your own values.
  3. Restart the agent — the "Code-Graph-RAG" tools will be available.
{
  "mcpServers": {
    "code-graph-rag": {
      "command": "code-graph-rag",
      "args": [
        "mcp-server"
      ],
      "env": {
        "TARGET_REPO_PATH": "/absolute/path/to/your/project",
        "CGR_CAPTURE": "io",
        "CYPHER_PROVIDER": "openai",
        "CYPHER_MODEL": "<model>",
        "CYPHER_API_KEY": "<your-api-key>"
      }
    }
  }
}

Description

Code-Graph-RAG reads every source file in a repository with Tree-sitter, adding compiler-grade frontends and runtime traces where available, and stores functions, classes, methods, modules and the relationships between them as a graph. By default the graph lives in an embedded SQLite file, so no database server is needed; Memgraph and Neo4j are optional backends that run the same Cypher. Its cgr command is an interactive assistant over that graph, and code-graph-rag mcp-server exposes it to Claude Code and other MCP clients.

The MCP server has a large tool set. Project management tools list, index, update and delete projects, and reingest re-parses only edited files and their dependents. Deterministic lookups need no model: resolve maps a name or path:line to qualified names, definition returns a definition's file, span and source, and callers lists call sites, optionally several levels deep. Natural-language questions are turned into Cypher by a model you configure, and with data-flow capture enabled further tools explain tracebacks and rank likely root causes. The project also covers dead-code detection, structural search and rewrite with ast-grep, and AST-based code edits with a diff preview.

Python, TypeScript, JavaScript, Rust, Go, Java, C, C++, C#, PHP, Lua, Dart and Julia are fully supported, with structural support for several more. It needs Python 3.12+ and ripgrep, and the MCP server is configured with TARGET_REPO_PATH plus a provider, model and API key for Cypher generation (OpenAI, Google and others). Installed from PyPI as code-graph-rag. MIT licence, with optional paid hosting and support from the maintainer.

New

Local code knowledge graph served over MCP: Tree-sitter maps functions, calls, imports and tests so an assistant reviews a change by its blast radius instead of re-reading the codebase.

MCP: jCodeMunch

by jgravelle

New

MCP server that indexes a codebase with tree-sitter and lets agents fetch code by symbol rather than by file, plus structural queries like blast radius, importers and dead code.

MCP: ripwire

by Red Hat

Featured

Red Hat's zero-dependency C++23 code-context engine — ranked call graphs and blast-radius analysis, indexing a repo in under half a second with no server and no database.

Browse all MCP servers →