# Codegraph (MCP server)

> Codegraph is an MCP server that adds developer tools to AI assistants such as Claude Desktop, Claude Code and Cursor. Semantic code graph: 42 tools, 38 languages. It has 109 GitHub stars, is released under the Apache-2.0 license and runs locally with npx -y @astudioplus/codegraph-mcp.

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 42 MCP tools, a VS Code extension, a JetBrains IDE plugin, and a persistent memory layer. Parses 38 languages via tree-sitter. AI agents get structured code understanding instead of grepping through files.

## Key facts

| Fact | Value |
|---|---|
| Repository | https://github.com/codegraph-ai/CodeGraph |
| GitHub stars | 109 |
| License | Apache-2.0 |
| Language | C |
| Transport | stdio |
| Packages | npm: @astudioplus/codegraph-mcp |
| Remote URL | none |
| Needs API key | no |
| Official | no |
| Works with | Claude Desktop, Claude Code, Cursor, VS Code |
| Category | Developer tools |
| Latest release | v0.21.0 (Oct 6, 2026) |
| Last commit | Oct 6, 2026 |
| MCP registry name | io.github.codegraph-ai/codegraph |

## Install

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "codegraph": {
      "command": "npx",
      "args": [
        "-y",
        "@astudioplus/codegraph-mcp"
      ]
    }
  }
}
```

Settings > Developer > Edit Config. macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\. Restart Claude Desktop afterwards.

### Claude Code

```sh
claude mcp add --transport stdio codegraph -- npx -y @astudioplus/codegraph-mcp
```

### Cursor (.cursor/mcp.json)

```json
{
  "mcpServers": {
    "codegraph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@astudioplus/codegraph-mcp"
      ]
    }
  }
}
```

Project file; use ~/.cursor/mcp.json to enable it in every project.

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "codegraph": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@astudioplus/codegraph-mcp"
      ]
    }
  }
}
```

Config formats checked against the official docs on 2026-10-07.

## Tools

- `get_ai_context`: Primary context tool. Intent-aware (explain/modify/debug/test) with token budgeting.
- `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?")
- `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_circular_deps`: Detect circular import/dependency chains across files
- `find_hot_paths`: Most-called functions ranked by transitive caller count
- `find_dead_imports`: Find unused imports — modules imported but never referenced
- `get_module_summary`: High-level summary of a directory: file count, functions, language breakdown, top complex functions
- `search_by_pattern`: Regex search across function bodies, signatures, names, and docstrings
- `search_by_error`: Find functions that throw, catch, or handle specific error types
- `symbol_search`: Find symbols by name or natural language (hybrid BM25 + semantic search)
- `get_detailed_symbol`: Full symbol info: source, callers, callees, complexity
- `get_symbol_info`: Quick metadata: signature, visibility, kind
- `get_dependency_graph`: File/module import relationships with depth control
- `get_call_graph`: Function call chains (callers and callees)
- `find_by_imports`: Find files importing a module
- `find_by_signature`: Search by param count, return type, modifiers
- `find_entry_points`: Main functions, HTTP handlers, CLI commands, event handlers
- `find_implementors`: Find all functions registered as ops struct callbacks
- `find_related_tests`: Tests that exercise a given function
- `traverse_graph`: Custom graph traversal with edge/node type filters
- `reindex_workspace`: Full or incremental workspace reindex
- `index_files`: Add/update specific files without full reindex
- `index_directory`: Add directory to graph alongside existing data
- `memory_context`: Get memories relevant to a file/function
- `pr_context`: One-call PR review. Runs git diff against base branch, finds changed functions in the graph, reports: blast radius…
- `index_markdown`: Index a local .md file (ARCHITECTURE.md, API_DESIGN.md, etc.) into the persistent docs store.
- `search_docs`: Semantic search over indexed docs — returns matching sections with heading-path breadcrumbs
- `list_doc_sources`: List all indexed source files
- `remove_doc_source`: Remove all indexed chunks from a source file
- `verify_design`: Cross-reference doc claims vs code graph. direction=forward (doc→code), reverse (code→doc), or both
- `design_gaps`: Find identifiers described in docs that don't exist in code yet — build TODO lists from specs
- `generate_architecture_doc`: Auto-generate a structured ARCHITECTURE.md from the live code graph (modules, hot paths, complexity, circular deps)
- `scan_security`: Security vulnerability scan: 40+ dangerous function patterns, source-to-sink taint tracing, auth coverage for HTTP…
- `analyze_coupling`: Module coupling metrics and instability scores
- `find_unused_code`: Dead code detection with confidence scoring
- `find_duplicates`: Detect duplicate/near-duplicate functions
- `cross_project_search`: Search across all indexed projects
- `security_control_flow`: Map every execution path through a function — "can this return without hitting the auth check?"

## Similar MCP servers

- [Gemini CLI](https://appsgit.com/mcp-servers/gemini-cli): An open-source AI agent that brings the power of Gemini directly into your terminal. (107,240 stars, Apache-2.0)
- [Front-End Checklist](https://appsgit.com/mcp-servers/front-end-checklist): Review frontend code and live pages against 386 quality-gated web development rules. (74,390 stars, MIT)
- [Claude Flow](https://appsgit.com/mcp-servers/claude-flow): AI orchestration with hive-mind swarms, neural networks, and 87 MCP tools for enterprise dev. (74,016 stars, MIT, needs API key)
- [Codebase Memory](https://appsgit.com/mcp-servers/codebase-memory): Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens. (45,917 stars, MIT)
- [Bytedance Filesystem](https://appsgit.com/mcp-servers/bytedance-filesystem): MCP server for filesystem access. (39,206 stars, Apache-2.0)
- [GitHub](https://appsgit.com/mcp-servers/github): Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language. (33,414 stars, MIT, official, needs API key)

---

Canonical page: https://appsgit.com/mcp-servers/codegraph
Source: appsgit (https://appsgit.com), the app store for github. Data from the GitHub API, refreshed nightly.
Machine access: JSON API https://appsgit.com/api/v1/apps (OpenAPI: https://appsgit.com/openapi.json), MCP server https://mcp.appsgit.com/mcp, full index https://appsgit.com/llms-full.txt.
