← Back to directory
C

CodeGraphRAG

Community
Graph-augmented RAG for multilingual codebases.
Category
Dev Tools #258 of 438
Stars
★ 5.3k Very popular
Transport
stdio (local process)
Runtime
Python · Docker
Credentials
API key / credential required
License
MIT
Last commit
50FMRS · D

The supplied materials describe an MIT-licensed open-source stdio MCP server for natural-language querying, retrieval, and editing of multilingual codebases through a Memgraph knowledge graph. No concrete MCP tool identifiers are supplied, so the tool list remains empty.

Strongest · Documentation 13/20 Weakest · Reliability 7/20

Reliability
7/20
Security and permissions
9/20
Maintenance
11/20
Documentation
13/20
Setup experience
10/20
Why each score
Reliability 7/20
The manifest declares a PyPI stdio server and the README describes query, edit, and graph-database flows, but it provides no tool list, parameter definitions, initialization-handshake evidence, or committed tests. A CI badge is not execution evidence, so the score remains modest; dependencies on Memgraph, two LLM keys, and undocumented error handling also reduce confidence.
Security and permissions 9/20
The manifest marks both API keys as required secrets and uses local stdio transport; the README also claims diff preview before edits and supports local, private, and air-gapped deployment. However, tool permission boundaries, edit confirmation behavior, the exact code-data flow to external LLMs, database authentication, and network scope are not disclosed. The possible repository-wide read/write scope therefore warrants substantial deductions. No evidence establishes a red-line risk.
Maintenance 11/20
The project is not archived and provides an MIT license, a current version, a public repository, contribution guidance, and an issue-support path; the README also displays CI, coverage, and quality-check badges. Nevertheless, 16 open issues and badges do not establish sustained commits, dependency updates, issue response, release cadence, or a security-response process, so maintenance evidence is incomplete.
Documentation 13/20
The README covers purpose, architecture, supported languages, prerequisites, installation, quick start, MCP guidance, configuration, troubleshooting, SDK material, and advanced documentation links. Because the linked contents are not provided, tool parameters, permission boundaries, limits, costs, LLM data handling, and failure diagnosis cannot be reviewed, preventing a near-full score.
Setup experience 10/20
The source provides a PyPI installation command, a recommended uv path, a manifest-defined uvx stdio launch, Memgraph host and port settings, and required environment variables; it also identifies Docker, cmake, and ripgrep prerequisites. It lacks concrete mainstream-client configuration examples, a complete secret-configuration flow, Memgraph authentication guidance, and verifiable end-to-end handshake steps. The multi-component setup is therefore plausible but manual.

Test out of dateListed 2026-07-29

Read the FMRS scoring method →

Fit and risk

What it can accessReads local filesWrites / deletes local filesConnects to a database

Best for

  • Development teams analyzing multilingual codebases
  • Users adopting Memgraph and knowledge graphs for code retrieval
  • Claude Code users who need to query or edit a repository

Not for

  • Users without a need for codebase analysis or editing
  • Environments unable to run Memgraph or provide two LLM API keys
  • Projects that only require basic text search

Required permissions

  • Read source files in the target repository
  • Write parsed code structure and relationships to Memgraph
  • Access the configured LLM provider APIs
  • Modify target repository files when code editing is requested

Risks and side effects

  • AI-generated Cypher queries, analysis, or edits require human review
  • Editing can modify source files; inspect the provided diff preview before applying changes
  • Source-code structure is stored in Memgraph, so repository and database access controls matter
  • The server requires sensitive credentials including ORCHESTRATOR_API_KEY and CYPHER_API_KEY

Setup

Before you start

Runtime:Python · Docker

ORCHESTRATOR_API_KEY requiredsecret Required API key for the orchestrator LLM provider; obtain it from the chosen provider.
CYPHER_API_KEY requiredsecret Required API key for the Cypher LLM provider; obtain it from the chosen provider.
Other optional settings (7)
ORCHESTRATOR_PROVIDER optional LLM provider for the orchestrator agent (openai, anthropic, google, azure, cohere, ollama); defaults to anthropic.
ORCHESTRATOR_MODEL optional Model name for the orchestrator agent; defaults to claude-sonnet-4-20250514.
CYPHER_PROVIDER optional LLM provider for Cypher query generation; defaults to anthropic.
CYPHER_MODEL optional Model name for Cypher query generation; defaults to claude-sonnet-4-20250514.
MEMGRAPH_HOST optional Hostname of the Memgraph database; defaults to localhost.
MEMGRAPH_PORT optional Port of the Memgraph database; defaults to 7687.
TARGET_REPO_PATH optional Path to the repository to analyze; auto-detected from the working directory if not set.

Run the PyPI package code-graph-rag with uvx and the mcp-server argument. Configure the required ORCHESTRATOR_API_KEY and CYPHER_API_KEY, and make Memgraph available; optionally set the target repository path. The server uses stdio transport.

.mcp.json
{"mcpServers":{"code-graph-rag":{"command":"uvx","args":["code-graph-rag","mcp-server"],"env":{"ORCHESTRATOR_PROVIDER":"anthropic","ORCHESTRATOR_MODEL":"claude-sonnet-4-20250514","ORCHESTRATOR_API_KEY":"<required>","CYPHER_PROVIDER":"anthropic","CYPHER_MODEL":"claude-sonnet-4-20250514","CYPHER_API_KEY":"<required>","MEMGRAPH_HOST":"localhost","MEMGRAPH_PORT":"7687","TARGET_REPO_PATH":"<optional-repository-path>"}}}}

Shown for Claude Code. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "code-graph-rag": {
      "command": "uvx",
      "args": [
        "code-graph-rag",
        "mcp-server"
      ],
      "env": {
        "ORCHESTRATOR_PROVIDER": "anthropic",
        "ORCHESTRATOR_MODEL": "claude-sonnet-4-20250514",
        "ORCHESTRATOR_API_KEY": "<required>",
        "CYPHER_PROVIDER": "anthropic",
        "CYPHER_MODEL": "claude-sonnet-4-20250514",
        "CYPHER_API_KEY": "<required>",
        "MEMGRAPH_HOST": "localhost",
        "MEMGRAPH_PORT": "7687",
        "TARGET_REPO_PATH": "<optional-repository-path>"
      }
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

Terminal
claude mcp add code-graph-rag -e ORCHESTRATOR_PROVIDER=anthropic -e ORCHESTRATOR_MODEL=claude-sonnet-4-20250514 -e 'ORCHESTRATOR_API_KEY=<required>' -e CYPHER_PROVIDER=anthropic -e CYPHER_MODEL=claude-sonnet-4-20250514 -e 'CYPHER_API_KEY=<required>' -e MEMGRAPH_HOST=localhost -e MEMGRAPH_PORT=7687 -e 'TARGET_REPO_PATH=<optional-repository-path>' -- uvx code-graph-rag mcp-server

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

Start the packaged Memgraph stack with cgr daemon up, parse a repository with cgr start --repo-path, then confirm the code-graph-rag MCP server connects in your client and that a natural-language question about the codebase returns an answer grounded in the graph.

Troubleshooting

  1. Verify that the code-graph-rag package can be run through uvx
  2. Check that ORCHESTRATOR_API_KEY and CYPHER_API_KEY are set and match the configured providers
  3. Confirm that Memgraph is running at the configured host and port, localhost:7687 by default
  4. Verify that TARGET_REPO_PATH points to the intended repository, or start from the correct working directory
  5. Check documented prerequisites including Docker, cmake, and ripgrep

Things to try

Once connected, you can ask your AI assistant things like:

  • Which functions in this codebase are never called from any entry point?
  • Show me the full source of the UserRepository class.
  • Refactor the parseConfig function to use explicit error handling and show a diff first.
  • Which modules reference UserService in this project?

Use cases

Understand monorepo structure with natural-language questions
Retrieve source for functions, classes, and methods by name or intent
Search and rewrite code using AST patterns
Detect dead code and trace data flow
Perform AI-assisted code editing and optimization

Supported clients

Claude Code

Listed from the project's documentation, not tested by this site.

Overview

Code-Graph-RAG uses Tree-sitter to parse multilingual codebases, stores functions, classes, methods, modules, and relationships in a Memgraph knowledge graph, and supports natural-language code querying, retrieval, editing, and optimization. It provides one graph schema for mixed-language monorepos.

Similar servers

Context7 80 · B

Upstash's official server providing up-to-date third-party library docs for AI coding assistants

★ 63.3k · Tools 2 Compare with this →

Source revision 842080fe4094 Data synced 2026-10-19 Read the FMRS scoring method