📇 🏠 ☁️ - Bridge to multiple OpenAI-compatible LLMs for rubber duck debugging: explain a problem to several AI…
MCP Rubber Duck
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
An MCP (Model Context Protocol) server that acts as a bridge to query multiple LLMs -- both OpenAI-compatible HTTP APIs and CLI coding agents. Just like rubber duck debugging, explain your problems to various AI "ducks" and get different perspectives!
> **Why direct provider integration?** MCP's sampling primitive -- a server borrowing the *host's* model -- was deprecated in the 2026-07-28 spec RC in favor of servers integrating directly with LLM provider APIs. Rubber Duck has always worked this way (it brings its own ducks), so it's aligned with where the protocol is heading -- no migration required.
Features
- **Universal OpenAI Compatibility** -- Works with any OpenAI-compatible API endpoint
- **CLI Agent Support** -- Use CLI coding agents (Claude Code, Codex, Gemini CLI, Grok, Aider) as ducks
- **Multiple Ducks** -- Configure and query multiple LLM providers simultaneously
- **Conversation Management** -- Maintain context across multiple messages
- **Duck Council** -- Get responses from all your configured LLMs at once
- **Consensus Voting** -- Multi-duck voting with reasoning and confidence scores
- **LLM-as-Judge** -- Have ducks evaluate and rank each other's responses
- **Iterative Refinement** -- Two ducks collaboratively improve responses
- **Structured Debates** -- Oxford, Socratic, and adversarial debate formats
- **MCP Prompts** -- 8 reusable prompt templates for multi-LLM workflows
- **Vision Input** -- Send images alongside prompts to vision-capable models (docs)
- **Automatic Failover** -- Falls back to other providers if primary fails
- **Health Monitoring** -- Real-time health checks for all providers
- **Usage Tracking** -- Track requests, tokens, and estimated costs per provider
- **MCP Bridge** -- Connect ducks to other MCP servers for extended functionality (docs)
- **Guardrails** -- Pluggable safety layer with rate limiting, token limits, pattern blocking, and PII redaction (docs)
- **Granular Security** -- Per-server approval controls with session-based approvals
- **Interactive UIs** -- Rich HTML panels for compare, vote, debate, and usage tools (via MCP Apps)
- **Tool Annotations** -- MCP-compliant hints for tool behavior (read-only, destructive, etc.)
- **Structured Output** -- outputSchema on tools returning structured JSON for client-side validation (Cursor, VS Code/Copilot)
- **Spec-Aligned by Design** -- connects directly to provider APIs, the path the MCP 2026-07-28 spec recommends now that server-side sampling is deprecated (SEP-2577)
Supported Providers
HTTP Providers (OpenAI-compatible API)
Any provider with an OpenAI-compatible API endpoint, including:
- **OpenAI**
- **Google Gemini**
- **Anthropic** (via OpenAI-compatible endpoints)
- **Groq** (fast inference for open-weight models)
- **Together AI** (broad open-weight model catalog)
- **Perplexity** (online models with web search)
- **Anyscale**, **Azure OpenAI**, **Ollama**, **LM Studio**, **Custom**
CLI Providers (Coding Agents)
Command-line coding agents that run as local processes:
- **Claude Code** (claude) -- **Codex** (codex) -- **Gemini CLI** (gemini) -- **Grok CLI** (grok) -- **Aider** (aider) -- **Custom**
See CLI Providers for full setup and configuration.
Quick Start
**Using Claude Desktop?** Jump to Claude Desktop Configuration.
**Using Cursor, VS Code, Windsurf, or another tool?** See the Setup Guide.
Installation
Prerequisites
- Node.js 20 or higher
- npm or yarn
- At least one API key for an HTTP provider, **or** a CLI coding agent installed locally
Install from NPM
Install from Source
Configuration
Create a .env file or config/config.json. Key environment variables:
| Variable | Description |
|----------|-------------|
| OPENAI_API_KEY | OpenAI API key |