second-opinion-mcp-server
v0.4.1
Published
MCP server that queries multiple AI models via OpenRouter for second opinions on any question
Maintainers
Readme
second-opinion-mcp-server
An MCP server that queries multiple AI models in parallel via OpenRouter, giving your AI agent a "second opinion" on any question.
Quick Start
- Get an API key from OpenRouter
- Add to your MCP client config:
{
"mcpServers": {
"second-opinion": {
"command": "npx",
"args": ["-y", "second-opinion-mcp-server"],
"env": {
"OPENROUTER_API_KEY": "sk-or-..."
}
}
}
}To run from a local clone instead, build first then point to the dist entry:
{
"mcpServers": {
"second-opinion": {
"command": "node",
"args": ["/path/to/second_opinion/dist/index.js"],
"env": {
"OPENROUTER_API_KEY": "sk-or-..."
}
}
}
}Tools
get_second_opinion
Sends a query to multiple AI models in parallel and returns all responses as formatted Markdown.
Input:
query(string, required) — The question or prompt to send to all modelscontext(string, optional) — Additional context prepended to the querysystem_prompt(string, optional) — System prompt sent to all modelsmodels(string[], optional) — Override configured models for this requestmax_tokens(number, optional) — Max response tokens per modeltemperature(number, optional) — Sampling temperature (0-2)
review_code
Send code to multiple AI models for review with a specific focus area.
Input:
code(string, required) — The code to reviewlanguage(string, optional) — Programming languagefocus(enum, required) — Review focus:security,performance,style, orbugsmodels(string[], optional) — Override configured modelsmax_tokens(number, optional) — Max response tokens per model
compare_approaches
Compare two or more technical approaches by sending them to multiple AI models.
Input:
question(string, required) — The decision or problem to evaluateapproaches(string[], required, min 2) — The approaches to comparemodels(string[], optional) — Override configured models
fact_check
Fact-check a claim across multiple AI models, prioritizing search-augmented models.
Input:
claim(string, required) — The claim to fact-checkmodels(string[], optional) — Override configured models
follow_up
Drill deeper into a previous second-opinion response. Send the markdown from a prior tool call as context, then ask a follow-up question.
Input:
previous_responses(string, required) — The markdown output from a prior second-opinion tool callquestion(string, required) — The follow-up question to asksystem_prompt(string, optional) — System prompt sent to all modelsmodels(string[], optional) — Override configured modelsmax_tokens(number, optional) — Max response tokens per modeltemperature(number, optional) — Sampling temperature (0-2)
list_models
Return configured models with pricing, context length, and capabilities.
Input: none
Output: JSON array where each entry includes: id, name, context_length, max_completion_tokens, modality, input_cost_per_token, output_cost_per_token.
Resources
second-opinion://config
Returns server configuration as JSON (models, timeout, default temperature/max_tokens).
Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| OPENROUTER_API_KEY | Yes | - | Your OpenRouter API key |
| SECOND_OPINION_MODELS | No | See below | Comma-separated model IDs |
| SECOND_OPINION_TIMEOUT | No | 30000 | Per-model timeout in ms |
| SECOND_OPINION_TEMPERATURE | No | - | Default sampling temperature (0-2) |
| SECOND_OPINION_MAX_TOKENS | No | - | Default max response tokens |
Default Models
openai/gpt-5.2google/gemini-3-pro-previewx-ai/grok-4.1-fastperplexity/sonar-reasoning-pro
Override with SECOND_OPINION_MODELS:
"env": {
"OPENROUTER_API_KEY": "sk-or-...",
"SECOND_OPINION_MODELS": "openai/gpt-4o,meta-llama/llama-3-70b-instruct"
}Development
npm install
npm run build
npm test
OPENROUTER_API_KEY=sk-or-... node dist/index.jsLicense
MIT
