HIVE-MIND MCP server
Commit Nov 12, 2026An autonomous agent framework that provides a multi-layered harness for deploying LLMs across WhatsApp, Telegram, and Discord with hierarchical memory.
Also known as leandre755/HIVE-MIND
- Stars
- 7
- Tools
- —
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Nov 12, 2026
- License
- Apache-2.0
What is HIVE-MIND MCP?
HIVE-MIND is an autonomous agent framework that provides a multi-layered harness for deploying LLMs across WhatsApp, Telegram, and Discord with hierarchical memory.
Summary generated from the project's README
About HIVE-MIND MCP server
Deploying autonomous agents across messaging platforms like WhatsApp, Telegram, and Discord is what HIVE-MIND enables through a structured five-layer harness. This framework is designed for developers who need more than a simple prompt loop, providing a research-oriented testbed that manages memory, costs, and tool execution. It uses a Smart Router to rotate quotas across eight provider adapters, helping to avoid rate limits during model execution.
The system operates using a hierarchical memory structure, utilizing Redis for fast L1 access and Supabase pgvector for L2 semantic storage. It includes specialized subsystems like a sandboxed PTC VM for tool execution and a VIGIL and Ralph safety layer for pre-action and post-audit governance. By implementing selective wiring instead of context stuffing, the harness manages token usage and context windows through an AST skeleton and a tiered context loader.
What you can do with it
- 1Managing long-term agent memoryProvide an AI with hierarchical memory that uses Ebbinghaus forgetting to manage information over time.
- 2Preventing API rate limitsUse a smart router to rotate through different model providers to ensure zero 429 errors.
- 3Executing code safelyRun agent-generated tools within a sandboxed environment to maintain runtime safety.
Written from the project's README. Every use case is checked against a quote from it.
Automated checks
Ran Nov 15, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachableleandre755/hive-mind is public and reachablegithub.com/leandre755/hive-mind ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-12github.com/leandre755/hive-mind ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubThe Philosophy: Why HIVE-MIND?
Modern LLM deployments look strong in demos yet fail in the wild — not because models lack capability, but because the harness around them is thin. A stateless prompt loop cannot remember, cannot budget, cannot coordinate, and cannot recover from a tool error without human help. The model is naked without the harness; a harness without a model is dead.
HIVE-MIND was engineered to invert that hierarchy. It treats the harness itself as the primary artifact — a research testbed where every seam is measurable. Five strict layers, twenty-six extractable subsystems, eight provider families and five channels are not features but instruments for asking: what scaffolding actually makes a model better at tasks it was never trained to do?
The mechanism is selective wiring, not context stuffing. A sandboxed PTC VM that saves 80–95% of tokens, a hash-anchored Myers reconciler that eliminates drift, an AST skeleton that cuts 90% of code context, a two-tier memory with Ebbinghaus forgetting, and a Smart Router that rotates quotas with zero 429s. HIVE-MIND exists to prove, instrument and iterate on that hypothesis in public, as an experimental harness.
Architecture
HIVE-MIND is a strict five-layer harness with one-way dependency: each layer talks only to its immediate neighbours, no skips. The decomposition into 26 subsystems is formally audited in ARCHITECTURE.md with Martin instability metrics.
| Layer | Role | Core Components |
|---|---|---|
| Transport | Unified ingress / egress | WhatsApp (Baileys), Discord, Telegram, CLI, TUI WebSocket :5001 |
| Orchestration | ReAct loop, IoC, scheduling | BotCore, ServiceContainer, FairnessQueue, BlueprintManager, Planner, PTC VM |
| Runtime | Safety & cost governance | VIGIL, Ralph, ConstraintManifold, ContextWindowService |
| Cognitive | Hierarchical memory | Redis L1 <50ms, Supabase pgvector L2, MAPLE, HNSW |
| Smart Router | Model routing | Layer 1 SmartLayer (quota rotation, circuit breakers), Layer 0 ExecutionLayer (8 adapters) |
Live Demonstration
Soon.
Capabilities
Twenty-six subsystems, each extractable, independently testable and documented with its own Diátaxis page in documentation/.
| Domain | Subsystems | Responsibility |
|---|---|---|
| 01 Core & Concurrency | SS-01 → SS-09 | ServiceContainer (I=0.00), FairnessQueue DRR, SwarmDispatcher, BlueprintManager, EventBus, Planner DAG, SubAgentEngine, PTC VM, PermissionManager |
| 02 Model Intelligence | SS-10 → SS-14 | ExecutionLayer, ParamConverter pivot↔wire, SmartLayer, OAuth PKCE, Voice (Live/STT/TTS) |
| 03 Gateways & IPC | SS-15 → SS-17 | Universal TransportInterface, TuiServer WS IPC, CLI Auth Wizard |
| 04 Memory & Cognition | SS-18 → SS-20 | Multi-Tier Memory L1/L2, MAPLE Ebbinghaus, Local HNSW Media DB |
| 05 Runtime Safety | SS-21 → SS-26 | VIGIL + Ralph, Tiered Context, Hash-Anchored Edit (FNV-1a Myers), AST Tree-Sitter, Plugin Pipeline, SafeFs |
How It Works
From a normalized NormalizedMessage to a delivered answer, the harness executes a closed loop: queue fairly, hydrate selectively, route intelligently, think with tools, validate both pre- and post-action, then persist only what matters.
| Step | Harness Action | Key Code |
|---|---|---|
| 1 | Normalize ingress | TransportInterface → NormalizedMessage (src/core/transport/) |
| 2 | Schedule fairly | FairnessQueue.ts DRR + VIP sub-queues |
| 3 | Hydrate context | tieredContextLoader.ts + ContextWindowService.ts with Ebbinghaus 0.4·e^{-t/τ} |
| 4 | Route model | SmartLayer.ts → ExecutionLayer.ts (8 adapters, zero-429) |
| 5 | ReAct loop ×10 | BotCore.ts + SubAgentEngine.ts (fork/fresh) |
| 6 | Execute tools | PTC ProgrammaticExecutor.ts in vm + Acorn validation |
| 7 | Guard | VIGIL pre-action + Ralph post-audit + λ=(cost/budget)^4 |
| 8 | Persist | workingMemory.ts (Redis) + SemanticMemory.ts (pgvector HNSW) |
| 9 | Deliver | Transport.sendUniversalResponse() to source channel |
Providers
The two-layer Smart Router coordinates 8 native adapter families and 22+ dynamic endpoints via a decoupled pivot. Layer 1 executes resilient stateful dispatch (6-window circuit breakers, P50 latency scoring, zero-429 rotation, SSE stream lock); Layer 0 manages stateless wire transformation (ProtocolFamily $\times$ HeaderFamily, reasoning budgets, typed errors).
| Provider / Family | Implementation | Wire Protocol | Key Capabilities | Technical Features |
|---|---|---|---|---|
| OpenAI | Native (openai.ts) |
openai-compatible (/v1/chat/completions) |
Chat, Tool Calling, Vision, Reasoning Effort | Native max_completion_tokens and reasoning_effort handling, embeddings |
| Google Gemini | Native (gemini.ts) |
gemini-native (generateContent) |
Multimodal (Text, Image, Audio), Thinking Budget | Multipart structure, thought_signature preservation, systemInstruction |
| Anthropic Claude | Native (anthropic.ts) |
anthropic-compatible (/v1/messages) |
Extended Thinking, Tool Calling, Prompt Caching | Root system extraction, input_schema map, thinking budget bounds check |
| Groq Cloud | Native (groq.ts) |
openai-compatible (/openai/v1) |
Ultra-fast LPU, Tool Calling, Server Tools | Groq Compound executed_tools, usage_breakdown, header versioning |
| Cohere | Native (cohere.ts) |
cohere-v2 (/v2/chat) |
Structured Content, Tool Calling | Top-level system separation, typed content chunks, usage normalization |
| Cloudflare AI | Native (cloudflare.ts) |
cloudflare-v1 (/ai/v1/chat/completions) |
Serverless Inference & Tool Calling | Composite key account_id:api_token, { result } unwrapping, array errors |
| Hugging Face | Native (huggingface.ts) |
openai-compatible (router.huggingface.co) |
Open-Source Hub Models | Official SDK routing wrapper, autonomous credentials init, 429 handler |
| Modal | Native (modal.ts) |
openai-compatible ({appUrl}/v1) |
Custom GPU Serverless Containers | Dynamic base URL from model ID, 120s extended timeout for cold starts |
| OAuth Specializations | Headless (codex.ts, antigravity.ts) |
Direct SSE / Cloud Code REST API | OAuth2 PKCE / Local OAuth Session | Token refresh (<300s), Clearcut telemetry simulation, TLS impersonation |
| Dynamic Providers | Generic (GenericProviderAdapter.ts) |
openai-compatible / standard-token |
22+ Ecosystem Providers (Mistral, NIM, etc.) | Tool ID 9-char sanitization, reasoning_content relay, passthrough options |
Channels & Transports
| Channel | Status | Transport File | Notes |
|---|---|---|---|
baileys.ts |
Multi-device, media, stickers, voice | ||
| Discord | discord.ts |
Guilds, DMs | |
| Telegram | telegram.ts |
Groups, inline bots | |
| CLI | cli.ts |
Full interactive UX | |
| TUI Server | TuiServerTransport.ts |
Loopback WS :5001 (default, auto-increments if busy; see tui-connection.json) |
Quick Start
Note — HIVE-MIND is an experimental research harness, not a product. Interfaces are unstable and may change without notice.
# Clone the harness
git clone https://github.com/leandre755/HIVE-MIND.git
cd HIVE-MIND
# Install dependencies
npm install
# Copy the template and fill at least one LLM key + Supabase + Redis
cp .env.example .env
nano .env
# Interactive startup menu — channel auth + provider selection
npm start
# Watch mode — auto-restart on source change
npm run dev
# 77 suites — 834 unit tests
npm run test:unit
# Fast local verification gate (build + fast lint + unit tests)
npm run build && npm run lint:fast && npm run test:unit
# Full local verification gate (build + lints + all tests + audit)
npm run build && npm run lint:fast && npm run lint:arch && npm run test:unit && npm run test:integration && npm audit
Project Structure
Validation
| Command | Purpose | Gate |
|---|---|---|
npm run build |
TypeScript 7.0.2 tsc --noEmit |
0 errors on 334 files |
npm run lint:fast |
Oxlint, 96 rules, 4 threads | 0 warnings |
npm run lint:arch |
dependency-cruiser boundaries | 0 violations |
npm run test:unit |
Jest, 77 suites | 834 / 834 passing |
npm run test:integration |
5 suites | 34 / 34 passing |
npm audit |
Known CVE vulnerability audit | 0 vulnerabilities |
Security
See SECURITY.md.
HIVE-MIND MCP questions
What communication channels does HIVE-MIND support?
The framework supports WhatsApp (via Baileys), Discord, Telegram, CLI, and TUI WebSocket.