Codegraph MCP Server

A blazingly fast codebase graphRAG implementation in 100% Rust

Local serverstdioPython

What is the Codegraph MCP server?

If you already use Codegraph, the codegraph mcp server is the piece that lets your assistant work with it directly. A blazingly fast codebase graphRAG implementation in 100% Rust.

What the server does

CodeGraph transforms your entire codebase into a semantically searchable knowledge graph that AI agents can actually reason about—not just grep through.

Installation

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

Available tools

The toolset is worth reading before you wire it up, because it tells you what the integration is really for:

  • agentic_context — Gathers the context you need—searches code, builds comprehensive context, answers semantic questions
  • agentic_impact — Maps change impact—dependency chains, call flows, what breaks if you touch something
  • agentic_architecture — The big picture—system structure, API surfaces, architectural patterns
  • agentic_quality — Risk assessment—complexity hotspots, coupling metrics, refactoring priorities
  • Embeddings — Use any model with dimensions 384-4096: - Local: Ollama, LM Studio, ONNX Runtime - Cloud: OpenAI, Jina AI
  • Database — The Database tool exposed by this server
  • Experimen — The Experimen tool exposed by this server

Credentials and setup notes

Configuration is passed through the environment: CODEGRAPH_PROJECT_ID. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

Worth knowing first

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Where it fits

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Codegraph's toolset — agentic_context, agentic_impact, agentic_architecture and 4 more — is a fair guide to whether it matches your workflow.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Available tools

ToolWhat it does
agentic_contextGathers the context you need—searches code, builds comprehensive context, answers semantic questions
agentic_impactMaps change impact—dependency chains, call flows, what breaks if you touch something
agentic_architectureThe big picture—system structure, API surfaces, architectural patterns
agentic_qualityRisk assessment—complexity hotspots, coupling metrics, refactoring priorities
EmbeddingsUse any model with dimensions 384-4096: - **Local:** Ollama, LM Studio, ONNX Runtime - **Cloud:** OpenAI, Jina AI
DatabaseThe Database tool exposed by this server.
ExperimenThe Experimen tool exposed by this server.

How to install the Codegraph MCP server

{
  "mcpServers": {
    "codegraph": {
      "command": "/full/path/to/codegraph",
      "args": ["start", "stdio", "--watch"]
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
CODEGRAPH_PROJECT_IDConfiguration value read at startup.Optional

Example prompts to try

  • Use Codegraph to agentic context.
  • Use Codegraph to agentic impact.
  • Use Codegraph to agentic architecture.

Frequently asked questions

It connects Codegraph to MCP-compatible AI assistants such as Claude and Cursor, exposing 7 tools (agentic_context, agentic_impact, agentic_architecture, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Codegraph directly.