data-ai MCP Server
AST knowledge graph MCP server for Claude Code — semantic search, call graph traversal, HTTP route tracing, impact analysis. Auto-indexes 10 languages via Tree-sitter.
Discovered via github-topic:mcp and last synced 3mo ago.
1. Install the package
npx -y @sdsrs/code-graph
2. Add to claude_desktop_config.json
{
"mcpServers": {
"-sdsrs-code-graph": {
"command": "npx",
"args": [
"@sdsrs/code-graph"
]
}
}
}Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows)
Full project architecture: modules, dependencies, entry points, hot functions
Show call graph (callers/callees)
Find unused code (orphans and exported-unused)
Find semantically similar code (requires embeddings)
—
.rs
.css
Traditional
Extensions
Description
Module symbols grouped by file and type
`get_index_status`
.py, .pyi
—
.java
.html, .htm
Impact analysis (callers, routes, risk level)
`project_map`
.go
FTS5 search by concept
Show symbol details (code, type, signature)
.kt, .kts
.dart
Without code-graph
Trace HTTP route → handler → downstream calls
Find all references to a symbol
.js, .jsx, .mjs, .cjs
.php
## Architecture ``` src/ ├── domain.rs # Shared constants, relation types, env-var config ├── mcp/ # MCP protocol layer (JSON-RPC, tool registry, server) │ └── server/ # McpServer with IndexingState + CacheState sub-structs ├── parser/ # Tree-sitter parsing, relation extraction, LanguageConfig dispatch ├── indexer/ # 3-phase pipeline, Merkle tree, file watcher ├── storage/ # SQLite schema (v6), CRUD, FTS5, migrations ├── graph/ # Recursive CTE call graph queries ├── search/ # RRF fusion search combining BM25 + vector ├── embedding/ # Candle embedding model (optional, masked mean pooling) ├── sandbox/ # Context compressor with token estimation └── utils/ # Language detection, config ``` ## Installation ### Option 1: Claude Code Plugin (Recommended) Install as a Claude Code plugin for the best experience — includes slash commands, agents, skills, auto-indexing hooks, StatusLine health display, and automatic updates: ```bash # Step 1: Add the marketplace /plugin marketplace add sdsrss/code-graph-mcp # Step 2: Install the plugin /plugin install code-graph-mcp ``` What you get: - **MCP Server** — All code-graph tools available to Claude - **Slash Commands** — `/understand <module>`, `/trace <route>`, `/impact <symbol>` - **Code Explorer Agent** — Deep code understanding expert via `code-explorer` - **Auto-indexing Hook** — Incremental index on every file edit (PostToolUse) - **StatusLine** — Real-time health display (nodes, files, watch status) — compatible with other plugins' StatusLine via composite multiplexer - **Auto-update** — Checks for new versions every 6h, updates silently #### Manual Update ```bash npm update -g @sdsrs/code-graph ``` Then reconnect the MCP server in Claude Code with `/mcp`. > **Note:** Auto-update is disabled in the source repo directory (dev mode). Use manual update when developing the plugin itself. #### Invited-memory mode (quieter prompts) By default, every user prompt the plugin deems code-related gets a small context injection from `code-graph` CLI output. If you'd rather rely on MEMORY.md + explicit tool calls, opt into invited-memory mode: 1. Adopt the plugin contract into your project's memory index (idempotent, self-heals): ```bash code-graph-mcp adopt ``` This writes `plugin_code_graph_mcp.md` (decision rules) into `~/.claude/projects/<slug>/memory/` and links it from `MEMORY.md` inside a sentinel block. Run `code-graph-mcp unadopt` to remove. 2. Set the activation env var in `~/.claude/settings.json`: ```json { "env": { "CODE_GRAPH_QUIET_HOOKS": "1" } } ``` 3. Restart Claude Code. Session startup skips the project-map injection, UserPromptSubmit stops auto-injecting context, and the MCP `instructions` become a short pointer to the MEMORY.md file. ### Option 2: Claude Code MCP Server Only Register as an MCP server without the plugin features: ```bash claude mcp add code-graph-mcp -- npx -y @sdsrs/code-graph ``` ### Option 3: Cursor / Windsurf / Other MCP Clients Add to your MCP settings file (e.g. `~/.cursor/mcp.json`): ```json { "mcpServers": { "code-graph": { "command": "npx", "args": ["-y", "@sdsrs/code-graph"] } } } ``` ### Option 4: npx (No Install) Run directly without installing: ```bash npx -y @sdsrs/code-graph ``` ### Option 5: npm (Global Install) Install globally, then run anywhere: ```bash npm install -g @sdsrs/code-graph code-graph-mcp ``` ## Uninstallation ### Claude Code Plugin ```bash # Uninstall the plugin /plugin uninstall code-graph-mcp # (Optional) Remove the marketplace /plugin marketplace remove code-graph-mcp # (Optional) Clean up all config and cache data node ~/.claude/plugins/cache/code-graph-mcp/code-graph-mcp/*/scripts/lifecycle.js uninstall ``` ### Claude Code MCP Server ```bash claude mcp remove code-graph-mcp ``` ### Cursor / Windsurf / Other MCP Clients Remove the `code-graph` entry from your MCP settings file (e.g. `~/.cursor/mcp.json`). ### npm (Global) ```bash npm uninstall -g @sdsrs/code-graph ``` ## MCP Tools
File-level dependency graph
.c, .h
Structural search with `--type`/`--returns`/`--params` filters
.ts, .tsx
.rb
.swift