Hive Mind MCP Server
Intelligent documentation system for codebases that creates living documentation as you build.
Hive Mind is an MCP (Model Context Protocol) server that automatically generates hivemind.md and flowchart.mmd at every directory level, creating a navigable spider-web of documentation that:
Works in real-time as code is built
Can retroactively document existing codebases
Preserves user requirements and architectural decisions
Enables AI navigation via anchor points
Works with any context window size (8k to 200k tokens)
Installation
Quick Start (Recommended)
You can run the server directly using uvx (no installation required):
Install via pip
Install from Source (Development)
Requirements
Python 3.11 or higher
Dependencies:
mcp,tree-sitter,tree-sitter-languages,aiofiles,pyyaml
Configuration
For Antigravity / Claude Desktop
Edit your MCP configuration file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
Option 1: Using
Option 2: Using pip installation
Option 3: Using Source Code
For Cursor
Open Cursor Settings
Navigate to Features → MCP Servers
Add new server:
Name:
hive-mindType:
stdioCommand:
uvxArgs:
mcp-hivemind-server
Usage
Real-time Documentation
While coding, ask your AI assistant:
"Document this code as we build it"
The AI will call document_current_work to capture:
Code structure (functions, imports, exports)
User requirements and constraints
Warnings and gotchas
Next steps and TODOs
How the code works
Retroactive Documentation
For existing codebases, ask:
"Document my entire codebase with hive-mind"
The AI will call build_hive to:
Walk the entire directory tree
Parse all code files
Generate documentation at each level
Create connection graphs
Guided Hive Build (Recommended)
For AI-enriched documentation where YOU provide the context:
"Start a guided hive build on my codebase"
How it works:
MCP discovers all directories
For each directory, MCP shows you the structure (files, functions)
YOU read the actual code and understand what it does
YOU call
continue_hive_buildwith your explanationMCP writes
hivemind.mdwith both structure AND your contextRepeat until all directories are documented
This creates documentation with intelligent context from the AI (you!), not just dry parsing.
Navigation
Ask AI to navigate your codebase:
"Show me the auth system context"
"Find the validateSession function"
"Trace what uses the database module"
Tools
Core Tools
Tool | Description |
| Real-time documentation while building code |
| Auto-document entire codebase (structure only) |
| Load context from anchor point |
| Search for function across codebase |
| Find dependencies and dependents |
| Update docs when code changes |
Guided Build Tools
Tool | Description |
| Start guided build, returns first directory for YOU to document |
| Submit YOUR context, get next directory |
| Check progress of guided build |
Generated Files
hivemind.md
Each directory gets a hivemind.md file containing:
AI Context Sections (above the line):
What This Does - Purpose and role
User Requirements - Constraints and preferences
Important Notes - Warnings and gotchas
Next Steps - TODOs and planned work
How It Works - Key patterns and logic
Dry Logic Sections (below the line):
Files at This Level
Functions Defined
Dependencies
Exports
Connections
Navigation
Metrics
flowchart.mmd
Mermaid diagram showing:
Current directory (purple center node)
Parent directory (gray)
Child directories (green)
Upstream dependencies (orange)
Downstream dependents (cyan)
Anchor Points
Navigate using anchor points in format: anchor://path/to/directory
Example:
Testing
Project Structure
Supported Languages
TypeScript (
.ts,.tsx)JavaScript (
.js,.jsx,.mjs,.cjs)Python (
.py)
Optional AI Enrichment
Set ANTHROPIC_API_KEY environment variable to enable automatic AI-generated context:
Then use build_hive with enrich_with_ai: true.
License
MIT