Skip to main content

mcp-second-opinion

Let your MCP-aware agent consult rival LLMs mid-conversation. One simple MCP server, four providers — OpenAI, Google Gemini, Anthropic, xAI/Grok — unified behind two tools.

Install

pip install mcp-second-opinion

or with uv:

uv add mcp-second-opinion

Configure

Set at least one of these environment variables:

Variable Provider
OPENAI_API_KEY OpenAI
GEMINI_API_KEY Google Gemini
ANTHROPIC_API_KEY Anthropic
XAI_API_KEY xAI/Grok

Providers without a key set are gracefully disabled — they appear in panel responses with a friendly error field rather than crashing the server.

Optional:

Variable Default Purpose
MCP_SECOND_OPINION_PROFILE flagship flagship | balanced | cheap — controls which model each provider uses in ask_the_panel.
MCP_SECOND_OPINION_SELF_SKIP unset Provider key to omit from panel (openai, gemini, anthropic, grok). Useful when the host is itself one of the panelists.
MCP_SECOND_OPINION_TIMEOUT 30 Per-provider timeout in seconds.
MCP_SECOND_OPINION_MAX_TOKENS 2048 Cap on rival output length.

Register with your MCP client

Claude Desktop / Claude Code (mcp_settings.json or equivalent):

{
  "mcpServers": {
    "second-opinion": {
      "command": "mcp-second-opinion",
      "env": {
        "OPENAI_API_KEY": "sk-...",
        "GEMINI_API_KEY": "...",
        "ANTHROPIC_API_KEY": "...",
        "XAI_API_KEY": "..."
      }
    }
  }
}

Tools

ask_other_model(question, model, context?, system_prompt?)

Ask one specific rival.

question:      "is this regex correct? /^[a-z]+$/"
model:         "gpt-5" | "gemini-2.5-pro" | "claude-opus-4-7" | "grok-4" | ...
context:       optional — code snippets, prior reasoning, files
system_prompt: optional — persona/framing

Returns:

{
  "answer": "...",
  "model": "gpt-5",
  "latency_ms": 842,
  "tokens": {"input": 47, "output": 92},
  "cost_usd": 0.0014
}

ask_the_panel(question, context?, system_prompt?)

Fan out to every enabled provider in parallel.

question:      "what's wrong with this approach?"
context:       optional
system_prompt: optional — applied uniformly to all panelists

Returns:

{
  "responses": {
    "openai":    {"answer": "...", "model": "gpt-5", "latency_ms": 800, "cost_usd": 0.001, "error": null},
    "gemini":    {"answer": "...", "model": "gemini-2.5-pro", "latency_ms": 750, "cost_usd": 0.0008, "error": null},
    "anthropic": {"answer": null, "model": "claude-opus-4-7", "error": "skipped (self)"},
    "grok":      {"answer": null, "model": "grok-4", "error": "XAI_API_KEY not set"}
  },
  "total_cost_usd": 0.0018,
  "total_latency_ms": 800
}

How it works

The server is a thin layer over LiteLLM, which provides a unified OpenAI-shaped interface to all four providers. Cost calculation comes from LiteLLM's pricing table.

License

MIT

Metadata

Release files for mcp-second-opinion 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-second-opinion 0.1.1
File Size Uploaded Provenance Actions
mcp_second_opinion-0.1.1.tar.gz 222.5 kB Without provenance Details for mcp_second_opinion-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-second-opinion 0.1.1
File Interpreter ABI Platform Actions
mcp_second_opinion-0.1.1-py3-none-any.whl Python 3 none any Details for mcp_second_opinion-0.1.1-py3-none-any.whl

Total release size: 231.2 kB

Release files / mcp_second_opinion-0.1.1.tar.gz

Download URL mcp_second_opinion-0.1.1.tar.gz
Size 222.5 kB
Tags Source
SHA-256 checksum
How to use checksums
371dd72da2340c5953c41fd09311dec4ff51756dc47161ecf71b7ae31520f3fa
BLAKE2b-256 checksum
How to use checksums
b5c5d9894c72b42604c9e1e1f7f8b84850b86b2910e3183e58f5a4ae23c9e8cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / mcp_second_opinion-0.1.1-py3-none-any.whl

Download URL mcp_second_opinion-0.1.1-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0fa688b1da8bd1ac7878d4e12b5521c9195fa1ab3aefadc67738ac3f082c5e9
BLAKE2b-256 checksum
How to use checksums
5931692cc0c5e4ec2be3effe75a805b17d8740e35265431524e8568216d15700
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for mcp-second-opinion 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page