Skip to main content

Multi-model AI analysis for Claude - get second opinions from DeepSeek, Kimi, and OpenRouter

Project description

Second Opinion MCP

Get second opinions from multiple AI models while using Claude. Break the single-model echo chamber by consulting DeepSeek Reasoner, Kimi K2.5 (Moonshot), and 300+ OpenRouter models.

What It Does

When working with Claude Code or Claude Desktop, this MCP server lets you:

  • Get alternative perspectives on code, architecture, and decisions
  • Run systematic code reviews with severity-classified issues
  • Stage multi-model debates where AI models argue opposing positions
  • Challenge proposals with anti-sycophancy mode (finds weaknesses, not validation)

Quickstart

1. Install

pipx install second-opinion-mcp

If you don't have pipx, install it first: pip install pipx && pipx ensurepath

2. Setup

Run the interactive setup wizard:

second-opinion-mcp setup

The wizard will guide you through selecting providers and entering API keys. Keys are stored securely in your system's credential manager.

3. Register

After setup, copy the registration command from the wizard output, e.g.:

claude mcp add -s user second-opinion -e SECOND_OPINION_PROVIDERS="deepseek,moonshot" -- second-opinion-mcp

That's it. Restart Claude Code and the tools are available.

Supported Models

DeepSeek V3.2 (Recommended)

Chain-of-thought reasoning model. Best for code reviews and complex analysis.

Kimi K2.5 (Moonshot)

Chinese AI model with thinking mode. Good for alternative perspectives and debates.

OpenRouter (Optional)

Access 300+ models through a single API. Enable for variety or specific model access.

Available Tools

second_opinion

Get a straightforward second opinion on any question, code, or decision.

Use second_opinion to review this database schema: [paste schema]

challenge

Anti-sycophancy mode. The model is instructed to find weaknesses, not validate.

Use challenge to critique: "We should use a global singleton for database connections"

code_review

Systematic directory-based code review with BLOCKER/CRITICAL/MAJOR/MINOR classifications.

Use code_review on directory="./src" with focus_areas=["security", "performance"]

consensus

Multi-model debate where DeepSeek and Moonshot argue opposing positions, then synthesize.

Use consensus to debate: "GraphQL vs REST for internal microservices"

review_synthesis

Full workflow: parallel reviews from both models, debate, then synthesis instructions.

Perform a comprehensive code review of ./myproject using review_synthesis

Usage Examples

Thorough Code Review Workflow

For comprehensive code reviews, use this prompt pattern with Claude Code:

MyProject: perform a comprehensive deep parallel code review with deepseek and kimi
using mcp server second-opinion - save resulting md files to the project folder
to the docs subfolder in md format.

After that perform Consensus debate + arbiter synthesis using same mcp server tools
with opus 4.5 compiling a final document for the final review.

First 2 tasks can be run in parallel.

This triggers parallel code_review calls to DeepSeek and Moonshot, then a consensus debate on findings, and finally Claude synthesizes the final review document.

Quick Second Opinion

Use second_opinion to review this database schema:
CREATE TABLE users (
  id SERIAL PRIMARY KEY,
  email VARCHAR(255),
  password VARCHAR(255)
);

Critical Challenge

Use challenge to critique this proposal: "We should use a global singleton for
database connections because it's simpler"

Consensus Debate

Use consensus to debate: "GraphQL vs REST for our internal microservices API"

Code Review with Focus Areas

Use code_review on directory="./src" with focus_areas=["security", "error-handling"]
and save_to="./docs/reviews"

Configuration

Changing Providers

After initial setup, reconfigure providers:

second-opinion-mcp setup

Or manually set the environment variable:

# Claude Code CLI
claude mcp add -s user second-opinion -e SECOND_OPINION_PROVIDERS="deepseek" -- second-opinion-mcp

# Only DeepSeek
export SECOND_OPINION_PROVIDERS="deepseek"

# Only Moonshot
export SECOND_OPINION_PROVIDERS="moonshot"

# All providers
export SECOND_OPINION_PROVIDERS="deepseek,moonshot,openrouter"

API Key Management

Keys are stored in your system's credential manager (Windows Credential Manager, macOS Keychain, or Linux Secret Service).

To update keys:

second-opinion-mcp setup

Or manually set each provider's key:

# DeepSeek (key starts with sk-)
python -c "import keyring; keyring.set_password('second-opinion', 'deepseek', 'sk-YOUR_DEEPSEEK_KEY')"

# Moonshot/Kimi
python -c "import keyring; keyring.set_password('second-opinion', 'moonshot', 'YOUR_MOONSHOT_KEY')"

# OpenRouter (key starts with sk-or-)
python -c "import keyring; keyring.set_password('second-opinion', 'openrouter', 'sk-or-YOUR_OPENROUTER_KEY')"

Verify keys are configured:

python -c "import keyring; print('deepseek:', bool(keyring.get_password('second-opinion', 'deepseek'))); print('moonshot:', bool(keyring.get_password('second-opinion', 'moonshot'))); print('openrouter:', bool(keyring.get_password('second-opinion', 'openrouter')))"

Claude Desktop Configuration

For Claude Desktop (the standalone app), add to claude_desktop_config.json:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "second-opinion": {
      "command": "second-opinion-mcp",
      "env": {
        "SECOND_OPINION_PROVIDERS": "deepseek,moonshot"
      }
    }
  }
}

Troubleshooting

"No API key configured" Error

Run the setup wizard again:

second-opinion-mcp setup

"Keyring access failed" (Linux)

Linux without a desktop environment needs a keyring backend configured:

pip install keyrings.alt
mkdir -p ~/.local/share/python_keyring
echo -e "[backend]\ndefault-keyring=keyrings.alt.file.EncryptedKeyring" > ~/.local/share/python_keyring/keyringrc.cfg

Connection Timeout

Check firewall, VPN, or proxy settings. Both DeepSeek (api.deepseek.com) and Moonshot (api.moonshot.ai) must be accessible.

Rate Limit Exceeded

Moonshot has rate limits (3 concurrent, 20 RPM at Tier 0). Wait a minute and retry, or use fast mode for non-critical queries.

Tool Not Found in Claude

Verify registration:

claude mcp list

If not listed, re-register:

claude mcp add -s user second-opinion -e SECOND_OPINION_PROVIDERS="deepseek,moonshot" -- second-opinion-mcp

Advanced Usage

Fast Mode

Skip the thinking/reasoning phase for quicker responses:

Use second_opinion with fast=true to check: is this regex correct?

Note: Code reviews always use full thinking mode regardless of this setting.

Include Reasoning

See the model's chain-of-thought:

Use second_opinion with include_reasoning=true to analyze this algorithm

Focus Areas for Reviews

Use code_review with focus_areas=["security", "error-handling", "performance"]

Save Review Output

Use code_review on directory="./src" with save_to="./docs/reviews"

Updating

The server checks for updates on startup and notifies you if a new version is available.

To update manually:

pipx upgrade second-opinion-mcp

Or reinstall:

pipx uninstall second-opinion-mcp
pipx install second-opinion-mcp

Your API keys are preserved in the system keyring across updates.

Uninstalling

# Remove from Claude
claude mcp remove second-opinion

# Uninstall package
pipx uninstall second-opinion-mcp

# Optional: remove stored API keys
python -c "import keyring; keyring.delete_password('second-opinion', 'deepseek')"
python -c "import keyring; keyring.delete_password('second-opinion', 'moonshot')"
python -c "import keyring; keyring.delete_password('second-opinion', 'openrouter')"

Security

API keys are stored in your OS keyring, not in environment variables or config files. The code review tool:

  • Skips .env files, credentials, SSH keys, and certificates
  • Validates directories against allowed roots
  • Detects symlinks to prevent traversal attacks
  • Limits content size to prevent memory exhaustion

Cost Estimates

Per operation (typical usage):

Tool Approximate Cost
second_opinion / challenge ~$0.001
code_review ~$0.01-0.05
consensus (2 rounds) ~$0.004-0.010
review_synthesis ~$0.02-0.10

License

MIT License. See LICENSE file.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

second_opinion_mcp-0.3.3.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

second_opinion_mcp-0.3.3-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

Details for the file second_opinion_mcp-0.3.3.tar.gz.

File metadata

  • Download URL: second_opinion_mcp-0.3.3.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for second_opinion_mcp-0.3.3.tar.gz
Algorithm Hash digest
SHA256 4b338aa99b96865d421620f5fd437a9a286c3152ac71cb6efe974b1d12c69bad
MD5 2d521285d49e5ede07ae54de09d5001c
BLAKE2b-256 e0ed192f5993cffe86df34b6715bc98db01e60d0b0087d61c756b2a800da8a69

See more details on using hashes here.

Provenance

The following attestation bundles were made for second_opinion_mcp-0.3.3.tar.gz:

Publisher: publish.yml on MarvinFS/second-opinion-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file second_opinion_mcp-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for second_opinion_mcp-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90a626d5450db9f82fc821b1617b6d8e10919ece3b8f22f14470f066e7406eb7
MD5 4c76c740de04451738346784d34822d4
BLAKE2b-256 61217b264acc8fec30820826dc5dc87558e4ab9576106d2eb54d99d00da765f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for second_opinion_mcp-0.3.3-py3-none-any.whl:

Publisher: publish.yml on MarvinFS/second-opinion-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page