mcp-model-router
Click on "Install 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., "@mcp-model-routerExplain the trade-offs between SQL and NoSQL databases"
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.
MCP Model Router
An MCP server that routes each prompt to whichever Claude model best fits it.
The routing decision itself is 100% local — plain Python, no LLM call. Only one model call happens per request: the one that actually answers it. That matters, because the obvious way to build this (ask a model to classify the prompt first) doubles the number of calls and charges you for the classifier on every single request.
The tool
The server exposes one tool over MCP:
smart_prompt(prompt: str) -> strAny MCP-capable client can discover and call it. The response comes back with the routing decision attached, so you can always audit the choice:
[routed to opus (claude-opus-5) — matched opus signals (score=2)]
<the answer>Related MCP server: claude-mcp-server-gateway
How routing works
choose_model(prompt) in router.py returns (tier, reason). In order:
Force tags. A prompt starting with
!opus,!sonnet,!haikuor!fablebypasses routing entirely.Signal scoring. Four buckets are scored against the prompt:
code patterns (fenced blocks,
def, stack traces,.py/.js/.tsx, regex, unit test) → coding tierreasoning keywords (why, analyze, trade-off, architecture, root cause, pros and cons) → deepest tier
creative keywords (write a story, poem, screenplay, lyrics) → narrative tier
extraction keywords (extract, classify, translate, one sentence, tl;dr) → fastest tier
Complexity escalation. Question marks, bullet lines and numbered list items are summed; three or more structural signals adds a point to the deep-reasoning tier.
Length fallback. Only if nothing scored: ≤12 words → fastest tier, ≥150 words → deepest tier, otherwise the balanced generalist.
Keyword signals deliberately outrank the length heuristic. Without that precedence, a short prompt like "write a short story" would let the word-count bonus outvote the creative-keyword match it should lose to.
Tuning it
Every decision is appended to logs/routing_log.csv:
timestamp | tier | reason | prompt_excerpt |
The keyword lists in router.py are a starting point, not a final answer.
Watch the log fill up and edit them directly. After any change, re-run the
offline smoke test — it asserts expected routing on seven representative
prompts and costs nothing, because it never touches the API:
python test_router.pySetup
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -r requirements.txt
cp .env.example .env # then put your real key in it.env is gitignored — the key never leaves your machine.
Register the server with your MCP client via .mcp.json:
{
"mcpServers": {
"model-router": {
"command": "<path>\\.venv\\Scripts\\python.exe",
"args": ["<path>\\server.py"]
}
}
}Adjust both paths to wherever you cloned this.
Files
File | Role |
| MCP server, tool definition, model execution, CSV logging |
| The classifier: model registry, force tags, signal scoring, length fallback |
| Offline smoke test — no API calls, no cost |
| Client registration |
Requirements
mcp · anthropic · python-dotenv
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityFmaintenanceEnables AI assistants to intelligently select and switch between different AI models (OpenAI, Anthropic, etc.) within the same conversation based on task requirements. Provides a unified interface for accessing multiple AI providers through a single MCP tool.110MIT
- Alicense-qualityFmaintenanceA lightweight Claude MCP gateway that dynamically loads tools only when needed, cutting MCP token clutter by up to 95% and keeping your context lean, fast, and focused.6MIT
- Alicense-qualityDmaintenanceAn MCP-based tool orchestrator that exposes a single execute_task tool to Claude while internally managing 100+ tools through hierarchical navigation with a cheaper LLM, preventing context overflow from loading all tool definitions.MIT

DeepMyst MCP Serverofficial
Alicense-qualityDmaintenanceEnables intelligent LLM optimization and routing for Claude Desktop and HTTP clients, reducing token usage and automatically selecting the best model for each query.4MIT
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Decision-only prompt routing and firewall checks for local/cloud routing, PII and jailbreak risk.
A paid remote MCP for Pydantic AI structured output, built to return verdicts, receipts, usage logs,
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/swarnim-git3/mcp-model-router'
If you have feedback or need assistance with the MCP directory API, please join our Discord server