
This server orchestrates debates between multiple AI models to stress test ideas and code. It exposes three main tools: brainstorm for multi-round debates with synthesis verdicts, brainstorm_quick for instant parallel perspectives across models, and brainstorm_review for multi-model code reviews with severity ratings. You can run it in API mode with your own OpenAI, Gemini, DeepSeek, or Ollama keys, or use hosted mode where Claude spawns sub-agents with different models without needing external APIs. Supports debate styles like red team and Socratic questioning, and includes context injection for grounding discussions in actual code or diffs. Useful when you want multiple model opinions before making architectural decisions or merging risky changes.
Ask one model a design question and you get one confident answer, with no signal about which parts it is unsure of. Ask three and the disagreement is the signal.
brainstorm-mcp runs multi-round debates between GPT, Gemini, DeepSeek, Claude and local Ollama models from inside your editor: they see and critique each other's answers across rounds, then you get a 3-bullet synthesis — recommendation, key tradeoffs, strongest disagreement. Also does instant quick mode, multi-model code review with verdicts, and red-team/Socratic styles. Hosted mode needs zero API keys.
Don't trust one AI. Make them argue.
Click to watch: 3 models debate, cross-examine, and produce a structured verdict — all inside Claude Code.
claude, codex, and more) so debates run on your subscription instead of API creditsclaude mcp add brainstorm -- npx -y brainstorm-mcp
That is enough for hosted mode (no API keys — it debates using the models already available in your environment). Add provider keys to bring GPT, Gemini, DeepSeek, Groq or Ollama into the debate.
Add to your project's .mcp.json:
{
"mcpServers": {
"brainstorm": {
"command": "npx",
"args": ["-y", "brainstorm-mcp"],
"env": {
"OPENAI_API_KEY": "sk-...",
"GEMINI_API_KEY": "AIza...",
"DEEPSEEK_API_KEY": "sk-..."
}
}
}
}
Add to claude_desktop_config.json:
{
"mcpServers": {
"brainstorm": {
"command": "npx",
"args": ["-y", "brainstorm-mcp"],
"env": {
"OPENAI_API_KEY": "sk-...",
"DEEPSEEK_API_KEY": "sk-..."
}
}
}
}
npm install -g brainstorm-mcp
brainstorm-mcp
Hosted mode requires no API keys — just install and go. The host (Claude Code) executes prompts using its own model access.
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=AIza...
DEEPSEEK_API_KEY=sk-...
Set BRAINSTORM_CONFIG to point to a JSON config:
{
"providers": {
"openai": { "model": "gpt-5.4", "apiKeyEnv": "OPENAI_API_KEY" },
"gemini": { "model": "gemini-2.5-flash", "apiKeyEnv": "GEMINI_API_KEY" },
"deepseek": { "model": "deepseek-chat", "apiKeyEnv": "DEEPSEEK_API_KEY" },
"ollama": { "model": "llama3.1", "baseURL": "http://localhost:11434/v1" }
}
}
Known providers (openai, gemini, deepseek, groq, mistral, together, moonshot,
minimax, glm, qwen) don't need a baseURL.
If you already pay for Claude Code, Codex, Gemini CLI, and friends, brainstorm can shell out to
those CLIs instead of buying API credits. Any agent CLI found on your PATH is registered
automatically at startup — no configuration needed:
[brainstorm] Detected CLI provider(s) on PATH: claude, codex (subscription-based, no API cost)
Use them like any other provider:
{ "topic": "GraphQL vs REST", "models": ["claude:sonnet", "codex:default", "openai:gpt-5.4"] }
Built-in adapters:
| Provider | Command | Default model | Status |
|---|---|---|---|
claude | claude -p | sonnet | verified |
codex | codex exec | default | verified |
gemini | gemini -p | gemini-2.5-pro | best-effort, verify locally |
cursor-agent | cursor-agent -p | default | best-effort |
opencode | opencode run | default | best-effort |
qwen | qwen -p | qwen3-coder-plus | best-effort |
kimi | kimi --print | default | best-effort |
droid | droid exec | default | best-effort |
<provider>:default means "let the CLI use whatever model it's configured with". CLI calls run
with tools disabled and a read-only sandbox where the CLI supports it — they generate text, they
don't touch your repo. Provider-specific API key env vars (ANTHROPIC_API_KEY, OPENAI_API_KEY)
are stripped from the child process so the CLI falls back to your subscription login.
Env knobs:
| Variable | Effect |
|---|---|
BRAINSTORM_CLI_PROVIDERS | auto (default), off, or a comma-separated list of adapters to detect |
BRAINSTORM_PREFER_CLI | 1 — debates with no explicit models use only CLI providers, skipping metered APIs |
BRAINSTORM_CLI_TIMEOUT_MS | Per-call timeout for CLI providers (default 300000) |
To pin a model or add a CLI that isn't built in, use the config file:
{
"providers": {
"claude": { "type": "cli", "model": "opus" },
"my-cli": {
"type": "cli",
"adapter": "custom",
"command": "some-agent-cli",
"args": ["run", "--model", "{{model}}", "--quiet", "{{prompt}}"],
"promptVia": "arg",
"model": "some-model"
}
}
}
Template placeholders: {{model}}, {{system}}, {{prompt}}, {{outfile}}. A lone placeholder
that resolves to nothing drops out of the command line along with the flag introducing it, so
["--model", "{{model}}"] works even for provider:default. Set "promptVia": "stdin" to pipe
the prompt instead of passing it as an argument.
Moonshot (Kimi), MiniMax, and Z.ai (GLM) sell coding-plan subscriptions that speak the Anthropic
API. Point the claude binary at one of them and that vendor joins the debate on the plan you
already pay for:
{
"providers": {
"moonshot": { "type": "cli", "backend": "moonshot", "model": "kimi-k2-thinking" },
"minimax": { "type": "cli", "backend": "minimax", "model": "MiniMax-M2" },
"glm": { "type": "cli", "backend": "glm", "model": "glm-4.6" }
}
}
| Backend | Endpoint | Token env var |
|---|---|---|
moonshot | https://api.moonshot.ai/anthropic | MOONSHOT_API_KEY |
minimax | https://api.minimax.io/anthropic | MINIMAX_API_KEY |
glm | https://api.z.ai/api/anthropic | ZAI_API_KEY |
The token is read from your environment at call time — the config file holds the variable name,
never the secret. ANTHROPIC_API_KEY is stripped from the child so your Anthropic account is
never billed for these. Any CLI provider also accepts an "env" block to override the backend
manually; a value of "$NAME" indirects through the server's environment.
These vendors are reachable as plain metered APIs too — moonshot, minimax, glm and qwen
have known base URLs, so MOONSHOT_API_KEY alone is enough to register moonshot as an API
provider.
| Tool | Description | Annotation |
|---|---|---|
brainstorm | Multi-round debate between AI models (API or hosted mode) | readOnly |
brainstorm_quick | Instant multi-model perspectives — parallel, no rounds | readOnly |
brainstorm_review | Multi-model code review with findings, severity, verdict | readOnly |
brainstorm_respond | Submit Claude's response in an interactive session | readOnly |
brainstorm_collect | Submit model responses in a hosted session | readOnly |
list_providers | Show configured providers, API key status, and detected CLIs | readOnly |
add_provider | Add a new API or CLI provider at runtime | non-destructive |
Prompt: "Use brainstorm_quick to compare Redis vs PostgreSQL for session storage"
Tool called: brainstorm_quick
{ "topic": "Redis vs PostgreSQL for session storage in a Node.js app" }
Output: Each configured model responds independently in parallel. You get a side-by-side comparison in under 10 seconds with model names, responses, timing, and cost.
Error handling: If a model fails (rate limit, timeout), the tool continues with remaining models and shows which ones failed.
Prompt: "Review this diff for security issues" (with a git diff pasted)
Tool called: brainstorm_review
{
"diff": "diff --git a/src/auth.ts ...",
"title": "Add JWT authentication middleware",
"focus": ["security", "correctness"]
}
Output: A structured verdict (approve / approve with warnings / needs changes) with a findings table showing severity, category, file, line numbers, and suggestions. Includes model agreement analysis — issues flagged by multiple models have higher confidence.
Error handling: If synthesis fails, raw model reviews are still returned.
Prompt: "Brainstorm using opus, sonnet, and haiku about whether we should use GraphQL or REST"
Tool called: brainstorm
{
"topic": "GraphQL vs REST for our public API",
"models": ["opus", "sonnet", "haiku"],
"mode": "hosted",
"rounds": 2,
"style": "redteam"
}
Output: The tool returns prompts for each model. The host (Claude Code) spawns sub-agents with different models, collects responses, and feeds them back via brainstorm_collect. After all rounds, a synthesis model produces a 3-bullet verdict: Recommendation, Key Tradeoffs, Strongest Disagreement.
Error handling: Sessions expire after 10 minutes. If a session is not found, a clear error message is returned with instructions to start a new one.
brainstorm-mcp runs entirely on your machine and does not collect, store, or transmit any personal data, telemetry, or analytics.
In API mode, prompts are sent directly from your machine to the model providers you configure (OpenAI, Gemini, DeepSeek, etc.) using your own API keys. In CLI mode, prompts are passed to agent CLIs installed on your machine, which talk to their own vendors under your existing subscription. In hosted mode, no external API calls are made.
Debate sessions are stored in-memory only with a 10-minute TTL. No data is written to disk unless you explicitly save results.
Full privacy policy: PRIVACY.md
git clone https://github.com/spranab/brainstorm-mcp.git
cd brainstorm-mcp
npm install
npm run build
npm start
Other agent infrastructure by the same author, built to be used together:
MIT
OPENAI_API_KEYsecretOpenAI API key for GPT models (optional — not needed in hosted mode)
GEMINI_API_KEYsecretGoogle Gemini API key (optional)
DEEPSEEK_API_KEYsecretDeepSeek API key (optional)