io.github.nesquikm/rubber-duck

编码与调试

by nesquikm

连接多个 OpenAI-compatible LLMs 的 MCP server,可作为你的 AI rubber duck 调试面板。

把多个 OpenAI 兼容模型接进同一套 MCP 调试面板,帮你在橡皮鸭式排错时快速获得多视角代码诊断,卡住时尤其好用

什么是 io.github.nesquikm/rubber-duck

连接多个 OpenAI-compatible LLMs 的 MCP server,可作为你的 AI rubber duck 调试面板。

README

MCP Rubber Duck

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!

npm version Docker Image MCP Registry

<p align="center"> <img src="assets/mcp-rubber-duck.jpg" alt="MCP Rubber Duck - AI ducks helping debug code" width="600"> </p>

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)

Supported Providers

HTTP Providers (OpenAI-compatible API)

Any provider with an OpenAI-compatible API endpoint, including:

  • OpenAI (GPT-5.1, o3, o4-mini)
  • Google Gemini (Gemini 3, Gemini 2.5 Pro/Flash)
  • Anthropic (via OpenAI-compatible endpoints)
  • Groq (Llama 4, Llama 3.3)
  • Together AI (Llama 4, Qwen, and more)
  • 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

bash
# Install globally
npm install -g mcp-rubber-duck

# Or use npx directly in Claude Desktop config
npx mcp-rubber-duck

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

bash
npm install -g mcp-rubber-duck

Install from Source

bash
git clone https://github.com/nesquikm/mcp-rubber-duck.git
cd mcp-rubber-duck
npm install
npm run build
npm start

Configuration

Create a .env file or config/config.json. Key environment variables:

VariableDescription
OPENAI_API_KEYOpenAI API key
GEMINI_API_KEYGoogle Gemini API key
GROQ_API_KEYGroq API key
DEFAULT_PROVIDERDefault provider (e.g., openai)
DEFAULT_TEMPERATUREDefault temperature (e.g., 0.7)
LOG_LEVELdebug, info, warn, error
MCP_SERVERSet to true for MCP server mode
MCP_BRIDGE_ENABLEDEnable MCP Bridge (ducks access external MCP servers)
CUSTOM_{NAME}_*Custom HTTP providers
CLI_{AGENT}_ENABLEDEnable CLI agents (CLAUDE, CODEX, GEMINI, GROK, AIDER)

Full reference: Configuration docs

Interactive UIs (MCP Apps)

Four tools -- compare_ducks, duck_vote, duck_debate, and get_usage_stats -- can render rich interactive HTML panels inside supported MCP clients via MCP Apps. Once this MCP server is configured in a supporting client, the UIs appear automatically -- no additional setup is required. Clients without MCP Apps support still receive the same plain text output (no functionality is lost). See the MCP Apps repo for an up-to-date list of supported clients.

Compare Ducks

Compare multiple model responses side-by-side, with latency indicators, token counts, model badges, and error states.

<p align="center"> <img src="assets/ext-apps-compare.png" alt="Compare Ducks interactive UI" width="600"> </p>

Duck Vote

Have multiple ducks vote on options, displayed as a visual vote tally with bar charts, consensus badge, winner card, confidence bars, and collapsible reasoning.

<p align="center"> <img src="assets/ext-apps-vote.png" alt="Duck Vote interactive UI" width="600"> </p>

Duck Debate

Structured multi-round debate between ducks, shown as a round-by-round view with format badge, participant list, collapsible rounds, and synthesis section.

<p align="center"> <img src="assets/ext-apps-debate.png" alt="Duck Debate interactive UI" width="600"> </p>

Usage Stats

Usage analytics with summary cards, provider breakdown with expandable rows, token distribution bars, and estimated costs.

<p align="center"> <img src="assets/ext-apps-usage-stats.png" alt="Usage Stats interactive UI" width="600"> </p>

Available Tools

ToolDescription
ask_duckAsk a single question to a specific LLM provider
chat_with_duckConversation with context maintained across messages
clear_conversationsClear all conversation history
list_ducksList configured providers and health status
list_modelsList available models for providers
compare_ducksAsk the same question to multiple providers simultaneously
duck_councilGet responses from all configured ducks
get_usage_statsUsage statistics and estimated costs
duck_voteMulti-duck voting with reasoning and confidence
duck_judgeHave one duck evaluate and rank others' responses
duck_iterateIteratively refine a response between two ducks
duck_debateStructured multi-round debate between ducks
mcp_statusMCP Bridge status and connected servers
get_pending_approvalsPending MCP tool approval requests
approve_mcp_requestApprove or deny a duck's MCP tool request

Full reference with input schemas: Tools docs

Available Prompts

PromptPurposeRequired Arguments
perspectivesMulti-angle analysis with assigned lensesproblem, perspectives
assumptionsSurface hidden assumptions in plansplan
blindspotsHunt for overlooked risks and gapsproposal
tradeoffsStructured option comparisonoptions, criteria
red_teamSecurity/risk analysis from multiple anglestarget
reframeProblem reframing at different levelsproblem
architectureDesign review across concernsdesign, workloads, priorities
diverge_convergeDivergent exploration then convergencechallenge

Full reference with examples: Prompts docs

Development

bash
npm run dev        # Development with watch mode
npm test           # Run all tests
npm run lint       # ESLint
npm run typecheck  # Type check without emit

Documentation

TopicLink
Setup guide (all tools)docs/setup.md
Full configuration referencedocs/configuration.md
Claude Desktop setupdocs/claude-desktop.md
All tools with schemasdocs/tools.md
Prompt templatesdocs/prompts.md
CLI coding agentsdocs/cli-providers.md
MCP Bridgedocs/mcp-bridge.md
Guardrailsdocs/guardrails.md
Docker deploymentdocs/docker.md
Provider-specific setupdocs/provider-setup.md
Usage examplesdocs/usage-examples.md
Architecturedocs/architecture.md
Roadmapdocs/roadmap.md

Troubleshooting

Provider Not Working

  1. Check API key is correctly set
  2. Verify endpoint URL is correct
  3. Run health check: list_ducks({ check_health: true })
  4. Check logs for detailed error messages

Connection Issues

  • For local providers (Ollama, LM Studio), ensure they're running
  • Check firewall settings for local endpoints
  • Verify network connectivity to cloud providers

Rate Limiting

  • Configure failover to alternate providers
  • Adjust max_retries and timeout settings
  • See Guardrails for rate limiting configuration

Contributing

code
     __
   <(o )___
    ( ._> /
     `---'  Quack! Ready to debug!

We love contributions! Whether you're fixing bugs, adding features, or teaching our ducks new tricks, we'd love to have you join the flock.

Check out our Contributing Guide to get started.

Quick start for contributors:

  1. Fork the repository
  2. Create a feature branch
  3. Follow our conventional commit guidelines
  4. Add tests for new functionality
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Acknowledgments

  • Inspired by the rubber duck debugging method
  • Built on the Model Context Protocol (MCP)
  • Uses OpenAI SDK for HTTP provider compatibility
  • Supports CLI coding agents (Claude Code, Codex, Gemini CLI, Grok, Aider)

Changelog

See CHANGELOG.md for a detailed history of changes and releases.

Registry & Directory

Support


Happy Debugging with your AI Duck Panel!

常见问题

io.github.nesquikm/rubber-duck 是什么?

连接多个 OpenAI-compatible LLMs 的 MCP server,可作为你的 AI rubber duck 调试面板。

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描109.6k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描109.6k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描109.6k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
82.9k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
51.5k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.2k

评论