Sandbox
@antonbabenko/deliberation

MCP server for multi-model review and consensus

Deliberation connects your agent to GPT, Gemini, Grok, and OpenRouter models through MCP so it can ask for second opinions, plan reviews, code reviews, and security checks. It also includes a consensus loop where multiple models debate a task and an arbiter revises the answer until the panel agrees or the round limit is reached.

145 stars9 forksJavaScriptUpdated 12d ago
Who it's for

Builders who use Claude Code, Codex, Cursor, or other MCP hosts and want outside model opinions before they commit to a change.

What it delivers

You can get independent model reviews and a converged final answer without wiring each provider by hand.

What it does

One-shot second opinions

Commands like `ask-gpt`, `ask-gemini`, `ask-grok`, and `ask-all` dispatch one or more models and return a synthesized answer.

Consensus loop

The `consensus` flow runs repeated review rounds until the models converge, with an arbiter deciding how to handle objections.

Provider routing

It detects which providers are configured, supports OpenRouter model lists, and routes requests to the available set.

Host-specific plugin files

It ships native artifacts for Claude Code, Cursor, Codex CLI, Kiro, and OpenCode so the same workflow works across hosts.

Session and debug tools

It can save run history, annotate sessions, and record latency, token, and vote data in an optional debug log.

Setup and doctor commands

It includes setup, help, uninstall, and health-check commands for installing providers and checking configuration.

How to get it

  1. 11. Add the marketplace - antonbabenko/agent-plugins
    /plugin marketplace add antonbabenko/agent-plugins
  2. 22. Install the plugin
    /plugin install deliberation@antonbabenko
  3. 33. Run setup
    /deliberation:setup
  4. 4Run
    /plugin marketplace update antonbabenko  # pull the new version from the marketplace
    /reload-plugins                          # reconnect the MCP servers (or just restart Claude Code)
  5. 5The repo ships a Dockerfile for running the standalone server in a container. It wraps…
    docker build -t deliberation-mcp .
    docker run -i --rm \
      -e XAI_API_KEY -e OPENROUTER_API_KEY \
      -v ~/.config/deliberation:/home/node/.config/deliberation:ro \
      deliberation-mcp
  6. 6Describe your task. Claude detects when an expert helps and delegates automatically
    You: "Is this authentication flow secure?"
    Claude: routes to the Security Analyst, then synthesizes the findings.

README

Deliberation

Get a second opinion in Claude Code from GPT, Gemini, and Grok - plus 400+ more models through OpenRouter, including Qwen, Kimi, and DeepSeek. Seven domain experts (Architect, Code Reviewer, Security Analyst, and four more) review your plans, find bugs, and debate edge cases until they agree.

Four chairs at the table: Claude, GPT, Gemini, Grok - one verdict you can ship
Recent blog post: Meet Deliberation: 400+ models is easy, knowing which ones earn a place is hard.

📸 See a full /consensus run: round 1 disagreement to round 5 convergence

Round 1: reviewers disagree

... a few moments later ...

A Few Moments Later

Round 5: convergence reached

📸 See /ask-all stage a 2-round architect debate: three models, three verdicts, then each critiques the others - disagreement matrix included

/ask-all: three architects walk into a repo, two ship bugs walk out

When three models argue, the real bug reveals itself. Round 1 = independent top findings. Round 2 = each model dunks on the others' picks. The disagreement matrix shows where they diverge; the conclusion shows what to actually fix first.

What is Deliberation?

Claude can ask GPT, Gemini, Grok, or any OpenAI-compatible model (via OpenRouter) for help through MCP. The plugin handles the wiring for each provider so you just write the prompt. Each expert has a distinct specialty and can advise or implement.

You can use any subset of the providers. The plugin detects which are configured and routes accordingly. OpenRouter is advisory-only and config-driven: models are declared in ~/.config/deliberation/config.json (Windows: %APPDATA%\deliberation\config.json; override with DELIBERATION_CONFIG) and hot-reload without restarting Claude Code.

What you getWhy it matters
7 domain expertsThe right specialist for each problem type
GPT, Gemini, Grok, or OpenRouter modelsUse your preferred provider(s)
Dual modeExperts analyze (read-only) or implement (write)
Auto-routingClaude detects when to delegate from your request
Synthesized responsesClaude interprets expert output, never raw passthrough

Install

Claude Code plugin (recommended):

1. Add the marketplace - antonbabenko/agent-plugins

/plugin marketplace add antonbabenko/agent-plugins

2. Install the plugin

/plugin install deliberation@antonbabenko

3. Run setup

/deliberation:setup

Claude now routes complex tasks to your GPT, Gemini, Grok, and OpenRouter experts (Grok and OpenRouter advise; GPT and Gemini can also implement).

Setup is a one-time step. The MCP servers are registered by the plugin manifest, so they load automatically and stay current across updates.

Updating (Claude Code)

/plugin marketplace update antonbabenko  # pull the new version from the marketplace
/reload-plugins                          # reconnect the MCP servers (or just restart Claude Code)

Updating on non-Claude hosts: hosts that run the standalone server via npx -y @antonbabenko/deliberation-mcp get the latest published version on each fresh resolve. npx caches resolved packages, so if a host serves an old build, clear the npx cache (rm -rf ~/.npm/_npx) or pin/refresh the version.

Alternative: Use deliberation MCP server (standalone, works with any agents)

The orchestration server is also published on its own - npm @antonbabenko/deliberation-mcp, Official MCP Registry name io.github.antonbabenko/deliberation.

One-click install:

Install in Cursor Install in VS Code Install in Kiro

Manual config for any MCP clients

Add this to your host's MCP config (most hosts use the mcpServers key):

{
  "mcpServers": {
    "deliberation": {
      "command": "npx",
      "args": ["-y", "@antonbabenko/deliberation-mcp"],
      "env": {
        "XAI_API_KEY": "xai-...",
        "OPENROUTER_API_KEY": "sk-or-v1-..."
      }
    }
  }
}

The env block is how you set provider keys outside Claude Code. GPT and Gemini do not read keys here - they use the codex and agy CLIs (logged in separately), so drop those lines if you only use GPT/Gemini. XAI_API_KEY enables Grok; OPENROUTER_API_KEY enables OpenRouter (which also needs models declared in ~/.config/deliberation/config.json - the canonical XDG path, Windows %APPDATA%\deliberation\config.json - or point elsewhere with DELIBERATION_CONFIG). The one-click buttons above cannot carry secrets - add the env block by hand after installing.

Per-host config location and the key it expects:

HostConfigKey
Claude Codeclaude mcp add deliberation -- npx -y @antonbabenko/deliberation-mcp (or project .mcp.json)mcpServers
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json (macOS), %APPDATA%\Claude\claude_desktop_config.json (Windows)mcpServers
Cursor~/.cursor/mcp.json (global) or .cursor/mcp.json (project)mcpServers
VS Code.vscode/mcp.json - note: each entry needs "type": "stdio"servers
Codex CLI~/.codex/config.toml - TOML, e.g. [mcp_servers.deliberation]mcp_servers
Gemini CLI~/.gemini/settings.jsonmcpServers
Windsurf~/.codeium/windsurf/mcp_config.jsonmcpServers
Zedsettings.jsoncontext_servers
Clinethe extension's MCP settings (Cline panel -> MCP Servers)mcpServers

Provider prerequisites are the same as the plugin (see Requirements): the Codex CLI for GPT, agy for Gemini, XAI_API_KEY for Grok, and OPENROUTER_API_KEY plus ~/.config/deliberation/config.json for OpenRouter (Windows: %APPDATA%\deliberation\config.json; override the config path with DELIBERATION_CONFIG).

Tools exposed: ask-all, consensus (the full convergence loop in one call, or a single synthesis pass with synthesizeAlways:true), consensus-step (drive the loop yourself, one action per call), ask-gpt / ask-gemini / ask-grok / ask-openrouter, panel + ask-one (discover the active provider set, then call providers individually - issue them in parallel for visible per-provider progress), analyze (read-only run analytics over the debug log + sessions: per-model latency / tokens + verdict agreement, with advisory tuning suggestions; configuredOnly and since keep the report to models you still run and a period you choose), the seven experts (architect, plan-reviewer, scope-analyst, code-reviewer, security-analyst, researcher, debugger), and the session tools (session-get / session-revisit / session-annotate). Every result carries ms + the effective reasoningEffort (HTTP providers add token usage). An optional debug log ("debug": { "enabled": true }) records latency / tokens / votes - never prompts or responses. These are server-side, so they work on every MCP host, not just Claude Code (see AGENTS.md).

The package also ships a deliberation-setup bin. Run it once with npx -y --package @antonbabenko/deliberation-mcp deliberation-setup to write a starter ~/.config/deliberation/config.json (it never overwrites an existing one). The plain npx -y @antonbabenko/deliberation-mcp form runs the default bin (the server), which is what your MCP host launches. For host rule wiring, see AGENTS.md and the per-host snippets in examples/.

Run in Docker

The repo ships a Dockerfile for running the standalone server in a container. It wraps the stdio server in mcp-proxy, the same shape MCP hosting providers expect:

docker build -t deliberation-mcp .
docker run -i --rm \
  -e XAI_API_KEY -e OPENROUTER_API_KEY \
  -v ~/.config/deliberation:/home/node/.config/deliberation:ro \
  deliberation-mcp

Grok and OpenRouter work from the keys alone. GPT and Gemini do not - they shell out to the codex and agy CLIs, which are not in the image, so those two providers report not-found / missing-cli inside the container.

Native plugins per host (Cursor / Codex / Kiro / OpenCode)

Beyond the raw MCP config above, deliberation ships native plugin artifacts for four hosts so the experience matches the Claude Code plugin (persona-bearing experts + when-to-delegate guidance, not just bare tools). All of these are generated from the canonical sources by node scripts/sync-hosts.js and committed, so they never drift (a CI drift test enforces it). Each host scans the repo for its own files:

HostNative artifacts (in this repo)Install
Cursor.cursor/rules/deliberation.mdcUse the one-click MCP button above, then copy the .mdc into your project's .cursor/rules/.
Codex CLIplugins/deliberation/ (.codex-plugin/plugin.json + .mcp.json + skills/) and a repo-scoped .agents/plugins/marketplace.jsoncodex plugin marketplace add antonbabenko/deliberation, then install deliberation from /plugins.
KiroPOWER.md + mcp.json + steering/ (a "Kiro Power")In Kiro, "Add power from GitHub" -> this repo URL. Submit to the registry at kiro.dev/powers/submit.
OpenCode.opencode/commands/*.md + .opencode/agents/*.mdAdd the MCP server to opencode.json (mcp key, type: "local", command: ["npx","-y","@antonbabenko/deliberation-mcp"]), then copy .opencode/commands/ and .opencode/agents/ into your project.

Provider credentials work the same as the standalone server (GPT via the Codex CLI, Gemini via agy, XAI_API_KEY for Grok, OPENROUTER_API_KEY for OpenRouter) - set only the providers you use. The MCP server already injects each expert persona server-side, so these native files add the host's command/steering surface, not duplicated logic.

Full per-host install guides: docs/hosts/ - Cursor, Codex CLI, Kiro, OpenCode.

Requirements

You need at least one provider:

  • Codex CLI (GPT): npm install -g @openai/codex, then codex login.
  • Antigravity CLI: Getting Started with Antigravity CLI and Migrating from Gemini CLI, then run agy and login.
  • Grok (xAI): no CLI to install; the bridge ships with the plugin (needs Node 18+). Set XAI_API_KEY (get a key at https://console.x.ai).
  • OpenRouter: no CLI; the bridge ships with the plugin (needs Node 18+). Set OPENROUTER_API_KEY (get a key at https://openrouter.ai/keys), then declare models in ~/.config/deliberation/config.json (Windows: %APPDATA%\deliberation\config.json; override with DELIBERATION_CONFIG). Works with any OpenAI-compatible endpoint (Ollama, vLLM, LM Studio, HuggingFace Inference) - auth is skipped automatically when the key env var is empty.

Windows note (CLI providers). npm install -g on Windows installs a codex.cmd shim, not an executable, and Node cannot launch a .cmd directly - so GPT calls used to fail with nothing but a spawn error. deliberation now resolves the CLI itself (PATHEXT, falling back to the package's own entry point) and keeps it out of a shell. If resolution ever misses on your machine, point CODEX_BIN (GPT) or AGY_BIN (Gemini) at the real executable. Grok and OpenRouter are unaffected - they are HTTP bridges and spawn nothing.

Commands

Bundled with the plugin (available once installed):

CommandPurpose
/deliberation:setupConfigure Codex/Gemini/Grok/OpenRouter MCP servers + orchestration rules
/deliberation:helpHow to use deliberation on your host, with paste-ready example prompts
/deliberation:doctorHealth check (config, provider CLIs, sessions/debug, path drift) with fixes; read-only
/deliberation:consensus🔥🔥🔥 Arbiter-mediated GPT + Gemini + Grok + Claude convergence loop
/deliberation:ask-all🔥 GPT + Gemini + Grok (+ configured OpenRouter models) in parallel, synthesized
/deliberation:ask-gptOne-shot GPT (Codex) second opinion
/deliberation:ask-geminiOne-shot Gemini second opinion
/deliberation:ask-grokOne-shot Grok (xAI) second opinion (advisory-only)
/deliberation:ask-openrouterOne-shot OpenRouter model second opinion (advisory-only)
/deliberation:analyzeAnalyze recent runs (latency, tokens, verdict agreement) and suggest model/reasoning/fanout tuning (advisory)
/deliberation:uninstallRemove MCP config, rules, and aliases
/deliberation:grok-filesList, prune, or gc Grok-uploaded files (storage + local cache cleanup)

/setup can also install short aliases (/ask-gpt, /ask-gemini, /ask-grok, /ask-openrouter, /ask-all, /consensus) into ~/.claude/commands/. This is opt-in. Existing same-named commands are kept by default; setup asks before overwriting any of them. /deliberation:uninstall removes an alias only if it is byte-identical to the bundled copy.

analyze is deliberately excluded: /analyze is a common name and a bare copy collides with any other plugin that ships one. Use /deliberation:analyze, which is always available. If an earlier setup installed ~/.claude/commands/analyze.md, setup now points out the path so you can delete it. /deliberation:uninstall also lists analyze, but its byte-identical guard only matches a copy of the current bundled file - an alias copied from an older release will differ and is deliberately left alone rather than deleted on a guess.

The Experts

ExpertWhat they doExample triggers
ArchitectSystem design, tradeoffs, complex debugging"How should I structure this?" / "What are the tradeoffs?"
Plan ReviewerValidate plans before you start"Review this migration plan" / "Is this approach sound?"
Scope AnalystCatch ambiguities early"What am I missing?" / "Clarify the scope"
Code ReviewerFind bugs, improve quality"Review this PR" / "What's wrong with this?"
Security AnalystVulnerabilities, threat modeling"Is this secure?" / "Harden this endpoint"
ResearcherExternal libraries, docs, best practices"How do I use X?" / "Find examples of Y"
DebuggerRoot-cause analysis, minimal fixes"Why does this crash?" / "Debug this failing test"

When experts help most

  • Architecture decisions - "Should I use Redis or in-memory caching?"
  • Stuck debugging - after two or more failed attempts, get a fresh perspective
  • Pre-implementation - validate a plan before writing code
  • Security concerns - "Is this auth flow safe?"
  • Code quality - a second opinion on your implementation

When not to use experts

  • Simple file operations (Claude handles these directly)
  • First attempt at any fix (try yourself first)
  • Trivial questions (no need to delegate)

How to Use

Describe your task. Claude detects when an expert helps and delegates automatically:

You: "Is this authentication flow secure?"
Claude: routes to the Security Analyst, then synthesizes the findings.

You can also ask explicitly: "Ask GPT to review this architecture", "Ask Gemini to...", or "Ask Grok to...". Each expert runs read-only for analysis or with write access to apply fixes, and Claude picks the mode from your request.

Or invoke the slash commands directly - see Commands above.

How /consensus and /ask-* keep models honest

/ask-gpt, /ask-gemini, /ask-grok, and /ask-all are the quick commands: each dispatches one or three external models, Claude reads the output, and you get one synthesized answer. Single shot, no loop, no peer round.

/consensus is the heavy one. Same parallel dispatch, but with a peer-review round and a multi-round loop that stops only when the models agree. The cost: the orchestrator (Claude) writes the review prompt, casts a vote, decides which objections are real, and runs the loop. Left alone, that setup can quietly rubber-stamp its own plan. Four guards stop that.

/consensus 3-stage flow

See the detailed diagram with bias guards and per-model flow

The four guards:

  • Blind verdict. Claude posts its own verdict (APPROVE / REQUEST CHANGES / REJECT) in a message sent before the one that calls the panel. The pre-commitment sits in the transcript, so Claude cannot reshape its opinion after seeing the others. The engine enforces this: the panel is not revealed until the blind verdict is recorded.
  • Peer review. Each external model reviews the plan independently and returns a verdict plus categorized critical issues; Claude weighs them as the arbiter. The models vote, Claude adjudicates.
  • No self-approval. A round converges only when every responding external approves and at least one external actually answered. Claude's own approval never carries a round by itself. A provider that errors (an unconfigured Grok returning missing-auth, for example) drops out of the count instead of jamming the loop.
  • No silent dismissal. Every critical issue that gets dismissed or deferred ships with a one-line reason in the final report, including the times Claude walks back one of its own blind objections. The engine rejects an adjudication that dismisses an issue without a reason.

The /ask-* commands carry a lighter version of the same rule. The external model only advises: Claude reads the output, applies its own judgment, and owns the synthesized answer. When the models agree, that is input, not a verdict.

Deep dive: how a single /consensus round actually runs

/consensus is a thin driver over the core convergence engine (core/consensus-loop.js); the loop mechanics - round counting, the convergence rule, the configurable max-rounds cap, history, and the confidence label - live in the engine, not the command. Each round:

  1. Blind verdict. Claude commits its own verdict (transcript-visible) BEFORE the panel is revealed; the engine gates the reveal on it.
  2. Panel review. GPT, Gemini, Grok (and any configured OpenRouter delegates) review the plan in parallel and emit APPROVE / REQUEST CHANGES / REJECT plus categorized critical issues. The server parses each verdict.
  3. Arbiter adjudication + revision. Claude reconciles the panel verdicts and its own blind verdict; for each critical issue it picks accept, dismiss (reason required), or defer, then revises the plan for the next round.

The loop converges when at least one responding external approves, none reject, zero critical issues remain accepted, and Claude adjudicates APPROVE - so Claude cannot self-approve. It otherwise stops at consensus.maxRounds (default 5, configurable) as unresolved. The confidence label reflects how fast it settled (round 1 = high, 2-3 = medium, 4-5 = low).

A round only pays for voices that can still answer: a peer that fails 2 rounds running is dropped from the panel (reported once as droppedProviders, then never dispatched again), and the whole loop stops at consensus.maxWallMs (default 20 min) rather than starting another round. Both apply on every driver. See TECHNICAL.md.

The same engine backs the entry points other hosts use: the consensus tool (runs the whole loop server-side in one call with a provider arbiter, or a single synthesis pass with synthesizeAlways:true) and consensus-step (drive it yourself, one action per call). See TECHNICAL.md for the taxonomy and the engine contract.

An earlier revision ran an extra "Stage 2" anonymized peer cross-review (each model scoring the others' answers blind, adapted from karpathy/llm-council). The engine-driven rewrite removed it to keep one source of truth; it may return as an engine feature.

Configuration

Full setup and configuration reference lives in SETUP.md. It covers:

  • Expert modes - advisory (read-only) vs implementation (workspace-write), chosen automatically from your request
  • Config file - location (~/.config/deliberation/config.json), the DELIBERATION_CONFIG override, and hot-reload
  • The six config sections - providers, models, routing, consensus, sessions, debug - with a minimal example
  • OpenRouter models - declaring records, askAll / consensus eligibility, fan-out, reasoningEffort, and arbiter selection; consensus also configures the round cap (maxRounds) and wall-time budget (maxWallMs, default 20 min)
  • Timeouts - providers.defaults.timeout raises the per-call ceiling for every provider at once; providers.<name>.timeout overrides one, and a pinned model's models.<id>.timeout still wins. A rate-limited (HTTP 429) call is retried once, honoring the upstream's Retry-After
  • Debug log - opt-in latency / token / voting trace
  • Session persistence - opt-in on-disk run history (incl. the host-driven /consensus loop) and the session-* tools; sessions.captureText (default off) additionally stores provider response bodies (scrubbed)

For provider internals, environment variables, and manual MCP setup, see TECHNICAL.md.

Author

Maintained by Anton Babenko - LinkedIn, X/Twitter.

Contributing

Contributions welcome. See CONTRIBUTING.md for the workflow, commit conventions, and the automated release process.

License

MIT

Files in the repo

Repository payload40 top-level entries
  • .agents
  • .claude
  • .claude-plugin
  • .cursor
  • .github
  • .opencode
  • .vscode
  • assets
  • commands
  • config
  • core
  • docs
  • examples
  • plugins
  • prompts
  • public-docs
  • rules
  • scripts
  • server
  • steering
  • test
  • .gitignore
  • AGENTS.md
  • CHANGELOG.md
  • CLAUDE.md
  • CONTRIBUTING.md
  • Dockerfile
  • glama.json
  • LICENSE
  • mcp.json
  • package-lock.json
  • package.json
  • POWER.md
  • README.md
  • renovate.json
  • server.json
  • SETUP.md
  • TECHNICAL.md
  • tsconfig.json
  • version.json

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k
t8y2/dbxConnectors

20 MB lightweight cross-platform database client for 90+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 90+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP Server。

19k