← Back to directory
C

Code-Graph-RAG

Community
Graph-augmented RAG for multilingual codebases.
GitHub source repository ↗
★ 2.3k Stars Category · Dev Tools Very popular
50FMRS · D
Reliability
7/20
Security and permissions
9/20
Maintenance
11/20
Documentation
13/20
Setup experience
10/20

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.

Read the FMRS scoring method →

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.

Tools

The tool list has not been reviewed yet.

Setup

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.

claude_desktop_config.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>"}}}}

Fit and risk

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

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

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 CodeFull support