Skip to main content

MCP server for OpenClaw Consensus — 9-LLM consensus to fight hallucinations. Built by yanmiayn, 16yo Korean solo dev.

Project description

OpenClaw Consensus MCP

9-LLM consensus inside Claude — a hallucination guardrail you can call as a tool.

Built by yanmiayn — 16yo solo dev from Korea, building 9-LLM consensus to fight hallucinations.

What it does

OpenClaw runs the same prompt across 9 frontier LLMs (Claude, GPT, Gemini, Llama, Mistral, etc.), then returns:

  • a consensus answer (with confidence + which models contributed),
  • a disagreement score (high = your single LLM is probably about to hallucinate), and
  • a cheapest route (pick the smallest model combo that still hits your quality bar).

This MCP server exposes those three capabilities as tools so Claude Desktop / Claude Code can call them mid-conversation.

Why consensus?

A single LLM can confidently make things up. Nine models rarely make up the same thing. When 9 models agree, you can trust the answer; when they fan out, you have a cheap, calibrated hallucination signal — before the user sees the wrong answer.

Install

pip install openclaw-consensus-mcp
# or
uv pip install openclaw-consensus-mcp

You also need a RapidAPI key for the OpenClaw Consensus API: https://rapidapi.com/yanmiayn/api/openclaw-consensus

Set it in your environment:

export RAPIDAPI_KEY="your-rapidapi-key"

Claude Desktop config

Add to ~/.claude/claude_desktop_config.json (macOS/Linux) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "openclaw-consensus": {
      "command": "openclaw-consensus",
      "env": {
        "RAPIDAPI_KEY": "your-rapidapi-key"
      }
    }
  }
}

For Claude Code:

claude mcp add openclaw-consensus -- openclaw-consensus

Tools

consensus(prompt, mode="balanced")

Get a 9-LLM consensus answer.

  • prompt (string) — the question.
  • mode (string, default balanced)deep (9 models), balanced (5), or fast (3).

Returns

{
  "answer": "string",
  "confidence": 0.0,
  "models_used": ["claude-opus-4.7", "gpt-5.1", "..."],
  "disagreement": 0.0
}

disagreement_score(prompt)

How much the 9 models disagree on a prompt — a hallucination warning signal.

Returns

{
  "score": 0.0,
  "per_model": { "model-id": "answer summary" }
}

cheapest_route(prompt, target_quality=0.85)

Cheapest model combo that meets a quality threshold (0..1).

Returns

{
  "models": ["..."],
  "estimated_cost_usd": 0.0,
  "estimated_quality": 0.0
}

Local development

git clone https://github.com/yanmiayn/openclaw-consensus-mcp
cd openclaw-consensus-mcp
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]"
pytest

Smoke-test the server with the official MCP Inspector:

npx @modelcontextprotocol/inspector openclaw-consensus

Publish

uv build
uv publish      # to PyPI
mcp-publisher publish   # to the official MCP Registry

License

MIT — see LICENSE.

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

openclaw_consensus_mcp-0.1.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

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

openclaw_consensus_mcp-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file openclaw_consensus_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: openclaw_consensus_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for openclaw_consensus_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2f5f4b1961db2005432f22096e5ef7d6d45508577db392bc601f8cc868d5c5c8
MD5 de63344a1698656b65afd3472c7b7532
BLAKE2b-256 1b6bc8264c26ba085aa0e074a7e6a3ff0f2f56b82ed960bb99b2357c8987a029

See more details on using hashes here.

File details

Details for the file openclaw_consensus_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: openclaw_consensus_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for openclaw_consensus_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31a1cc43170de02a40c43f60fbf40defc856acd06d01c1bf9f7bf8f1139a1f82
MD5 c14aa6f6bfc4293426d65ba519f56fce
BLAKE2b-256 2dba2f6d1a35c25e971f718c2e13f01392378bc2cde01d28b46b5411d83fd674

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