consensus-mcp
ai-consensus-mcp
Model Context Protocolの最小限のstdioサーバーであり、Consensus Validation Protocolを単一の
consensusツールとして公開します。 Claude Code、Cursor、Windsurf、またはその他のMCPホストに、本格的なマルチモデルの円卓会議機能を提供します。
ai-consensus-coreの薄いラッパーです。ツールは1つ、設定ファイルは1つ、面倒なことは一切ありません。
提供機能
MCPツール
consensus: モデルとペルソナのリストを指定して、複数ラウンドの議論を実行します。OpenAI互換プロバイダーに対応: xAI Grok、Anthropic(OpenAI互換エンドポイント経由)、OpenAI、Groq、Together、Fireworks、または独自のプライベートゲートウェイ。アダプターは1つで、参加者ごとに設定可能です。
ライブ進捗表示: エンジンの構造化イベントはすべてMCPの進捗通知として転送されます。ホスト側でラウンド、参加者、意見の相違、スコアの状況をリアルタイムで表示できます。
依存関係が少ない:
@modelcontextprotocol/sdk、zod、ai-consensus-coreのみ。SSE解析はネイティブのfetchを使用しており、プロバイダー固有のSDKは不要です。
Related MCP server: Claude Code AI Collaboration MCP Server
プロトコル
実際のプロトコル(ラウンド、フェーズ、プロンプト、スコアリング)については、ai-consensus-coreのプロトコル図を参照してください。このREADMEではサーバーのインターフェースのみを扱います。
インストール
npm経由:
# Globally, for use as a binary
npm install -g ai-consensus-mcp
# Or as a project dependency
npm install ai-consensus-mcpまたはクローンして実行:
git clone https://github.com/entropyvortex/ai-consensus-mcp.git
cd ai-consensus-mcp
npm install
npm run build設定
例をコピーして編集します:
cp consensus.config.example.json ./consensus.config.json最小構成:
{
"providers": {
"xai": {
"baseUrl": "https://api.x.ai/v1",
"apiKeyEnv": "GROK_API_KEY"
},
"anthropic": {
"baseUrl": "https://api.anthropic.com/v1",
"apiKeyEnv": "ANTHROPIC_API_KEY"
}
},
"participants": [
{ "id": "grok", "provider": "xai", "modelId": "grok-4", "personaId": "pessimist" },
{ "id": "domain", "provider": "anthropic", "modelId": "claude-sonnet-4-6", "personaId": "domain-expert" },
{ "id": "devil", "provider": "xai", "modelId": "grok-4", "personaId": "devils-advocate" }
],
"judge": {
"provider": "xai",
"modelId": "grok-4"
}
}設定リファレンス
providers.<id>.baseUrl string OpenAI-compatible base URL. No trailing /chat/completions.
providers.<id>.apiKeyEnv string Name of the env var holding the API key.
providers.<id>.extraHeaders object? Static headers sent on every request (rarely needed).
participants[].id string Stable participant id (appears in events + progress).
participants[].provider string Key into providers.
participants[].modelId string Opaque model id the provider accepts.
participants[].personaId enum One of: pessimist, first-principles, vc-specialist,
scientific-skeptic, optimistic-futurist,
devils-advocate, domain-expert.
participants[].label string? Optional display label.
judge.provider string? Key into providers.
judge.modelId string? Opaque judge model id.
judge.temperature number? Defaults to 0.3.
judge.maxOutputTokens number? Defaults to 1500.
defaults.maxRounds int? 1–10, defaults 4.
defaults.earlyStop bool? Defaults true.
defaults.convergenceDelta number? Defaults 3.
defaults.disagreementThreshold number? Defaults 20.
defaults.blindFirstRound bool? Defaults true.
defaults.randomizeOrder bool? Defaults true.
defaults.participantTemperature number? Defaults 0.7.
defaults.maxOutputTokens int? Defaults 1500.
defaults.useJudge bool? Defaults true if `judge` is declared, else false.このリストに含まれていないフィールドは設定ローダーによって拒否されます。タイプミスは黙って無視されるのではなく、明確にエラーとなります。
スタンドアロン実行
export GROK_API_KEY=xai-...
export ANTHROPIC_API_KEY=sk-ant-...
ai-consensus-mcp --config ./consensus.config.jsonサーバーはstdio経由でJSON-RPCを使用します。起動時に以下のような準備完了行が stderr に書き込まれます。
ai-consensus-mcp ready — 3 participant(s) from 2 provider(s), judge=grok-4 (config: /abs/consensus.config.json)stdoutはMCPプロトコルストリーム用に予約されています。
MCPホストへの登録
Claude Desktop
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) またはWindowsの同等のファイルを編集します:
{
"mcpServers": {
"consensus": {
"command": "ai-consensus-mcp",
"args": ["--config", "/absolute/path/to/consensus.config.json"],
"env": {
"GROK_API_KEY": "xai-...",
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}(グローバルインストールしていない場合は、"command": "ai-consensus-mcp" を "command": "node" に置き換え、args で /path/to/ai-consensus-mcp/dist/index.js を指定してください。)
Claude Desktopを再起動すると、consensus ツールが利用可能になります。
Claude Code
claude mcp add consensus \
--scope user \
-- ai-consensus-mcp --config /absolute/path/to/consensus.config.jsonまたは、同じ command / args / env 構造で ~/.claude.json を直接編集します。
Cursor、Windsurf、その他のホスト
関連するプロバイダーのAPIキーを環境変数に設定し、ai-consensus-mcp --config <path>/consensus.config.json を指定してください。stdioトランスポートのみ対応しています。
consensus ツール
入力
{
"prompt": "Should an early-stage startup adopt microservices from day one?",
"maxRounds": 4, // optional, 1–10
"participantIds": ["grok", "domain"], // optional — subset of configured participants
"earlyStop": true, // optional
"judge": true, // optional — defaults to config.defaults.useJudge
"blindFirstRound": true, // optional
"randomizeOrder": true, // optional
"convergenceDelta": 3, // optional
"disagreementThreshold": 20, // optional
"participantTemperature": 0.7, // optional
"maxOutputTokens": 1500, // optional
"randomSeed": 42 // optional — deterministic round-order shuffle
}prompt のみが必須です。それ以外は設定ファイルの defaults、次にエンジンのデフォルト値が使用されます。
出力
呼び出しが成功するたびに2つのアーティファクトが生成されます:
content[0].text— 人間が読めるMarkdown形式の要約:最終スコア、所要時間、停止理由
ラウンドごとのスコア表
ペルソナとモデルでラベル付けされた最終ラウンドの回答
判定者の統合結果(
judge: trueの場合)
structuredContent— プログラムで利用するための完全なConsensusResult(JSON形式)。
進捗通知
エンジンの構造化イベントはすべてMCPの notifications/progress メッセージとして転送されます。トークンレベルのストリーミングイベントは、チャンネルを溢れさせるため意図的に除外されています。
エンジンイベント | 進捗メッセージの例 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
progress は roundComplete および synthesisComplete で単調増加します。total は maxRounds + (judge ? 1 : 0) です。
エラー
設定読み込みエラー は起動時に致命的となり、問題のあるフィールドパスとともにstderrに出力されます。
ツール入力エラー は
{ isError: true, content: [{ type: "text", text: "…" }] }を返します。ホスト側で認識されますが、サーバーは稼働し続けます。プロバイダーエラー (HTTP 2xx以外、空のストリームなど) は参加者ごとの
response.errorフィールドにキャプチャされ、残りの参加者で実行が継続されます。エラーは進捗ストリームと最終的な構造化結果の両方で確認できます。キャンセル。ホストがツール呼び出しをキャンセルすると、
AbortSignalが実行中のすべてのfetchに伝播し、エンジンはstopReason: "aborted"を含むConsensusResultを返します。
制限事項と非目標
永続化なし: すべてのツール呼び出しは新規実行です。履歴が必要な場合は、ホスト側で
structuredContentを記録してください。HTTPトランスポートなし: stdioのみです。HTTP/SSEが必要な場合は、
ai-consensus-coreを直接ラップしてください。トークン予算の強制なし:
maxOutputTokensは呼び出しごとのアドバイスです。使用量アラートはプロバイダーのダッシュボードで設定してください。複数実行のスケジューリングなし: 1呼び出しにつき1実行です。ホストがキューイングすれば順次実行されます。
これらが必要になった場合は、コアライブラリを拡張するのが最適です。このサーバーは意図的に小さく設計されています。
開発
git clone https://github.com/entropyvortex/ai-consensus-mcp.git
cd ai-consensus-mcp
npm install
npm run test # vitest — config loader + MCP handshake integration
npm run build
npm start -- --config ./consensus.config.json哲学
コアライブラリは、Next.js、CLI、Worker、Durable Object、他のMCPサーバーなど、どこでも動作するべきです。そのため、LLMプロバイダーが何であるかを認識していません。
このパッケージは、多くの人が最初に必要とする「どこでも」を実現するものです。Claude Code、Cursor、Windsurfなど、プロトコルを話すあらゆるホストに組み込めるstdio MCPサーバーです。意図的に小さく作られており、設定を読み込み、イベントを転送する以外のことはしません。機能が不足した場合は、コアライブラリがすぐに利用可能です。
参照
ai-consensus-core— 基盤となるライブラリ。HTTPトランスポート、カスタムスケジューラー、より深い統合が必要な場合は直接使用してください。
ライセンス
MIT
entropyvortex スタックの一部 — Marcelo Ceccon による、実用的で無駄のないAIオープンソース。
ブラジルより愛を込めて。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables collaborative debates between multiple AI agents, allowing them to discuss and reach consensus on user prompts.1MIT
- AlicenseBqualityDmaintenanceAn MCP server that enables multi-provider AI collaboration using models like DeepSeek, OpenAI, and Anthropic through strategies such as parallel execution and consensus building. It provides specialized tools for side-by-side content comparison, quality review, and iterative refinement across different AI providers.41MIT
- AlicenseAqualityCmaintenanceAn MCP server that enables users to query, compare, and synthesize responses from multiple local and cloud LLMs simultaneously using existing subscriptions. It provides tools for parallel model evaluation, consensus polling with an LLM-as-judge, and response synthesis across different model providers.81515MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that orchestrates multiple AI agents in parallel to get diverse perspectives on a single topic, supporting debate, review, and quick modes.341Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/entropyvortex/ai-consensus-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server