MCP Directory

CodeGraphContext

Index local code into a graph database to give AI assistants deep, queryable code context.

Unverified
stdio (local)
No auth
Python

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
pip install codegraphcontext

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "codegraphcontext": {
      "command": "codegraphcontext",
      "args": [
        "mcp",
        "start"
      ],
      "env": {
        "NEO4J_URI": "YOUR_NEO4J_URI",
        "NEO4J_USERNAME": "YOUR_NEO4J_USERNAME",
        "NEO4J_PASSWORD": "YOUR_NEO4J_PASSWORD"
      }
    }
  }
}

Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf

Before you start

  • Python 3.10 or later
  • pip package manager
  • Git (optional, for cloning repositories)
  • A graph database backend — embedded FalkorDB Lite / KuzuDB requires no setup; external Neo4j is optional via `codegraphcontext neo4j setup`

About CodeGraphContext

A powerful MCP server plus CLI toolkit that indexes local code into a graph database to provide context to AI assistants and developers. Use it as a standalone CLI for comprehensive code analysis, or connect it to an AI IDE via MCP for AI-powered code understanding. It parses 23 languages with tree-sitter (optionally SCIP) into a graph of functions, classes, methods, inheritance, calls, and imports, then answers questions about callers/callees, class hierarchies, multi-file call chains, dead code, and complexity. Supports embedded backends (FalkorDB Lite, KuzuDB, LadybugDB) or external Neo4j/Nornic DB.

Tools & capabilities (25)

add_code_to_graph

Performs a one-time scan of a local folder to add its code to the graph. Ideal for indexing libraries, dependencies, or projects not being actively modified. Returns a job ID for background processing.

check_job_status

Check the status and progress of a background job.

list_jobs

List all background jobs and their current status.

find_code

Find relevant code snippets related to a keyword (e.g., function name, class name, or content).

analyze_code_relationships

Analyze code relationships like 'who calls this function' or 'class hierarchy'.

watch_directory

Continuously monitors a directory and keeps the graph updated.

execute_cypher_query

Run a read-only Cypher query against the code graph.

add_package_to_graph

Add a package to the graph.

find_dead_code

Find potentially unused functions.

calculate_cyclomatic_complexity

Calculate the cyclomatic complexity of a function.

find_most_complex_functions

Find the most complex functions in the codebase.

list_indexed_repositories

List all indexed repositories.

delete_repository

Delete a repository from the graph.

visualize_graph_query

Generate a Neo4j visualization URL for a Cypher query.

list_watched_paths

List all watched directories.

unwatch_directory

Stop watching a directory.

load_bundle

Load a pre-indexed bundle.

search_registry_bundles

Search registry bundles.

get_repository_stats

Get repository statistics.

discover_codegraph_contexts

Discover .codegraphcontext folders.

switch_context

Switch the active graph context.

generate_report

Generate a codegraph report.

find_java_spring_endpoints

Find Spring endpoints.

find_java_spring_beans

Find Spring beans.

find_datasource_nodes

Query datasource nodes.

What this server can do

CodeGraphContext provides tools for these capabilities — tap one to see every MCP server that does the same:

When to use it

  • Ask an AI assistant 'what other functions call get_user_by_id?' or 'if I change calculate_tax, what is affected?'
  • Trace full call chains across hundreds of files for impact analysis and debugging
  • Explore class hierarchies and find all implementations of a method
  • Detect dead/unused code and the most cyclomatically complex functions
  • Keep the graph live by watching a directory while you actively develop
  • Instantly load pre-indexed .cgc bundles of well-known repositories without re-indexing

Security notes

The MCP protocol connection itself requires no auth. The optional `env` block in the config supplies Neo4j credentials (NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD) only when using an external Neo4j backend; the default embedded database (FalkorDB Lite / KuzuDB) needs none. CGC stores database credentials in ~/.codegraphcontext/.env. The execute_cypher_query tool is documented as read-only.

CodeGraphContext FAQ

Is a Neo4j server required?

No. CodeGraphContext uses an embedded graph database by default (FalkorDB Lite on Unix, or KuzuDB cross-platform), so no extra setup is needed for most users. Neo4j is an optional external backend configured via `codegraphcontext neo4j setup`, and its credentials go in the config's env block.

Which languages are supported?

23 languages including Python, JavaScript, TypeScript/TSX, Java, C, C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Dart, Perl, Lua, Scala, Haskell, Elixir, Emacs Lisp, HTML, and CSS. Each parser extracts functions, classes, methods, parameters, inheritance, calls, and imports.

How do I configure my AI IDE?

Run `codegraphcontext mcp setup` to auto-detect and configure VS Code, Cursor, Windsurf, Zed, Claude, Gemini CLI, ChatGPT Codex, Cline, RooCode, Amazon Q Developer, Kiro, Goose, or OpenCode. You can also configure manually by adding the mcpServers block to your client's settings, then start the server with `codegraphcontext mcp start`.

What is SCIP indexing?

An optional mode (SCIP_INDEXER=true in ~/.codegraphcontext/.env) where some languages use external SCIP indexers — scip-clang for C/C++ (needs compile_commands.json) and scip-dotnet for C# — for more accurate calls and inheritance than tree-sitter heuristics alone. It falls back to tree-sitter when unavailable.

Alternatives to CodeGraphContext

Compare all alternatives →

Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).

Featured
Verified
stdio (local)
No auth
TypeScript
12 tools
Updated 13 days agoRepo

Up-to-date, version-specific library documentation injected into your coding agent.

Verified
stdio (local)
API key
TypeScript
2 tools
Updated 17 days agoRepo

LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.

Verified
stdio (local)
No auth
Python
11 tools
Updated 15 days agoRepo