LabscoMCP early access ↗
CodeGraphContextMCP SERVER · OFFICIAL PROJECT

CodeGraphContext

Index a codebase into a queryable graph — call relationships, dead code, complexity, Cypher queries — with a path sandbox around it.

by CodeGraphContext ↗Code Intelligence & Repository Indexing✓ Official

LABSCO SUMMARY

A path sandbox is on by default, which is unusual and welcome.

Anything that indexes is restricted to the server's working directory unless CGC_ALLOWED_ROOTS names more, so a stray instruction cannot point it at your home folder. The graph is what the tools are for: dead code and cyclomatic complexity are queries over structure, not text searches, and execute_cypher_query is there for the questions nobody wrote a tool for.

What it is

A code-graph server. It parses repositories with tree-sitter into a graph database, then exposes that graph to an agent: relationships between symbols, complexity metrics, and raw Cypher when the shaped tools are not enough. The embedded database is the default, so there is nothing to run alongside it.

What you get

  • Local folders and installed packages indexed into the graph, with repositories listed, removed and counted — add_code_to_graph, add_package_to_graph, list_indexed_repositories, delete_repository, get_repository_stats
  • Keyword search over indexed symbols and content, with fuzzy matching and an edit distance — find_code
  • Relationship analysis across files, dead code detection, cyclomatic complexity, and the most complex functions ranked — analyze_code_relationships, find_dead_code, calculate_cyclomatic_complexity, find_most_complex_functions
  • Raw Cypher against the graph, with query visualisation and report generation — execute_cypher_query, visualize_graph_query, generate_report
  • Directories watched for changes, so the graph stays current — watch_directory, list_watched_paths, unwatch_directory
  • Job control for long indexing runs — list_jobs, check_job_status
  • Java Spring specifics: endpoints, beans and datasource nodes — find_java_spring_endpoints, find_java_spring_beans, find_datasource_nodes
  • Multi-project handling: discover indexed contexts in sub-directories and switch the session between them — discover_codegraph_contexts, switch_context
  • Package indexing across python, javascript, typescript, java, c, go, ruby, php and cpp

Requirements

pip install codegraphcontext. The database is embedded by default — FalkorDB Lite, with KuzuDB as a cross-platform alternative and Neo4j available through codegraphcontext neo4j setup if you want an external server. Indexing, bundle load, watch and context-switch tools only accept paths under the server's working directory plus whatever you list in CGC_ALLOWED_ROOTS, colon-separated on Linux and macOS, semicolon-separated on Windows. A Docker image is published. Version 0.6.5.

Setup effort

One command — pip install codegraphcontext