Skip to main content

MCP Server for orchestrating LLM interactions

Project description

🧠 Hive Mind MCP - LLM Orchestrator

Test Coverage Python Version License: Apache 2.0 Build Status

A powerful Model Context Protocol (MCP) server that enables advanced Multi-LLM collaboration workflows.

Transform simple chat interactions into sophisticated "Council of Experts" sessions. This orchestrator connects OpenAI, Anthropic, DeepSeek, Google Gemini, and Local models (Ollama) to debate, refine, and validate code and content autonomously.

✨ Key Features

  • 🏰 Round Table: Run a full Round Table — Independent generation from 3+ models, cross-critique, and final consensus synthesis.

  • 👥 Collaborative Refine: A "Drafter" model writes code, while a "Council" of critics (Claude + DeepSeek) reviews it iteratively.

  • ✈️ Auto-Pilot (Adaptive Selection): Intelligent analysis of request complexity to automatically route tasks.

    graph LR
        Req[User Request] --> Analyzer{Complexity Analyzer}
        Analyzer -->|High Complexity| SOTA["SOTA Tier (GPT-4o)"]
        Analyzer -->|Medium| ADV["Advanced Tier (GPT-4o-mini)"]
        Analyzer -->|Low| BASIC["Basic Tier (Llama 3)"]
        SOTA --> Result
        ADV --> Result
        BASIC --> Result
    
  • 🧠 Intelligence Tiers: Abstracted model selection using SOTA, ADVANCED, and BASIC tiers managed via config.yaml.

  • 🏗️ Workflow Pipelines: Define complex sequential tasks.

    graph TD
        Start((Start)) --> Input[/Input/]
        Input --> Step1[Process]
        Step1 --> Decision{Check Condition}
        Decision -->|True| Step2[Step A]
        Decision -->|False| Step3[Step B]
        Step2 --> Final((End))
        Step3 --> Final
    
  • 🛡️ Secure Sandbox: "Tool Agents" execute code in a controlled environment with strict validation using ToolAwareProvider.

    graph TD
        User[User Query] --> Moderator
        Moderator -->|Ask| A[Model A]
        Moderator -->|Ask| B[Model B]
        Moderator -->|Ask| C[Model C]
        A -->|Draft| XT[Cross-Critique]
        B -->|Draft| XT
        C -->|Draft| XT
        XT -->|Feedback| Moderator
        Moderator -->|Synthesize| Final[Consensus Answer]
    
  • 📊 Observability Dashboard: Real-time Streamlit dashboard to track costs, sessions, and artifacts.

  • 🌍 Global Configuration: Centralized config with easy overrides for models and API keys.

  • 🔌 Dynamic Plugins: Drop-in .py files to add new LLM providers instantly without restarting.


🛠️ Installation

Option A: The "Pro" Way (Recommended)

Use pipx to install Hive Mind globally in an isolated environment. This keeps your system clean and makes the command available everywhere.

# 1. Install
pipx install hive-mind-mcp

# 2. Auto-Configure your Environment
hive-mind install

The installer will detect your setup and help you configure:

  • Google Antigravity
  • Claude Desktop
  • VS Code

Option B: Standard Pip

pip install hive-mind-mcp

⚙️ Configuration

The hive-mind install command handles most configuration for you.

Global API Keys

The installer will prompt you to set up your API keys in a central location (~/.hive_mind/.env). This means you only need to configure them once, and they work for all your projects.

Manual Setup (Reference)

If you prefer manual configuration, the server details are:

  • Command: hive-mind (or path to your venv python)
  • Args: ['run']

🤖 Agentic IDE Integration

The Hive Mind MCP server is designed to be the "brain" behind your favorite editor. It is fully compatible with any environment that supports the Model Context Protocol (MCP) or can run terminal commands.

Supported Environments:

  • VS Code: Via standard MCP extensions (e.g., Cline, Roo Code).
  • Cursor: Use the "Composer" mode to run hive-mind commands directly.
  • Windsurf: Integrate via its "Cascade" flows.
  • Trae: Compatible with its "Builder" mode.
  • Claude Desktop: Native support for MCP servers.
  • Replit: Usable via the integrated shell.

How to Use

You can run these workflows directly inside your AI coding assistant without touching the terminal:

1. Slash Commands (if supported)

Simply type the command in the chat:

  • /round_table "Topic" - Runs a full consensus session.
  • /debate "Topic" - Runs a collaborative refinement.
  • /review "Content" - Checks code/text for safety and logic errors.
  • /analyze - Analyzes the project.

2. Natural Language

You can just ask your agent:

"Run a round table to decide the best database for this project."

User Request:

"Run the round table now on the review of the ARCHITECTURE.md document. Send them the source code for context with map-reduce"

Agent Execution:

hive-mind round_table "Review the attached ARCHITECTURE.md file. Does it accurately reflect the codebase structure in src/? Identify any missing features or inconsistencies." --context src/ ARCHITECTURE.md --map-reduce

🚀 CLI Usage Guide

The logic is built into the hive-mind command (formerly aliased as mcp).

⚡ Quick Guide: Which Command to Use?

Command Goal Best For Example
round_table Consensus Big decisions, architecture, ambiguity. "What DB should we use?"
debate Refinement Writing complex code, fixing tough bugs. "Write a thread-safe Queue"
review Verification Auditing code, security checks, sanity checks. "Check this file for bugs"
analyze Understanding Learning large codebases, finding patterns. "Explain how auth works"
models Discovery Listing/Searching available models. "List all GPT models"

1. Dashboard & Observability

Visualize your costs and session history in real-time.

Budget & Overview Analytics & Insights
Budget Analytics

New Features:

  • 🗓️ Date Filtering: Filter costs and analytics by custom date ranges.
  • 🏷️ Provider & Type Filters: Drill down into specific providers (OpenAI, Anthropic) or session types (Round Table, Debate).
  • 📉 Clean Visuals: Interactive charts with dual-axis cost tracking and responsive layouts.

Session Explorer (Audit Traces) Explorer > Deep dive into every decision made by the Council.

Model Catalog & Discovery Catalog > Dynamic discovery of every model available across all configured providers.

  • Unified List: See all models from OpenAI, Anthropic, DeepSeek, Google, etc. in one place.
  • Search & Filter: Quickly find specific models by name or provider.
  • Live Status: Confirms which providers are correctly configured and active.
# Launch the dashboard
hive-mind dashboard
  • 💰 Budget: Track daily spend limit vs actuals with granular provider filtering.
  • 📊 Analytics: See which models are winning debates and analyze session trends.
  • 🗂️ Explorer: Browse artifacts and metadata from previous Round Tables.

2. Round Table (hive-mind round_table)

Consensus Engine: Simulates a council of 3 diversity models (e.g., GPT-4, Claude, DeepSeek) debating a problem.

  • Best for: Architecture decisions, ambiguous questions, strategy.
  • Workflow: Independent Generation -> Cross-Critique -> Synthesis.
hive-mind round_table "What is the best architecture for this app?" --context README.md

3. Debate (hive-mind debate)

Refinement Engine: An iterative loop where a "Drafter" writes and "Reviewers" critique.

  • Best for: Writing complex code, refactoring, fixing bugs.
  • Workflow: Draft -> Critique -> Refine -> Critique -> Final.
hive-mind debate "Write a thread-safe Singleton" --max-turns 5

4. Review (hive-mind review)

Evaluation Engine: Submits existing content/code to the Council for a "Safety & Logic Check".

  • Best for: Security audits, code review, checking generated content.
  • Workflow: Reviewer 1 -> Pass/Fail + Reviewer 2 -> Pass/Fail -> Aggregated Report.
hive-mind review src/security.py --reviewers openai:gpt-4o anthropic:claude-3-opus

5. Analyze (hive-mind analyze)

Map-Reduce Engine: Summarizes large codebases file-by-file before answering.

  • Best for: "How does this project work?", "Find security flaws in src/".
  • Workflow: Chunk Files -> Summarize Each -> Aggregate -> Final Answer.
hive-mind analyze src "Explain the auth flow"

🔌 Plugins System

Expand the orchestrator with custom providers without modifying core code.

  1. Create a plugins/ directory in your current folder.
  2. Add a python file (e.g., plugins/my_custom_llm.py).
  3. Define a class inheriting from LLMProvider with PROVIDER_NAME.

The orchestrator will automatically discover and load it!


❓ Troubleshooting

Issue Cause Fix
NotFoundError (Anthropic) Model ID deprecated or invalid. Update ANTHROPIC_MODELS in .env with new IDs (e.g., claude-sonnet-4-5...).
SettingsError / JSON Env var has spaces or bad format. Ensure lists in .env are comma-separated without brackets: MODEL_A,MODEL_B.
401 Unauthorized Invalid API Key. check hive-mind config and verify keys.
Dashboard Empty No artifacts found. Run a round_table command first to generate data.

🤝 Contributing

Contributions are welcome! Please see ARCHITECTURE.md for system design details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hive_mind_mcp-1.0.14.tar.gz (85.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hive_mind_mcp-1.0.14-py3-none-any.whl (73.3 kB view details)

Uploaded Python 3

File details

Details for the file hive_mind_mcp-1.0.14.tar.gz.

File metadata

  • Download URL: hive_mind_mcp-1.0.14.tar.gz
  • Upload date:
  • Size: 85.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hive_mind_mcp-1.0.14.tar.gz
Algorithm Hash digest
SHA256 ab0a32dacafc8d0ec876fb56c89f9e327862f785ee9770d022bd8672261dc9bb
MD5 37dd1d6f6f401e23932bdb9e457a55b7
BLAKE2b-256 8d293fde07131320fd55465fd6accf11ecb9bc6f544401f38575615a8f2c086f

See more details on using hashes here.

File details

Details for the file hive_mind_mcp-1.0.14-py3-none-any.whl.

File metadata

  • Download URL: hive_mind_mcp-1.0.14-py3-none-any.whl
  • Upload date:
  • Size: 73.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for hive_mind_mcp-1.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 ee69355b41db52f341c7ff0a919e0f4f21d912ca05a0be31f4028935db3dbe08
MD5 1cfa53ff607434a99ac33ad0230ae4ee
BLAKE2b-256 522c448a6cbb0176c3bb329544e97c8552ed9896a68e803a5eeba5e4062b1b1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page