ai-mind-map
Allows Codeium/Windsurf AI agents to interact with codebase knowledge graph, change tracking, and persistent memory.
Click on "Install 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., "@ai-mind-mapshow me the dependency graph for user module"
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.
❓ The Problem
Every time an AI coding agent (Claude Code, Cursor, Copilot, Windsurf, Antigravity) processes a request, it re-reads your entire codebase from scratch. This wastes massive amounts of tokens:
Without AI Mind Map:
❌ Agent reads auth.ts → 5,000 tokens
❌ Agent reads auth.ts AGAIN → 5,000 tokens (same file!)
❌ Agent reads auth.ts AGAIN → 5,000 tokens (still the same file!)
Total: 15,000 tokens for 3 questions about ONE file
With AI Mind Map:
✅ mindmap_get_signature("authenticate") → 50 tokens
✅ mindmap_get_signature("validateToken") → 40 tokens
✅ mindmap_trace_dependencies("authenticate") → 100 tokens
Total: 190 tokens — that's a 99% reductionIndustry research shows ~42% of all tokens consumed by AI coding agents are avoidable waste — repeated file reads, re-discovering architecture, re-debating settled decisions.
Related MCP server: token-pilot
✨ What AI Mind Map Does
AI Mind Map is an MCP (Model Context Protocol) server that gives your AI agent:
Feature | What It Does | Token Savings |
🗺️ Knowledge Graph | Parses your entire codebase into a queryable graph of functions, classes, and relationships | 99% |
📝 Change Tracker | Knows exactly what changed since the AI's last session | 80% |
🧠 Persistent Memory | Remembers architecture decisions, conventions, and context across sessions | 90% |
🗜️ Smart Compression | Compresses build logs, test output, stack traces intelligently | 50-98% |
📊 Progressive Loading | Loads only what's needed — signatures first, full code only when asked | 90% |
⚡ Real-time Sync | File watcher keeps the graph updated as you code | Always fresh |
Inspired By The Best
This project combines proven techniques from:
Source | Technique | Their Result |
Knowledge Graph + SQLite | 99% reduction (120x fewer tokens) | |
PageRank-based Repo Map | 90%+ reduction | |
Persistent Memory with Decay | 3-4x cost reduction | |
Context Sandboxing + BM25 | 98% context reduction | |
Progressive Disclosure | 90%+ savings |
🚀 Quick Start (Windows)
Prerequisites
Node.js 18+ — Download from nodejs.org
Git — Download from git-scm.com
Option 1: One-Click Setup (Easiest)
# Clone the repo
git clone https://github.com/shdra06/ai-mind-map.git
# Enter the folder
cd ai-mind-map
# Run the setup script (installs deps + builds automatically)
.\setup.batOption 2: Manual Setup
# Clone
git clone https://github.com/shdra06/ai-mind-map.git
cd ai-mind-map
# Install dependencies
npm install --legacy-peer-deps
# Build
npm run build
# Verify it works (should print startup logs, then Ctrl+C to stop)
node dist/index.js --project-root "C:\path\to\any\project" --log-level debugYou should see output like:
[2026-06-23T10:00:00.000Z] [INFO] 🧠 AI Mind Map MCP Server starting…
[2026-06-23T10:00:00.050Z] [INFO] Project root: C:\path\to\any\project
[2026-06-23T10:00:00.100Z] [INFO] ✅ Knowledge Graph initialized
[2026-06-23T10:00:00.150Z] [INFO] ✅ Change Tracker initialized
[2026-06-23T10:00:00.200Z] [INFO] ✅ Memory initialized
[2026-06-23T10:00:00.250Z] [INFO] 🔧 All 18 MCP tools registered
[2026-06-23T10:00:01.000Z] [INFO] 📋 Initial index complete: 150 files, 2340 nodes
[2026-06-23T10:00:01.050Z] [INFO] 🧠 AI Mind Map MCP Server is LIVE🔌 Connect To Your AI Agent
Claude Code
Add to your Claude Code MCP settings file (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"ai-mind-map": {
"command": "node",
"args": [
"C:\\Users\\YOUR_USERNAME\\ai-mind-map\\dist\\index.js",
"--project-root",
"C:\\Users\\YOUR_USERNAME\\your-project"
]
}
}
}💡 Tip: Replace
YOUR_USERNAMEwith your Windows username, and point--project-rootto the project you want indexed.
Cursor
Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"ai-mind-map": {
"command": "node",
"args": [
"C:\\Users\\YOUR_USERNAME\\ai-mind-map\\dist\\index.js",
"--project-root",
"."
]
}
}
}Windsurf / Codeium
Add to your MCP configuration:
{
"mcpServers": {
"ai-mind-map": {
"command": "node",
"args": [
"C:\\Users\\YOUR_USERNAME\\ai-mind-map\\dist\\index.js",
"--project-root",
"C:\\path\\to\\project"
],
"transportType": "stdio"
}
}
}VS Code (Copilot / Continue.dev)
For any VS Code extension that supports MCP, add to your settings:
{
"mcp.servers": {
"ai-mind-map": {
"command": "node",
"args": [
"C:\\Users\\YOUR_USERNAME\\ai-mind-map\\dist\\index.js",
"--project-root",
"${workspaceFolder}"
]
}
}
}Antigravity (Gemini)
Add to your Antigravity MCP config:
{
"mcpServers": {
"ai-mind-map": {
"command": "node",
"args": [
"C:\\Users\\YOUR_USERNAME\\ai-mind-map\\dist\\index.js",
"--project-root",
"C:\\path\\to\\project"
]
}
}
}Any MCP-Compatible Agent
AI Mind Map works with any tool that supports the Model Context Protocol. Just configure:
Command:
nodeArgs:
["path/to/ai-mind-map/dist/index.js", "--project-root", "path/to/your/project"]Transport:
stdio
🔧 18 MCP Tools
Once connected, your AI agent gets these powerful tools:
🗺️ Knowledge Graph Tools (6) — 99% Token Savings
Tool | What It Does | Example |
| Search codebase by function/class name or description | "Find all authentication functions" |
| Get project architecture overview in ~100 tokens | "Show me the project structure" |
| Trace call chains — who calls what, what breaks if this changes | "What depends on the User class?" |
| Get a function/class signature without reading the whole file | "What are the params of createUser?" |
| Find everywhere a symbol is used | "Where is validateToken used?" |
| Get structural map of all symbols in a file | "What functions are in auth.ts?" |
📝 Change Tracking Tools (3) — 80% Token Savings
Tool | What It Does | Example |
| Summary of recent code changes | "What changed since yesterday?" |
| What changed since the AI's last session | "What's new since we last talked?" |
| Blast radius — what's affected by a change | "What breaks if I change login()?" |
🧠 Memory Tools (5) — 90% Cross-Session Savings
Tool | What It Does | Example |
| Retrieve relevant memories for current task | "What do we know about the auth system?" |
| Store an important fact or convention | "Remember: we use JWT for auth" |
| Retrieve past architectural decisions | "What tech decisions have we made?" |
| Record a new architectural decision | "We decided to use PostgreSQL because..." |
| Summary of previous AI sessions | "What did we work on last time?" |
🗜️ Context Tools (4) — 50-98% Compression
Tool | What It Does | Example |
| Smart context loading based on your current task | Auto-loads relevant code, memories, and changes |
| Compress build logs, test output, stack traces | Turns 10K-line log into key errors only |
| Force re-index of the entire codebase | After major refactoring |
| Show index stats, memory usage, token savings | "How much has Mind Map saved?" |
⚙️ Configuration
Project-Level Config (Optional)
Create a .mindmap.json file in your project root to customize behavior:
{
"languages": ["typescript", "python", "javascript"],
"ignore": ["node_modules", "dist", "*.test.*", "coverage"],
"tokenBudgets": {
"graphResults": 2000,
"changeSummary": 1000,
"memoryRetrieval": 1500,
"fileContent": 3000,
"totalContext": 10000
},
"memory": {
"maxMemories": 500,
"decayRate": 0.95,
"importanceThreshold": 0.1,
"maxDecisions": 200
},
"compression": "moderate",
"watchEnabled": true
}CLI Options
node dist/index.js [options]
Options:
--project-root <path> Root of the project to index (default: auto-detect from git)
--db-path <path> SQLite database location (default: .mindmap/mindmap.db)
--log-level <level> debug | info | warn | error (default: info)🌐 Language Support
Tree-sitter AST parsing with automatic regex fallback:
Language | AST Parsing | Regex Fallback | Extracts |
JavaScript | ✅ | ✅ | Functions, classes, imports, exports |
TypeScript | ✅ | ✅ | + Interfaces, types, enums, decorators |
Python | ✅ | ✅ | Functions, classes, decorators, docstrings |
Java | ✅ | ✅ | Classes, methods, interfaces, annotations |
Go | ✅ | ✅ | Functions, structs, interfaces, methods |
Rust | ✅ | ✅ | Functions, structs, traits, impls, enums |
C/C++ | ✅ | ✅ | Functions, classes, structs, macros |
C# | ✅ | ✅ | Classes, methods, interfaces, properties |
Ruby | ✅ | ✅ | Classes, modules, methods, blocks |
PHP | ✅ | ✅ | Classes, functions, traits, namespaces |
Bash | ✅ | ✅ | Functions, variables, aliases |
CSS/HTML | ✅ | ✅ | Selectors, classes, IDs |
🏗️ Architecture
┌─────────────────────────────────────────────────────┐
│ AI Mind Map MCP Server │
│ │
│ ┌─────────────────┐ ┌────────────────┐ ┌────────┐ │
│ │ Knowledge Graph │ │ Change Tracker │ │ Memory │ │
│ │ ─────────────── │ │ ────────────── │ │ ────── │ │
│ │ Tree-sitter AST │ │ Chokidar Watch │ │ Mem0 │ │
│ │ SQLite + FTS5 │ │ Git Diff │ │ Style │ │
│ │ PageRank │ │ BM25 Search │ │ Decay │ │
│ └────────┬────────┘ └───────┬────────┘ └───┬────┘ │
│ │ │ │ │
│ ┌────────┴───────────────────┴────────────────┴────┐ │
│ │ Context Engine │ │
│ │ Content-Aware Compression (9 types) │ │
│ │ Progressive Disclosure (3 tiers) │ │
│ │ Token Budget Manager │ │
│ └──────────────────────┬────────────────────────────┘ │
│ │ │
│ 18 MCP Tools │
└─────────────────────────┼───────────────────────────────┘
│ stdio
┌─────────┴──────────┐
│ Your AI Agent │
│ Claude / Cursor / │
│ Copilot / Windsurf │
└────────────────────┘How the Memory System Works
AI Mind Map uses a three-tier memory architecture (inspired by cognitive science):
Layer | What | Token Cost | Lifespan |
Working Memory | Current task context | Full price | This conversation |
Episodic Memory | Session summaries, recent decisions | On-demand retrieval | Days to weeks |
Semantic Memory | Codebase graph, architecture, conventions | Queried, never dumped | Permanent (with decay) |
Memories have importance scores that:
📈 Increase when accessed (+0.1 per access, capped at 1.0)
📉 Decay over time (configurable, default 5% per day)
🗑️ Get pruned when importance drops below threshold
This means frequently-useful memories stick around, while stale ones naturally fade.
📊 Expected Token Savings
Scenario | Without Mind Map | With Mind Map | Savings |
Find a function signature | ~5,000 tokens | ~50 tokens | 99% |
Understand project structure | ~50,000 tokens | ~500 tokens | 99% |
Resume after session break | ~20,000 tokens | ~2,000 tokens | 90% |
Trace dependency chain | ~30,000 tokens | ~200 tokens | 99% |
Check what changed | ~10,000 tokens | ~500 tokens | 95% |
Compress build log | ~8,000 tokens | ~400 tokens | 95% |
🤝 Contributing
Contributions are welcome! Here's how:
Fork the repo
Create a feature branch:
git checkout -b feature/amazing-featureMake your changes
Run the build:
npm run buildCommit:
git commit -m "Add amazing feature"Push:
git push origin feature/amazing-featureOpen a Pull Request
Development
# Watch mode (auto-recompile on changes)
npm run dev
# Type check without building
npx tsc --noEmit
# Run the server locally
node dist/index.js --project-root . --log-level debug📄 License
MIT — use it however you want. See LICENSE.
🙏 Acknowledgments
Built on the shoulders of giants:
codebase-memory-mcp — Knowledge graph architecture (99% token reduction)
Aider — Repository map with PageRank ranking
Mem0 — Persistent memory with importance decay
context-mode — Context sandboxing with BM25
context-mem — Progressive disclosure patterns
CocoIndex — Incremental AST indexing
Repomix — Codebase compression techniques
Tree-sitter — Multi-language AST parsing
MCP Protocol — The standard that makes this possible
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/shdra06/ai-mind-map'
If you have feedback or need assistance with the MCP directory API, please join our Discord server