HydraMCP
HydraMCP is an MCP server that connects Claude Code to multiple AI models (GPT, Gemini, Claude, local Ollama models) for querying, comparing, and synthesizing responses.
list_models: Discover all available models across providers (OpenAI, Google, Anthropic, Ollama, subscription CLIs).ask_model: Query any single model with configurable parameters (temperature, max tokens, system prompt, response format).compare_models: Send the same prompt to 2–5 models in parallel and get side-by-side comparisons with latency and token metrics.consensus: Poll 3–7 models and aggregate responses using voting strategies (majority/supermajority/unanimous), with an optional LLM judge.synthesize: Query 2–5 models and combine their best ideas into a single unified answer via an optional synthesizer model.
Underlying features include circuit breakers for reliability, response caching, metrics tracking, and response distillation for efficiency.
Integrates Google's model ecosystem, allowing agents to query and compare various Google-hosted models alongside other providers.
Allows agents to query Gemini models via existing subscriptions for parallel comparisons and multi-model consensus workflows.
Leverages local models via Ollama for fast, quota-free operations like judging consensus between cloud providers and synthesizing multi-model outputs.
Connects to OpenAI models using existing subscriptions to enable parallel querying, model comparisons, and response synthesis.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@HydraMCP compare gpt-4 and claude on the best way to optimize this SQL query"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
An MCP server that lets Claude Code query any LLM — compare, vote, and synthesize across GPT, Gemini, Claude, and local models from one terminal.
Quick Start
npx hydramcp setupThat's it. The wizard walks you through everything — API keys, subscriptions, local models. At the end it gives you the one-liner to add to Claude Code.
Or if you already have API keys:
claude mcp add hydramcp -e OPENAI_API_KEY=sk-... -- npx hydramcpRelated MCP server: consensus-mcp
What It Looks Like
Four models, four ecosystems, one prompt. Real output from a live session:
> compare gpt-5-codex, gemini-3, claude-sonnet, and local qwen on this function review
## Model Comparison (4 models, 11637ms total)
| Model | Latency | Tokens |
|----------------------------|-----------------|--------|
| gpt-5-codex | 1630ms fastest | 194 |
| gemini-3-pro-preview | 11636ms | 1235 |
| claude-sonnet-4-5-20250929 | 3010ms | 202 |
| ollama/qwen2.5-coder:14b | 8407ms | 187 |All four independently found the same async bug. Then each one caught something different the others missed.
And this is consensus with a local judge:
> get consensus from gpt-5, gemini-3, and claude-sonnet. use local qwen as judge.
## Consensus: REACHED
Strategy: majority (needed 2/3)
Agreement: 3/3 models (100%)
Judge: ollama/qwen2.5-coder:14b (686ms)Three cloud models polled, local model judging them. 686ms to evaluate agreement.
Tools
Tool | What It Does |
list_models | See what's available across all providers |
ask_model | Query any model, optional response distillation |
compare_models | Same prompt to 2-5 models in parallel |
consensus | Poll 3-7 models, LLM-as-judge evaluates agreement |
synthesize | Combine best ideas from multiple models into one answer |
analyze_file | Offload file analysis to a worker model |
smart_read | Extract specific code sections without reading the whole file |
session_recap | Restore context from previous Claude Code sessions |
From inside Claude Code, just say things like:
"ask gpt-5 to review this function"
"compare gemini and claude on this approach"
"get consensus from 3 models on whether this is thread safe"
"synthesize responses from all models on how to design this API"
How It Works
Claude Code
|
HydraMCP (MCP Server)
|
SmartProvider (circuit breaker, cache, metrics)
|
MultiProvider (routes to the right backend)
|
|-- OpenAI -> api.openai.com (API key)
|-- Google -> Gemini API (API key)
|-- Anthropic -> api.anthropic.com (API key)
|-- Sub -> CLI tools (Gemini CLI, Claude Code, Codex CLI)
|-- Ollama -> local models (your hardware)Three Ways to Connect Models
API Keys (fastest setup)
Set environment variables. HydraMCP auto-detects them.
Variable | Provider |
| OpenAI (GPT-4o, GPT-5, o3, etc.) |
| Google Gemini (2.5 Flash, Pro, etc.) |
| Anthropic Claude (Opus, Sonnet, Haiku) |
Subscriptions (use your monthly plan)
Already paying for ChatGPT Plus, Claude Pro, or Gemini Advanced? HydraMCP wraps the CLI tools those subscriptions include. No API billing.
npx hydramcp setup # auto-installs CLIs and runs authThe setup wizard detects which CLIs you have, installs missing ones, and walks you through authentication. Each CLI authenticates via browser once — then it's stored forever.
Subscription | CLI Tool | What You Get |
Gemini Advanced |
| Gemini 2.5 Flash, Pro, etc. |
Claude Pro/Max |
| Claude Opus, Sonnet, Haiku |
ChatGPT Plus/Pro |
| GPT-5, o3, Codex models |
Local Models
Install Ollama, pull a model, done. Auto-detected.
ollama pull qwen2.5-coder:14bMix and Match
All three methods stack. Use API keys for some providers, subscriptions for others, and Ollama for local. They all show up in list_models together.
Route explicitly with prefixes:
openai/gpt-5— force OpenAI APIgoogle/gemini-2.5-flash— force Google APIsub/gemini-2.5-flash— force subscription CLIollama/qwen2.5-coder:14b— force localgpt-5— auto-detect (tries each provider)
Setup Details
Option A: npx (recommended)
npx hydramcp setup # interactive wizard
claude mcp add hydramcp -- npx hydramcp # register with Claude CodeConfig is saved to ~/.hydramcp/.env and persists across npx runs.
Option B: Clone
git clone https://github.com/Pickle-Pixel/HydraMCP.git
cd HydraMCP
npm install && npm run build
claude mcp add hydramcp -- node /path/to/HydraMCP/dist/index.jsVerify
Restart Claude Code and say "list models". You should see everything you configured.
Architecture
HydraMCP wraps all providers in a SmartProvider layer that adds:
Circuit breaker — per-model failure tracking. After 3 failures, the model is disabled for 60s and auto-recovers.
Response cache — SHA-256 keyed, 15-minute TTL. Identical queries are served instantly.
Metrics — per-model query counts, latency, token usage, cache hit rates.
Response distillation — set
max_response_tokenson any query and a cheap model compresses the response while preserving code, errors, and specifics.
Contributing
Want to add a provider? The interface is three methods:
interface Provider {
healthCheck(): Promise<boolean>;
listModels(): Promise<ModelInfo[]>;
query(model: string, prompt: string, options?: QueryOptions): Promise<QueryResponse>;
}See src/providers/ollama.ts for a working example. Implement it, register in src/index.ts, done.
Providers we'd love to see: LM Studio, OpenRouter, Groq, Together AI, or anything that speaks HTTP.
License
MIT
Available Tools
8 toolsanalyze_fileA
Offload file analysis to a worker model. The file is read server-side — it never enters your context window. You send a file path and a question, and get back only the analysis.
OUTPUT: Markdown with the model's analysis of the file, including file metadata (path, lines, chars), latency, and token usage. If max_response_tokens is set and compression occurred, includes distillation metadata (original tokens, compressed tokens, compressor model, compressor latency).
WHEN TO USE: When you need to analyze, review, or search a file but want to avoid reading it yourself. Especially valuable for large files (1000+ lines) where reading would consume significant context. The file is sent to a large-context model (Gemini 1M) that can process the entire file at once.
FAILURE MODES:
"File not found" → The path is wrong. Retry with the correct absolute path.
"Binary file detected" → Only text files are supported. Do not retry with this file.
"File too large" → The file exceeds 800K chars. Try analyzing a specific section or ask the user to split the file.
"No models available" → CLIProxyAPI or Ollama is not running. Tell the user to start their model provider.
"Model query failed" → Try a different model or check provider status with list_models.
Inputs: file_path (required), prompt (required), model, max_response_tokens, +3 more.
ask_modelA
Query any AI model with a prompt. Returns the model's response with metadata.
OUTPUT: Markdown with the model's response, latency, and token usage. If max_response_tokens is set and compression occurred, includes distillation metadata (original tokens, compressed tokens, compressor model, compressor latency). Shows "Saved: X tokens (Y% smaller)" when compression is active. Shows "(cached)" when response is served from cache.
WHEN TO USE: When you need another model's perspective, analysis, or capabilities. Set max_response_tokens to control how much of your context window this response consumes — the response will be distilled by a fast model to fit the budget while preserving code, file paths, errors, and actionable details. Set include_raw=true to see both compressed and original responses for quality verification.
FAILURE MODES:
"Model query failed (4xx/5xx)" → The model or provider is unavailable. Try a different model or check that CLIProxyAPI/Ollama is running.
"circuit breaker open" → The model failed too many times recently. Try a different model or wait for automatic recovery.
Compression silently skipped → If the compressor model is unavailable or the response already fits the budget, the raw response is returned unchanged. This is not an error.
Inputs: model (required), prompt (required), system_prompt, temperature, +4 more.
compare_modelsA
Query 2-5 models in parallel with the same prompt. Returns side-by-side comparison with latency and token metrics.
Inputs: models (required), prompt (required), system_prompt, format, +2 more.
consensusB
Query 3-7 models and aggregate responses using voting strategy (majority/supermajority/unanimous). Returns consensus answer with confidence score.
Inputs: models (required), prompt (required), strategy, judge_model, +3 more.
list_modelsA
List all available models across all providers. Run this first to see what you can query.
Inputs: no named parameters.
session_recapA
Read previous Claude Code sessions from disk and generate a smart-sized recap using a large-context model. Claude never sees the raw session data — only the distilled summary.
OUTPUT: Returns markdown starting with "## Session Recap" containing sections: Project State, What Was Built, Key Decisions, Errors Resolved, Unfinished/In Progress, File Map. Empty sections are omitted. Output size is auto-calculated (1K-30K tokens) based on session density.
WHEN TO USE: At the start of a new session when the user asks to restore context, recall previous work, or continue where they left off.
FAILURE MODES:
"No recent project detected" + list of available projects → Retry with an explicit project path from the list.
"Project directory not found" + available projects → The project path was misspelled or encoded wrong. Retry with a path from the available list.
"No session files found" → The project directory exists but has no sessions. Try a different project.
"No models available" → CLIProxyAPI or Ollama is not running. Tell the user to start their model provider.
"Session Recap Failed" with error details → Both summarization passes failed. Retry with fewer sessions (sessions=1) or a different model.
"Triage Only" heading → Partial success. The triage pass worked but the full recap failed. The output still contains useful structured data. Do not retry.
Inputs: sessions, project, focus, model, +1 more.
smart_readA
Surgical code extraction from files. Returns ONLY relevant code sections with line numbers — not analysis.
OUTPUT: Markdown with extracted code sections (verbatim, with line numbers), minimal annotations, file metadata, latency, token usage. Shows "Context saved" metric. Unlike analyze_file which returns prose analysis, smart_read returns actual code you can act on directly.
WHEN TO USE: When you need to read a file but only care about specific sections. Use instead of the Read tool when you have a specific intent like "find the auth logic", "show error handling", "extract the database schema". Especially valuable for large files (1000+ lines) where reading the whole file wastes context tokens. For general questions about a file, use analyze_file instead.
FAILURE MODES:
"File not found" → The path is wrong. Retry with the correct absolute path.
"Binary file detected" → Only text files are supported. Do not retry with this file.
"File too large" → The file exceeds 800K chars. Try a specific section.
"No models available" → CLIProxyAPI or Ollama is not running. Tell the user to start their model provider.
"No relevant sections found" → Try a broader query, or use analyze_file for general analysis.
"Model query failed" → Try a different model or check provider status with list_models.
Inputs: file_path (required), query (required), model, max_response_tokens, +3 more.
synthesizeB
Query 2-5 models in parallel, then combine their best ideas into one answer. Returns a synthesized response that's better than any single model.
Inputs: models (required), prompt (required), synthesizer_model, system_prompt, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool serves a clearly distinct purpose: analyze_file for file analysis, smart_read for code extraction, ask_model for single model queries, compare_models for side-by-side comparison, consensus for voting, synthesize for merging responses, list_models for discovery, and session_recap for session history. No two tools overlap in function.
Most tools use verb_noun pattern (analyze_file, ask_model, compare_models, list_models, session_recap, smart_read) but 'consensus' and 'synthesize' are single verbs without nouns, breaking the pattern. This minor inconsistency does not hinder readability.
With 8 tools, the server covers the core capabilities of model interaction, file analysis, and session retrieval without being overly broad. Each tool seems necessary and the count feels well-scoped for the stated domain.
The tool surface covers the main workflows: file analysis (analyze_file, smart_read), model queries (ask_model, compare_models, consensus, synthesize), and context restoration (session_recap). Missing are tools for managing model configurations, provider settings, or cache control, which would add polish but are not essential.
Maintenance
Related MCP Connectors
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server that enables multi-provider AI collaboration using models like DeepSeek, OpenAI, and Anthropic through strategies such as parallel execution and consensus building. It provides specialized tools for side-by-side content comparison, quality review, and iterative refinement across different AI providers.4MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that enables multi-model debate and consensus building through a single tool. It orchestrates multiple AI models from various providers to debate topics and reach validated conclusions with real-time progress tracking.30 npm3MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that queries a panel of LLMs from different providers via OpenRouter and returns their answers side by side, optionally synthesizing them to highlight disagreements.5 npm1MIT
- FlicenseAqualityDmaintenanceAn MCP server that exposes tools for sub-agent style reasoning across multiple LLM providers, enabling delegation of prompts to various models and running critique loops, debates, red-teaming, and answer ranking.6-