Skip to content
Conduit

mcp server

ai-mind-map

🧠 MCP Server that reduces AI coding agent token usage by 80-99%. Knowledge graph + persistent memory + smart compression for Claude, Cursor, Copilot, and any MCP-compatible agent.

shdra06/ai-mind-mapcommunitylistedunreviewed

Set up

Runs on your computer. Pick your agent and operating system.

Before you start

  • Node.js 20 or newer
~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "shdra06-ai-mind-map": {
      "command": "npx",
      "args": [
        "-y",
        "ai-mind-map"
      ]
    }
  }
}

same format Cursor, GitHub Copilot CLI, Junie, JetBrains AI Assistant, Augment (Auggie CLI), Factory Droid, Kiro, Devin CLI +12

Values in angle brackets are placeholders. Restart Claude Desktop after editing its config.Claude Desktop docs

README

synced Oct 17, 2026

🌐 Live Website

ai-mind-map-website.vercel.app β€” Interactive landing page with a live D3.js knowledge graph of the real codebase (120 nodes, 300 edges), token savings calculator, tools explorer, and one-command install wizard.


πŸ§ͺ TestSprite Hackathon β€” Season 3

This project is a submission for the TestSprite Season 3 Hackathon. The TestSprite verification loop ran against the live website across 2 rounds, finding and fixing 4 real product bugs.

TestPriorityStatus
Live brain graph renders real codebase dataP0βœ… passed
Homepage hero + comparison cardsP0⚠️ inconclusive (agent: PASS, D3 render overhead)
Tools explorer search filteringP1βœ… passed
Token savings calculator slidersP1βœ… passed
Install wizard agent switchingP1βœ… passed
Full site navigationP2βœ… passed

Bugs found by TestSprite:

  • πŸ› Brain graph search input had no ARIA β€” invisible to accessibility tree
  • πŸ› Install page: 3 identical Copy buttons with no unique identifiers
  • πŸ› D3 drag handler fired on every mousedown β€” hover selected nodes incorrectly
  • πŸ› Homepage hero + CTA both had identical Copy buttons β€” agent blocked

See LOOP.md for the full iteration log, root cause analysis, and fixes.

CI/CD: TestSprite runs automatically on every push via GitHub Actions.


⚑ Install in One Command

npx ai-mind-map install

Auto-detects Claude, Cursor, VS Code, Windsurf, Antigravity, Zed, Continue.dev β€” configures all of them instantly. No config files. No manual setup. Just run and restart your agent.



Choosing the right tool

For exact repository comparisons without sending patches to a model, use the packaged git-diff skill. ai-mind-map diff HEAD~1 HEAD compares two commits; ai-mind-map diff --fetch compares current staged, unstaged, and non-ignored new files against the refreshed configured push destination. The command returns local patch and viewer paths. Generating and viewing the artifacts makes no LLM calls; chat and model analysis still use tokens.

AI Mind Map helps agents reuse indexed project knowledge, resolve supported symbol relationships, and inspect routes. Native search and bounded reads are often cheaper for exact names, literals, known files, and small configurations. The skill chooses between these paths rather than requiring extra index calls for every task.

Repeated local benchmarks compare actual MCP responses against ripgrep and targeted reads, including correctness checks and separate indexing/schema costs. See the benchmark report and run npm run benchmark -- --rounds 5 --files 250 to reproduce the comparison. Token counts are estimates, not billing measurements; there is no universal savings percentage.


✨ What AI Mind Map Does

AI Mind Map is an MCP (Model Context Protocol) server that gives your AI agent:

FeatureWhat It DoesBoundary
πŸ—ΊοΈ Knowledge GraphParses your entire codebase into a queryable graph of functions, classes, and relationshipsDepends on task and baseline
πŸ“ Change TrackerKnows exactly what changed since the AI's last sessionSource verification still matters
🧠 Persistent MemoryRemembers architecture decisions, conventions, and context across sessionsDepends on task and baseline
πŸ—œοΈ Smart CompressionCompresses build logs, test output, stack traces intelligentlyLossy; inspect retained evidence
πŸ“Š Progressive LoadingLoads only what's needed β€” signatures first, full code only when askedDepends on task and baseline
⚑ Real-time SyncFile watcher keeps the graph updated as you codeSize/mtime freshness is heuristic

Inspired By The Best

This project combines proven techniques from:

SourceTechniqueTheir Result
codebase-memory-mcpKnowledge Graph + SQLite99% reduction (120x fewer tokens)
AiderPageRank-based Repo Map90%+ reduction
Mem0Persistent Memory with Decay3-4x cost reduction
context-modeContext Sandboxing + BM2598% context reduction
context-memProgressive Disclosure90%+ savings

πŸš€ Quick Start

Method 1: Global Install (Recommended β€” Most Reliable)

npm install -g ai-mind-map

# Auto-detect and configure all your AI agents
ai-mind-map install

# Check everything is working
ai-mind-map doctor

Method 2: npx (Quick β€” No Install)

# Run directly without installing anything
npx ai-mind-map install

# ⚠️ If you get "bindings.js" errors, use Method 1 instead (npx cache can corrupt native modules)

Method 3: Clone (For Development)

git clone https://github.com/shdra06/ai-mind-map.git
cd ai-mind-map
npm install --legacy-peer-deps
npm run build
node dist/cli.js install

What install Does

  1. βœ… Scans your system for AI coding agents (Claude, Cursor, VS Code, Windsurf, Antigravity, Zed, Continue.dev)
  2. βœ… Writes MCP config to each agent's config file
  3. βœ… Deploys rules files so agents know about our 41 tools
  4. βœ… Runs diagnostics to verify everything works

Verify It Works

ai-mind-map doctor

Output:

🩺 AI Mind Map β€” Diagnostics
────────────────────────────────────────────────────────
  βœ” Node.js           v24.x (>= 18 required)
  βœ” SQLite             In-memory test passed
  βœ” TypeScript Build   dist/index.js exists
  βœ” Agents             3 detected, 3 configured

πŸ”Œ Connect To Your AI Agent

Automatic (Recommended)

npm install -g ai-mind-map
ai-mind-map install

This auto-detects all 7 agents and writes the config for you. Done.

What Gets Written

After running install, each agent's config file contains:

{
  "mcpServers": {
    "ai-mind-map": {
      "command": "ai-mind-map",
      "args": []
    }
  }
}

πŸ’‘ Note: If you installed globally, the command is ai-mind-map. If using npx, it writes "command": "npx", "args": ["-y", "ai-mind-map"]. Both work, but global is more reliable for native dependencies.

Manual Setup (If You Prefer)

If you want to configure manually, add this to your agent's config:

{
  "mcpServers": {
    "ai-mind-map": {
      "command": "npx",
      "args": ["-y", "ai-mind-map"]
    }
  }
}
{
  "mcpServers": {
    "ai-mind-map": {
      "command": "npx",
      "args": ["-y", "ai-mind-map"]
    }
  }
}
{
  "mcp.servers": {
    "ai-mind-map": {
      "command": "npx",
      "args": ["-y", "ai-mind-map"]
    }
  }
}
{
  "mcpServers": {
    "ai-mind-map": {
      "command": "npx",
      "args": ["-y", "ai-mind-map"]
    }
  }
}
{
  "mcp.servers": {
    "ai-mind-map": {
      "command": "npx",
      "args": ["-y", "ai-mind-map"]
    }
  }
}
Command:   npx
Args:      -y ai-mind-map
Transport: stdio

πŸ’‘ After configuring, restart your AI agent so it picks up the new MCP server.


πŸ”§ 50+ MCP Tools

Once connected, your AI agent automatically gets all tools + a built-in guide telling it which tool to call first and when to use each one.

How AI Agents Discover Our Tools

AI Agent connects β†’ Server sends 3 things:

1. βœ… instructions    β†’ "Call mindmap_session_resume FIRST" (auto-loaded)
2. βœ… tools/list      β†’ All 50 tools with descriptions + schemas (auto-loaded)
3. βœ… prompts/list    β†’ Interactive guides (on request)

🌐 Client Compatibility

ClientWorks?How AI Learns Our Tools
Claude Code / Desktopβœ…instructions + tools/list + prompts + rules file (CLAUDE.md)
Cursorβœ…tools/list + rules file (.cursorrules)
VS Code Copilotβœ…tools/list + rules file (.github/copilot-instructions.md)
Windsurfβœ…tools/list + rules file (.windsurfrules)
Antigravity (Gemini)βœ…tools/list + rules file (.agents/AGENTS.md)
Zedβœ…tools/list + MCP config
Continue.devβœ…tools/list + MCP config
Any MCP clientβœ…tools/list (universal MCP spec)
Ollama / LM Studio⚠️Not MCP clients natively β€” use via Continue.dev or Open WebUI
Codex (OpenAI)⚠️Not MCP natively β€” requires MCP bridge

Key: tools/list works with every MCP client. Rules files (CLAUDE.md, .cursorrules, etc.) are deployed by npx ai-mind-map install as a fallback for clients that don't honor the instructions field.


⚑ Code Memory Engine (v1.4.0) β€” NEW

ToolWhat It DoesToken Savings
mindmap_session_resume ⭐⭐Resume from last session β€” returns what was worked on, what changed, project stats15-30K/session
mindmap_session_startStart tracking a new AI coding taskβ€”
mindmap_session_endEnd session with summary for next agentβ€”
mindmap_changelog ⭐Symbol-level diffs β€” added/modified/deleted functions since a time20-50K/session
mindmap_hotspotsMost frequently changed files + symbols5-10K
mindmap_digest ⭐Full project summary in <2000 tokens10-25K/session
mindmap_file_digest ⭐Understand a file WITHOUT reading it3-10K/file
mindmap_verifyHash-based content verification β€” check if cached code is still valid3-10K/file

πŸ—ΊοΈ Knowledge Graph (6)

ToolWhat It Does
mindmap_searchSearch codebase by function/class name or free text
mindmap_get_structureProject architecture overview in ~100 tokens
mindmap_trace_dependenciesTrace call chains β€” who calls what
mindmap_get_signatureFunction signature without reading the file
mindmap_find_referencesFind everywhere a symbol is used
mindmap_get_file_mapAll symbols in a file with line ranges

⭐ Smart Tools β€” targeted context

ToolWhat It Does
mindmap_explainEverything about a symbol in 1 call β€” signature, callers, callees, layer, blast radius, git history
mindmap_git_changesGit-aware symbol-level diffs β€” which functions changed, who's impacted
mindmap_smart_searchRich search β€” returns full context so AI never reads files

πŸ” Semantic Search (3)

ToolWhat It Does
mindmap_semantic_searchSearch by meaning β€” "authentication", "error handling", "data validation"
mindmap_semantic_statsVocabulary size, index coverage
mindmap_synonymsProgramming synonym lookup

πŸ“ Change Tracking (3)

ToolWhat It Does
mindmap_what_changedSummary of recent code changes
mindmap_session_diffWhat changed since last AI session
mindmap_impact_analysisBlast radius of a change

🧠 Memory (5)

ToolWhat It Does
mindmap_recallRetrieve relevant memories
mindmap_rememberStore a fact or convention
mindmap_get_decisionsPast architectural decisions
mindmap_decideRecord a new decision
mindmap_session_summaryPrevious session summaries

πŸ”¬ Advanced Analysis (7)

ToolWhat It Does
mindmap_query_graphCypher-like graph queries
mindmap_dead_codeDetect unused functions
mindmap_architectureFull architecture overview
mindmap_get_code_snippetRead source by symbol name
mindmap_search_codeGrep-like text search
mindmap_list_projectsList indexed projects
mindmap_healthSystem diagnostics

πŸ—οΈ Flow Analysis (4)

ToolWhat It Does
mindmap_trace_flowTrace behavioral flows through layers
mindmap_interaction_mapFull interaction map of the codebase
mindmap_classify_fileClassify a file's architectural layer
mindmap_layer_overviewLayer distribution overview

πŸ” Debug (3)

ToolWhat It Does
mindmap_debug_changesDetailed change analysis
mindmap_file_beforeFile content before changes
mindmap_file_historyFull file change history

🧬 Self-Evolving (3)

ToolWhat It Does
mindmap_teachAI teaches new patterns β€” persists per-project
mindmap_get_learnedView all rules the system has learned
mindmap_forgetRemove a learned rule

πŸ’» CLI Commands

All commands work with npx (no install) or after global install (npm install -g ai-mind-map):

# Setup & Diagnostics
npx ai-mind-map install              # Auto-configure all AI agents
npx ai-mind-map doctor               # Check everything is working
npx ai-mind-map install --uninstall  # Remove configs from all agents

# Index & Search
npx ai-mind-map index /path/to/project  # Index a codebase
npx ai-mind-map search "authenticate"   # Search the knowledge graph
npx ai-mind-map trace "processOrder"    # Trace call chains

# Memory
npx ai-mind-map recall "authentication"  # Recall past knowledge
npx ai-mind-map remember "We use JWT"    # Store a convention

# Status
npx ai-mind-map status               # Show index stats
npx ai-mind-map changes              # Show recent changes

βš™οΈ 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:

LanguageAST ParsingRegex FallbackExtracts
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                             β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚                         β”‚                               β”‚
β”‚                  41 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):

LayerWhatToken CostLifespan
Working MemoryCurrent task contextFull priceThis conversation
Episodic MemorySession summaries, recent decisionsOn-demand retrievalDays to weeks
Semantic MemoryCodebase graph, architecture, conventionsQueried, never dumpedPermanent (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.


Measuring context cost

Run npm run benchmark -- --rounds 5 --files 250 for a repeatable local comparison. The report records correct answers, UTF-8 bytes, estimated tokens, latency, and cold indexing cost. Native tools can win. Full-file-read illustrations are not evidence of savings against an agent that already searches narrowly.


🀝 Contributing

Contributions are welcome! Here's how:

  1. Fork the repo
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run the build: npm run build
  5. Commit: git commit -m "Add amazing feature"
  6. Push: git push origin feature/amazing-feature
  7. Open 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

↑↓ navigate openesc close