CodeGraph MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install -g @memoryx/codegraph-mcp
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add codegraph -- node "<FULL_PATH_TO_CODEGRAPH_VSCODE>/dist/index.js"

Replace <FULL_PATH_TO_CODEGRAPH_VSCODE>/dist/index.js with the actual folder you prepared in step 1.

README.md

Cross-language code intelligence for AI agents and developers.

CodeGraph

Cross-language code intelligence for AI agents and developers.

CodeGraph builds a semantic graph of your codebase — functions, classes, imports, call chains — and exposes it through 31 tools, a VS Code extension, and a persistent memory layer. AI agents get structured code understanding instead of grepping through files.

Quick Start

MCP Server (Claude Code, Cursor, any MCP client)

npm install -g @memoryx/codegraph-mcp

Add to ~/.claude.json (or your MCP client config):

{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph-mcp",
      "args": []
    }
  }
}

The server indexes the current working directory automatically — no --workspace flag needed. It also accepts MCP roots from the client for workspace discovery.

Multi-project indexing — index multiple codebases into a single graph:

{
  "mcpServers": {
    "codegraph": {
      "command": "codegraph-mcp",
      "args": [
        "--workspace", "/path/to/frontend",
        "--workspace", "/path/to/backend",
        "--workspace", "/path/to/shared-lib"
      ]
    }
  }
}

VS Code Extension

code --install-extension codegraph-0.10.0.vsix

The extension registers 30 tools as VS Code Language Model Tools. To steer Copilot toward using them:

// .vscode/settings.json
{
  "github.copilot.chat.codeGeneration.instructions": [
    "When analyzing code structure, callers, callees, dependencies, or complexity, prefer codegraph_* tools over file search. CodeGraph has a pre-built semantic graph that returns structured results instantly."
  ]
}

Tools (31)

Code Analysis (9)

Tool What it does
get_ai_context Primary context tool. Intent-aware (explain/modify/debug/test) with token budgeting. Returns source, related symbols (full or signature-only), file imports, sibling functions, debug hints, architecture.
get_edit_context Everything needed before editing: source + callers + tests + memories + git history
get_curated_context Cross-codebase context for a natural language query ("how does auth work?")
get_dependency_graph File/module import relationships with depth control
get_call_graph Function call chains (callers and callees)
analyze_impact Blast radius prediction — what breaks if you modify, delete, or rename
analyze_complexity Cyclomatic complexity with breakdown (branches, loops, nesting, exceptions, early returns)
find_unused_code Dead code detection with confidence scoring
analyze_coupling Module coupling metrics and instability scores

Code Navigation (12)

Tool What it does
symbol_search Find symbols by name (hybrid BM25 + semantic search)
get_callers / get_callees Who calls this? What does it call? (with transitive depth)
get_detailed_symbol Full symbol info: source, callers, callees, complexity
get_symbol_info Quick metadata: signature, visibility, kind
find_by_imports Find files importing a module (moduleName param)
find_by_signature Search by param count, return type, modifiers
find_entry_points Main functions, HTTP handlers, tests
find_related_tests Tests that exercise a given function
traverse_graph Custom graph traversal with edge/node type filters
cross_project_search Search across all indexed projects

Memory (10)

Persistent AI context across sessions — debugging insights, architectural decisions, known issues.

Tool What it does
memory_store / memory_get / memory_search Store, retrieve, search memories (BM25 + semantic)
memory_context Get memories relevant to a file/function
memory_list / memory_invalidate / memory_stats Browse, retire, monitor
mine_git_history / mine_git_history_for_file Auto-create memories from commits
search_git_history Semantic search over commit history

All tool names are prefixed with codegraph_ (e.g. codegraph_get_ai_context).


Languages

17 languages parsed via tree-sitter — all with functions, imports, call graph, complexity metrics, dependency graphs, symbol search, impact analysis, and unused code detection:

TypeScript/JS, Python, Rust, Go, C, C++, Java, Kotlin, C#, PHP, Ruby, Swift, Tcl, Verilog/SystemVerilog, COBOL, Fortran


Architecture

MCP Client (Claude, Cursor, ...)        VS Code Extension
        |                                       |
    MCP (stdio)                            LSP Protocol
        |                                       |
        └───────────┐               ┌───────────┘
                    ▼               ▼
            ┌───────────────────────────

Tools (10)

get_ai_contextPrimary context tool for intent-aware code analysis including source, related symbols, and architecture.
get_edit_contextRetrieves source, callers, tests, memories, and git history for editing.
get_curated_contextProvides cross-codebase context for natural language queries.
analyze_impactPredicts the blast radius of code modifications, deletions, or renames.
analyze_complexityCalculates cyclomatic complexity with a breakdown of branches, loops, and nesting.
find_unused_codeDetects dead code with confidence scoring.
symbol_searchFinds symbols by name using hybrid BM25 and semantic search.
get_callersIdentifies functions that call a specific symbol.
get_calleesIdentifies functions called by a specific symbol.
memory_storeStores persistent AI context across sessions.

Configuration

claude_desktop_config.json
{"mcpServers": {"codegraph": {"command": "codegraph-mcp", "args": []}}}

Try it

Analyze the impact of renaming the 'AuthService' class in my project.
How does the authentication flow work across the codebase?
Find all unused functions in the current directory.
What is the cyclomatic complexity of the main controller module?
Find all tests that exercise the 'processPayment' function.

Frequently Asked Questions

What are the key features of CodeGraph?

Builds a semantic graph of codebases including functions, classes, and call chains.. Supports 17 programming languages via tree-sitter parsing.. Provides persistent memory for AI context across sessions.. Enables cross-project code search and dependency analysis.. Offers impact analysis and complexity metrics for codebases..

What can I use CodeGraph for?

Debugging complex codebases by visualizing call chains and dependencies.. Refactoring code with impact analysis to predict potential breaking changes.. Onboarding to a new project by querying architectural decisions and code structure.. Identifying and cleaning up dead code to reduce technical debt.. Maintaining persistent context of architectural decisions across multiple AI sessions..

How do I install CodeGraph?

Install CodeGraph by running: npm install -g @memoryx/codegraph-mcp

What MCP clients work with CodeGraph?

CodeGraph works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep CodeGraph docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare