Code Graph Context logo

Code Graph Context

Builds a Neo4j code graph from TypeScript projects for semantic search, dependency analysis, and MCP-based coding assistance.

Install Code Graph Context

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "code-graph-context": {
      "command": "npx",
      "args": [
        "-y",
        "code-graph-context"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 37 tools correctly ().

Overview

code-graph-context builds a semantic graph of TypeScript code with ts-morph, stores relationships in Neo4j, and exposes the indexed context through MCP tools. It combines AST-level nodes with framework-aware meanings, vector embeddings, and natural-language-to-Cypher querying. Reach for it when an agent needs project-wide dependency, impact, dead-code, or duplicate analysis instead of isolated file inspection. Local embeddings work without API keys, while OpenAI embeddings are available as an option.

Use cases

  • Map dependencies across a TypeScript monorepo
  • Assess the blast radius of a refactor
  • Find dead exports and duplicate code
  • Locate endpoints and their related DTOs
  • Keep a code graph updated while files change

Key features

  • Neo4j-backed TypeScript code graph
  • AST and framework-aware schemas
  • Local or OpenAI vector embeddings
  • Natural-language and weighted graph queries
  • Incremental parsing and file watching
  • Impact, dead-code, and duplicate detection

Tools37

What Code Graph Context lets your agent do. Expand a tool for its parameters.

Verified live~13.0k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

What it can do

From the 37 tools this server returned when we ran it; 37 declare their own safety hints.

Can delete or modify data · 4Makes changes · 20Makes network requests · 1Read-only tools · 17
Network at startup3 connections
Files written at startupNone
Install scriptsprepare
npm provenanceNot published
Package age365 days
Maintainers1

Observed 2026-11-26 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 5d ago via OSV.dev · code-graph-context (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars18Stargazers on the source repository.
npm downloads1.4kPackage downloads in the last 30 days.
Last commit20d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed37Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Code Graph Context works

What code-graph-context does

code-graph-context indexes TypeScript projects into a Neo4j-backed graph that represents source structure and relationships. It captures AST entities such as classes, methods, imports, and declarations, then adds semantic classifications for supported frameworks. The included framework schema covers NestJS concepts such as controllers, services, and HTTP endpoints; custom schemas can describe other architectural patterns, decorators, and relationships.

The resulting graph is available to coding assistants through MCP. Agents can ask questions about dependencies, references, endpoint inputs, and the likely scope of a change without manually searching each file. Multi-project indexing is supported while keeping project data isolated within the same database.

How it works

The indexing pipeline parses TypeScript with ts-morph, writes graph relationships to Neo4j, and generates vector embeddings for semantic retrieval. Embeddings can be produced locally through a Python sidecar using the default BGE-base model, or through OpenAI when configured. Natural-language questions can be translated into Cypher queries, while weighted graph traversal ranks paths by relevance and importance.

Parsing supports workspace layouts used by Nx, Turborepo, pnpm, Yarn, and npm. Worker threads enable parallel parsing, streaming import handles larger projects, and incremental parsing limits reprocessing to changed files. File watching can update the graph as files change.

Setup and configuration

Install the package globally with npm, then run code-graph-context init. Initialization prepares Neo4j and the Python embedding sidecar, creates the required virtual environment, installs embedding dependencies, and downloads the default model. On macOS, Neo4j can run through Homebrew; other platforms use Docker, with --native and --docker available to select a provider. The data location can be changed with CGC_DATA_DIR.

The prerequisites are Node.js 18 or newer, Python 3.10 or newer for local embeddings, and either Homebrew on macOS or Docker on other platforms. Add the executable to an MCP client as a stdio server. For Claude Code, the setup command is claude mcp add --scope user code-graph-context -- code-graph-context. Projects are indexed by asking the assistant to parse the project; the server invokes parse_typescript_project for that operation.

OpenAI embeddings are optional. They use OPENAI_EMBEDDINGS_ENABLED=true together with OPENAI_API_KEY; local embeddings require neither setting. Neo4j connection settings can also be supplied through the server's environment configuration.

Tools and capabilities

  • Parse and index TypeScript projects into a graph.
  • Search code semantically with local or OpenAI embeddings.
  • Query relationships using natural-language questions and Cypher generation.
  • Traverse dependencies with weighted relevance scoring.
  • Analyze refactoring impact with LOW, MEDIUM, HIGH, and CRITICAL risk levels.
  • Detect unreferenced exports and structural or semantic duplicates.
  • Watch files and incrementally update changed code.
  • Coordinate parallel agent work through stigmergic coordination with pheromone decay.

Limitations and notes

The primary parser targets TypeScript, and framework-specific semantic interpretation depends on the configured schema. Neo4j is required for graph storage. Local embedding setup also requires Python and downloads a model with its dependencies, while the OpenAI path requires an API key. Large repositories may need the streaming and parallel parsing options during initial import.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Code Graph Context

code-graph-context is an MCP server that connects TypeScript codebases to Neo4j and exposes tools for parsing projects, searching embeddings, querying code relationships, and analyzing impact. It uses ts-morph for AST parsing and can generate local or OpenAI embeddings so coding assistants can reason across an indexed project.

Install it globally with npm using `npm install -g code-graph-context`, then run `code-graph-context init`. Initialization prepares Neo4j, creates the Python sidecar environment, installs embedding dependencies, and downloads the default local embedding model.

Yes, code-graph-context works with Claude Code as a stdio MCP server. Add it with `claude mcp add --scope user code-graph-context -- code-graph-context`, restart Claude Code, and ask it to parse the project.

No, an OpenAI API key is not required when using the local embedding sidecar. OpenAI embeddings are optional and require `OPENAI_EMBEDDINGS_ENABLED=true` plus `OPENAI_API_KEY`.

It parses TypeScript with ts-morph, stores AST and relationship data in Neo4j, and exposes graph traversal and query capabilities through MCP. Incremental parsing can limit updates to changed files, while weighted traversal helps rank relevant dependency paths.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewCode Graph Context AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/code-graph-context?style=directory)](https://allmcps.com/mcp/code-graph-context)
HTML Embed
<a href="https://allmcps.com/mcp/code-graph-context"><img src="https://allmcps.com/api/badge/code-graph-context?style=directory" alt="Code Graph Context on AllMCPs" /></a>