llm-router-mcp
OfficialAllows routing AI chat requests to OpenAI's GPT models via the LLM Router API, with automatic fallback, budget caps, and model-tier routing.
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., "@llm-router-mcpexplain quantum computing simply"
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.
llm-router-mcp
MCP server for the LLM Router API — route AI chat requests to the best available provider (Anthropic Claude, OpenAI GPT, Groq, Mistral, Together AI) with automatic fallback, budget caps, and model-tier routing.
Why use LLM Router?
One API key instead of managing Anthropic + OpenAI + Groq + Mistral keys separately
Automatic fallback — if your primary provider is down, the next one kicks in
Model tiers — say "fast" or "smart" instead of hard-coding a model name
Budget caps — set
max_cost_usdso agents never overspendFallback chains — control exactly which providers to try and in what order
Related MCP server: Multi-LLM Gateway MCP
Installation
pip install llm-router-mcp
# or
uvx llm-router-mcpConfiguration
Add to your Claude Desktop / agent MCP config:
{
"mcpServers": {
"llm-router": {
"command": "uvx",
"args": ["llm-router-mcp"],
"env": {
"LLM_ROUTER_API_KEY": "your-api-key-here"
}
}
}
}Get an API key at llm-router-api.rebaselabs.online.
Tools
Tool | Description |
| Route a chat request to the best provider |
| Simplified chat with system prompt + user message |
| Estimate cost across providers before sending |
| List providers and their availability |
| Full model catalog with pricing |
| Your API usage statistics |
Examples
Simple chat
{
"tool": "chat",
"messages": [{"role": "user", "content": "Summarize this document: ..."}],
"model": "fast",
"max_cost_usd": 0.002
}System prompt + task
{
"tool": "chat_with_system",
"system_prompt": "You are a JSON extractor. Return only valid JSON arrays.",
"user_message": "Extract all emails from: Contact john@acme.com or help@corp.io"
}Explicit fallback chain
{
"tool": "chat",
"messages": [{"role": "user", "content": "Write a Python quicksort"}],
"model": "code",
"fallback_chain": ["together", "anthropic", "openai"]
}Model Tiers
Tier | Description | Best for |
| Lowest latency (Groq, Mistral) | Real-time tasks, high throughput |
| Highest quality (Claude, GPT-4) | Complex reasoning, writing |
| Coding-optimized (Deepseek, Claude) | Code generation, review |
| Lowest cost per token | High-volume, simple tasks |
| Maximum context window | Long documents, many-shot prompts |
Environment Variables
Variable | Default | Description |
| (required) | Your API key |
|
| API base URL (for self-hosting) |
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables AI applications to access 20+ model providers (including OpenAI, Anthropic, Google) through a unified interface for text and image generation.230MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that functions as an intelligent gateway for multiple LLM backends including OpenAI, Claude, and Ollama. It supports automatic provider fallback, streaming responses via Server-Sent Events, and real-time monitoring for robust AI integration.MIT
- AlicenseNot gradedqualityBmaintenanceMCP server that enables agents to dynamically switch between multiple AI models (OpenAI, Anthropic, Google, etc.) with unified protocol-driven configuration and capability discovery.Apache 2.0
- AlicenseAqualityDmaintenanceMCP server that completes prompts with automatic provider fallback across OpenAI, Anthropic Claude, and Google Gemini. It is rate-limit aware, retries on transient failures, and provides a transparent attempt log.23 npmMIT