ContextMap
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., "@ContextMap analyze the impact of editing the payment service"
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.
# 🧭 ContextMap
Local AST-powered Context Map & MCP Server for AI Coding Assistants
Stop burning tokens blindly and stop your AI from breaking 3 screens when you ask to edit 1.
🇧🇷 Ler em Português (README.pt-BR.md)
💡 Why ContextMap?
When building apps with AI (Cursor, Claude, Windsurf, Antigravity, Gemini, etc.), three things happen constantly:
Token burn: Every small request makes the AI scan dozens of irrelevant files or re-audit things you already resolved.
Domino regressions: Tweaking one file silently breaks dependent screens or removes permission checks.
Recurring AI blind spots: Modals closing when you highlight text and release the mouse outside (
onClickinstead ofonMouseDown), users stuck on stale cache withoutCtrl+F5, expensive N+1 database loops, timezone bugs, and forms losing unsaved input.
ContextMap runs 100% locally on your machine (your code never leaves your computer), parses your codebase directly from the AST using Tree-sitter with incremental hash caching, and exposes surgical context to your AI via MCP (Model Context Protocol) + a clean bilingual visual dashboard (🇺🇸 EN / 🇧🇷 PT).
🏆 The "Smart Plan ➔ Cheap Execution" Workflow
Plan with a top model + ContextMap (Zero-Edit Rule): ContextMap never modifies your code — it isolates the exact domino effect, God Nodes (PageRank), code skeletons, and pending checklist items so a top model builds a rock-solid plan using a fraction of the tokens.
Execute with a cheaper/faster model: Hand the surgical plan to a lighter model to implement safely.
Related MCP server: io.github.pmgarg/cgraphy
✨ Key Features
🌳 Real AST Dependency Graph (Never Goes Stale): Powered by
web-tree-sitterwith incremental SHA-256 hash caching — only modified files are re-parsed in milliseconds.👑 PageRank "God Nodes" & Domino Effect: Identifies central hub files and traces 1st, 2nd, and 3rd-degree impact before you touch a single line.
🦴 Code Skeletons (Up to ~90% Fewer Tokens): Extracts function signatures and interfaces without dumping entire 1,500-line files into the prompt.
📋 Persistent Inspection Checklist (Zero Repeated Token Burn): Mark baseline improvements as
Done,Pending, orLeave as is. Future targeted change analyses automatically skip already-decided items.🔍 Built-in Real Code Sensors:
🪟 Modal Drag-Close Detector: Finds exact files and line numbers where modal backdrops use
onClickinstead ofonMouseDown.🔄 Auto-Update / No-
Ctrl+F5Detector: Checks whether your app notifies users of new deployments and provides tailored recipes (React/Vite or Vanilla JS).💸 Database Cost & Memory Sensors: Flags N+1 queries inside loops, unbounded
select('*'), realtime listeners, and heavy files.📝 Form Draft & Security Guardrails: Detects long forms without local cache and tracks admin/role permission checks across versions (Before vs. After audit).
🛡️ Anti-Bug Vaccines & Canonical Blueprints: 18 battle-tested rules and 4 ready-to-use architectural templates.
🌌 Interactive 3D Graph + Bilingual Dashboard (
🇺🇸 EN / 🇧🇷 PT): Runs locally athttp://localhost:3000.
🚀 Quick Start (3 Steps)
Prerequisites
Node.js (v18 or higher)
1. Clone & Install
git clone https://github.com/Leoomk/contextmap.git
cd contextmap
npm install2. Start the Local Dashboard & MCP Server
npm start(On Windows, you can also double-click START_CONTEXTMAP.bat.)
Open http://localhost:3000 in your browser, select any local project folder, and click ⚡ Analyze.
🔌 Connecting to Your AI via MCP (Cursor, Claude, Antigravity, Windsurf)
Add ContextMap to your MCP client configuration (replace /ABSOLUTE/PATH/TO/contextmap with the folder where you cloned it):
{
"mcpServers": {
"contextmap": {
"command": "node",
"args": ["/ABSOLUTE/PATH/TO/contextmap/index.js"]
}
}
}Available MCP Tools
Tool | What it does |
| Project blueprint: KPIs, God Nodes, DB tables, Auto-Update & Modal sensors |
| Surgical analysis for a specific feature/change — skips already-decided checklist items |
| Full domino effect (direct + indirect), security guards, twin logic & XML skeletons |
| Extracts lightweight code skeletons to save up to ~90% tokens |
| Instant search for functions, tables, and security checks |
| Shortest dependency path (BFS) between two modules |
| Read and persist user decisions ( |
| Compares Before vs. After snapshots to ensure no security guards were lost |
| Returns canonical code blueprints ( |
🔒 Privacy First
ContextMap runs 100% locally on your machine. No source code, filenames, or project data are ever sent to any external server. Local history snapshots are stored only in your local data/ folder (ignored by Git).
🤝 Contributing
Found a recurring AI bug that should become a built-in sensor or vaccine?
Open an Issue or submit a Pull Request!
📄 License
MIT License — created by Leonardo Gonçalves (@Leoomk).
Available Tools
11 toolsmc_analisar_impactoB
Analisa o raio de explosão (efeito dominó direto e indireto), travas de segurança e checklist em XML blindado de alta densidade semântica.
Inputs: target_id (required), caminho_projeto.
mc_analisar_mudanca_especificaA
Analisa cirurgicamente uma nova funcionalidade ou alteração pontual: NÃO reavalia itens do checklist já resolvidos ou ignorados, focando 100% no raio de impacto da mudança solicitada.
Inputs: arquivo_alvo (required), descricao_mudanca (required), caminho_projeto.
mc_atualizar_checklistB
Registra a decisão do usuário sobre um item de melhoria ('feito', 'ignorado', 'pendente') no histórico do projeto para não reavaliar nem gastar tokens nas próximas sessões.
Inputs: status (required), item_id (required), observacao, caminho_projeto.
mc_auditar_modificacoesA
Compara o estado do projeto antes e depois da edição da IA, avisando se alguma trava de segurança foi perdida ou se novos custos de banco surgiram.
Inputs: caminho_projeto.
mc_buscar_contextoB
Pesquisa instantânea de termos, funções, tabelas ou regras de negócio no projeto sem precisar ler arquivos no escuro.
Inputs: termo (required), caminho_projeto.
mc_injetar_vacinasB
Aplica vacinas anti-erro (.cursor/rules/*.mdc) e constituição tricameral (AGENTS.md) diretamente na pasta do projeto atual.
Inputs: blocos, vacinas, caminho_projeto.
mc_obter_checklistA
Consulta o Caderno de Vistoria / Checklist do projeto com itens auditados, separando o que já foi FEITO, o que foi IGNORADO (deixar como está) e o que está PENDENTE.
Inputs: caminho_projeto.
mc_obter_esqueletoA
Devolve apenas as assinaturas de funções e tipos de um arquivo (stubs elididos com ⋮), economizando até 94% dos tokens.
Inputs: arquivo (required), caminho_projeto.
mc_obter_modeloA
Entrega o código-fonte canônico completo e especificações de um Super-Bloco Estrutural ('auth-rbac', 'admin-kpis', 'safe-modal-toast', 'auto-update-banner').
Inputs: id_bloco (required).
mc_obter_resumoB
Entrega a planta baixa do projeto com KPIs de saúde, tabelas de banco, Arquivos-Deus (Hubs Centrais) e salva automaticamente a fotografia no histórico.
Inputs: caminho_projeto.
mc_rastrear_caminhoB
Descobre o caminho exato de conexões (pontes de dependência) entre dois arquivos/módulos para entender como a Tela A afeta o Serviço B.
Inputs: origem (required), destino (required), caminho_projeto.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a distinct artifact or action: checklist read/update, model retrieval, summary, skeleton, search, path tracing, impact analysis, modification audit, and vaccine injection. The only soft overlap is between mc_analisar_mudanca_especifica and mc_analisar_impacto, both impact-oriented, though descriptions differentiate (focused change vs. domino-effect radius).
All tools use a uniform mc_ prefix followed by Portuguese verb_noun snake_case (obter_resumo, analisar_impacto, injetar_vacinas). The pattern is entirely predictable and readable.
11 tools is well within the ideal band and each maps to a concrete capability in the context-mapping workflow. No tool appears redundant or filler.
The surface covers the core lifecycle: read context, search, retrieve models/skeletons, analyze impact and changes, track checklist state, audit diffs, and inject rules. Minor gaps exist—no way to list/switch projects, add new checklist items, or reset/clear project history.
Maintenance
Related MCP Connectors
The Cortex MCP server provides read-only access to real-time engineering context from the Cortex developer portal, allowing AI coding assistants to answer natural language questions about your organization's catalog (microservices, libraries, domains, teams, infrastructure), scorecards (engineering standards and best practices), initiatives (goals and deadlines), and Engineering Intelligence metrics. It includes tools for querying documentation, tracking personal entities, and accessing AI-assisted insights across the entire Cortex ecosystem.
Shared context for your codebase: a hosted code knowledge graph over MCP. Free plan, OAuth sign-up.
One shared context your team's AI tools read & write over MCP. No re-explaining. Free.
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with a structured, token-efficient map of a codebase's symbols, dependencies, and relationships via MCP tools like overview, query, and impact analysis.9MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to query a codebase as a knowledge graph, providing token-budgeted context, search, and impact analysis via MCP tools.27 PyPIMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to locally search, query, and understand codebases with token-efficient context, dependency graphs, history, architecture diagrams, and metrics through MCP.15 npm3MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to retrieve focused, token-bounded context from a local structural code graph—including source entities, Git relationships, and project memory—so they can inspect relevant code and relationships without reading entire files. It serves this context through MCP for integration with supported IDEs and agents.24 npmMIT