How hive-agi/hive-mcp works
hive-mcp is an MCP backend for AI coding agents, centered on persistent, project-scoped memory and session continuity. The documented user workflow is to catch up on project context, work with memory, knowledge-graph and Kanban tools, then wrap up by crystallizing learnings; multi can batch wrap-up actions. The architecture also includes agent execution, workflow automation, multi-agent coordination, extensions and optional integrations. Several relationships below are documented in the README; where sampled source did not establish wiring, edges are marked dashed with no evidence path.
Main entry points: routes.clj Tool routes · query.clj Memory tools · budget_router.clj Agent execution · handlers.clj Event handlers
Components 21
MCP entry
- Tool routes
src/hive_mcp/server/routes.clj - Async tasks
src/hive_mcp/server/routes/async_tasks.clj - Batch tools
src/hive_mcp/batch.clj
Session continuity
- Memory tools
src/hive_mcp/tools/memory/crud/query.clj - Embedding service
src/hive_mcp/embeddings/service.clj - Session wrap
src/hive_mcp/crystal/pipeline.clj - Catch-up workflow
src/hive_mcp/workflows/catchup_session.clj - Knowledge graph
src/hive_mcp/knowledge_graph/connection.clj - Kanban tools
src/hive_mcp/tools/memory_kanban/query.clj
Agent runtime
- Agent execution
src/hive_mcp/agent/budget_router.clj - Model providers
src/hive_mcp/agent/openrouter.clj - SAA orchestration
src/hive_mcp/agent/saa/orchestrator.clj - Workflow engine
src/hive_mcp/workflows/fsm_engine.clj - SAA handlers
src/hive_mcp/workflows/saa/handlers.clj
Coordination
- Ling coordination
src/hive_mcp/swarm/coordinator.clj - Hivemind messaging
src/hive_mcp/hivemind/messaging.clj
Platform services
- Event handlers
src/hive_mcp/events/handlers.clj - NATS messaging
src/hive_mcp/nats/client.clj - Emacs bridge
src/hive_mcp/emacs/client.clj - Addon extensions
src/hive_mcp/extensions/loader.clj
Other components
- AI client
Connections 20
- AI client → Tool routes: calls tools
README.md - Tool routes → Memory tools: dispatches
- Tool routes → Kanban tools: dispatches
- Tool routes → Async tasks: queues calls
src/hive_mcp/server/routes.clj - AI client → Catch-up workflow: requests catch-up
README.md - Catch-up workflow → Memory tools: reconstructs context
README.md - AI client → Session wrap: requests wrap-up
README.md - Session wrap → Memory tools: crystallizes learnings
README.md - AI client → Knowledge graph: connects knowledge
README.md - AI client → Kanban tools: syncs tasks
README.md - AI client → Batch tools: batches actions
README.md - Memory tools → Embedding service: embeds and searches
- Agent execution → Model providers: routes requests
- SAA orchestration → Workflow engine: runs workflows
- SAA handlers → SAA orchestration: handles workflow actions
- Ling coordination → Hivemind messaging: coordinates agents
- Event handlers → Ling coordination: dispatches lifecycle
- Event handlers → NATS messaging: notifies agents
- Agent execution → Emacs bridge: uses editor
- Tool routes → Addon extensions: advertises tools