code-context-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@code-context-mcpsummarize this repo's architecture and list its main files"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AST Codebase Intelligence, Symbol Extraction, Cyclomatic Complexity & Refactoring Analysis for LLMs & AI Coding Agents.
💡 Why This Exists & Token Efficiency
Traditional AI coding assistants dump entire raw source files into context windows, wasting tens of thousands of tokens on boilerplate, imports, and irrelevant functions. code-context-mcp introduces a claude-mem style 3-layer workflow that provides surgical code context before editing.
⚡ 3-Layer Context Workflow
Layer 1: Structural Scan (
summarize_repository_architecture) — High-level file structure, line counts, and extensions map.Layer 2: AST Symbol Outline (
extract_python_ast_symbols) — Class definitions, method signatures, docstrings, and line ranges without dumping raw code.Layer 3: Targeted Analysis (
analyze_cyclomatic_complexity&search_code_todos_and_hotspots) — Cyclomatic complexity scores and TODO/FIXME hotspot discovery to pinpoint refactoring targets.
📊 Token Savings Comparison
Approach | Context Injected | Token Usage | Accuracy | Savings |
Naive Raw File Dumping | Entire source files | ~45,000 tokens | Moderate | 0% |
Naive Grep Search | Raw line matches | ~18,000 tokens | Low | ~60% |
| Exact AST symbols & complexity | ~6,500 tokens | High | ~85% Savings 🚀 |
Related MCP server: Paparats: Local Semantic Code Search
🏗️ Architecture Diagram
flowchart TD
A[AI Coding Agent / LLM] -->|1. Request Repo Summary| B[summarize_repository_architecture]
A -->|2. Extract AST Symbols| C[extract_python_ast_symbols]
A -->|3. Analyze Complexity| D[analyze_cyclomatic_complexity]
A -->|4. Scan Hotspots| E[search_code_todos_and_hotspots]
subgraph MCP Server Engine: code-context-mcp
B --> F[AST & Static Code Parser]
C --> F
D --> F
E --> F
end
F -->|Compact Structural Context| A🛠️ Tools Included
summarize_repository_architecture: Scans directory paths, generates file structure breakdown by extension, and computes total lines of code.extract_python_ast_symbols: Parses Python files into Abstract Syntax Trees (AST) to extract classes, base classes, methods, docstrings, function signatures, and line markers.analyze_cyclomatic_complexity: Calculates cyclomatic complexity scores for all functions/methods to identify refactoring candidates and branch depth.search_code_todos_and_hotspots: Detects code comments containingTODO,FIXME,HACK, andXXXacross the codebase with exact file and line references.
🚀 Quick Start (1-Click & 1-Command Setup)
1. Claude Code CLI
claude mcp add code-context-mcp -- python -m code_context_mcp2. Cursor (.cursor/mcp.json)
{
"mcpServers": {
"code-context-mcp": {
"command": "python",
"args": ["-m", "code_context_mcp"]
}
}
}3. OpenAI Codex CLI (~/.codex/config.toml)
[mcp_servers.code-context-mcp]
command = "python"
args = ["-m", "code_context_mcp"]4. Google Antigravity IDE (mcp_config.json)
{
"mcpServers": {
"code-context-mcp": {
"command": "python",
"args": ["-m", "code_context_mcp"]
}
}
}5. Windsurf / Cline
{
"mcpServers": {
"code-context-mcp": {
"command": "python",
"args": ["-m", "code_context_mcp"]
}
}
}This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Codebase intelligence for AI agents — dead code, blast radius, ownership.
Search indexed code, trace dependencies, assess change impact, and recall repository memory.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Related MCP Servers
- AlicenseAqualityDmaintenanceAnalyzes codebases from local directories, GitHub, and Azure DevOps, providing intelligent context to AI coding assistants through repository structure, critical files, and semantic maps.144MIT
- AlicenseAqualityBmaintenanceSelf-hosted semantic code search for AI coding agents. Indexes many repositories at once with tree-sitter AST chunking, local llama.cpp embeddings and Qdrant, so Claude Code, Cursor, Codex and any MCP client can find code by meaning, trace usages and callers, and read the git history behind each chunk. No API keys, and your code never leaves your machine.21811MIT
- AlicenseAqualityAmaintenanceProvides coding agents with repository-aware tools to understand code structure, find existing patterns, and review plans, architecture, and diffs, enabling a consistent engineering workflow across Cursor, Codex, and Claude Code.7MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to retrieve bounded, focused context from a local structural code graph, including source entities, Git relationships, and recorded project memory. It supports exploring structure, inspecting callers, callees, and impact, and carrying prior mistakes into later sessions without reading full files.9 npmMIT