DynaRoute MCP Server
A Model Context Protocol (MCP) server that provides intelligent chat completions with automatic model routing and cost optimization through DynaRoute.
Features
- 🧠 Intelligent Model Routing: Automatically routes queries to the most cost-effective model while maintaining quality
- 💰 Cost Optimization: Save up to 70% compared to premium models like GPT-4o
- 📊 Detailed Analytics: Get comprehensive metrics including token usage, costs, and performance data
- 🔍 Routing Intelligence: See exactly which model was selected and why
- ⚡ Easy Integration: Works seamlessly with Claude Desktop, Cursor, and other MCP-compatible clients
Installation
Install via pip:
pip install dynaroute-mcp-server
Quick Start
-
Get your DynaRoute API key from DynaRoute
-
Configure Claude Desktop by adding this to your
claude_desktop_config.json:{ "mcpServers": { "dynaroute": { "command": "uv", "args": ["tool", "run", "dynaroute-mcp-server"], "env": { "DYNAROUTE_API_KEY": "YOUR_API_KEY" } } } }
-
Restart Claude Desktop and start using DynaRoute!
Usage
Once configured, you can use DynaRoute in Claude Desktop by:
- Asking for AI responses: "Use DynaRoute to explain quantum computing"
- Requesting cost analysis: "Get a cost-optimized response about machine learning"
- Explicit tool usage: "Use the DynaRoute tool to answer this question"
Example Output
When you use the DynaRoute tool, you'll get:
🤖 DynaRoute Response:
[Your AI response content here]
📊 PERFORMANCE METRICS:
• Model Used: gcp-gemini-2.0-flash-thinking
• Response Time: 2.5 seconds
• Request ID: chatcmpl-xyz123
🔢 TOKEN USAGE:
• Input Tokens: 25
• Output Tokens: 150
• Total Tokens: 175
💰 COST BREAKDOWN:
• Input Cost: $0.000012
• Output Cost: $0.000045
• Total Cost: $0.000057
📈 COST SAVINGS vs GPT-4o:
• GPT-4o Equivalent Cost: $0.000175
• Your Actual Cost: $0.000057
• Money Saved: $0.000118
• Savings Percentage: 67.4%
✅ EFFICIENCY SUMMARY: DynaRoute saved you 67.4% compared to GPT-4o while maintaining quality!
Configuration
Environment Variables
DYNAROUTE_API_KEY: Your DynaRoute API key (required)
Tool Parameters
The dynaroute_chat tool accepts:
messages: Array of conversation messages (required)level_override: Override complexity level 1-5 (optional)
Claude Desktop Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
{
"mcpServers": {
"dynaroute": {
"command": "uv",
"args": ["tool", "run", "dynaroute-mcp-server"],
"env": {
"DYNAROUTE_API_KEY": "YOUR_API_KEY"
}
}
}
}
Other MCP Clients
Cursor IDE
Add to your Cursor settings:
{
"mcp": {
"servers": {
"dynaroute": {
"command": "uv",
"args": ["tool", "run", "dynaroute-mcp-server"],
"env": {
"DYNAROUTE_API_KEY": "YOUR_API_KEY"
}
}
}
}
}
Custom Usage
You can also import and use the server programmatically:
import asyncio
from dynaroute_mcp import DynaRouteMCPServer
async def main():
server = DynaRouteMCPServer(api_key="your_api_key")
await server.run()
asyncio.run(main())
Requirements
- Python 3.8+
- DynaRoute API key
- MCP-compatible client (Claude Desktop, Cursor, etc.)
Dependencies
mcp: Model Context Protocol implementationdynaroute-client: Official DynaRoute Python client
License
MIT License
Support
- 📧 Email: abraar237@gmail.com
- 🐛 Issues: GitHub Issues
- 📖 Documentation: GitHub README
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Changelog
1.0.0
- Initial release
- DynaRoute integration with MCP
- Cost optimization and analytics
- Claude Desktop support
Metadata
Release files for dynaroute-mcp-server 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| dynaroute_mcp_server-1.0.2.tar.gz | 7.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dynaroute_mcp_server-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.7 kB
Release files / dynaroute_mcp_server-1.0.2.tar.gz
| Download URL | dynaroute_mcp_server-1.0.2.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73a328917470f6edab05f9371f016d174523ea1b887ba189f2b07144204da678
|
|
BLAKE2b-256 checksum How to use checksums |
a656a9d949e88a6b81b25b47d07dde137ba7b2d25b897625c3543e74fe920f87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.0
|
Release files / dynaroute_mcp_server-1.0.2-py3-none-any.whl
| Download URL | dynaroute_mcp_server-1.0.2-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bfb9783e89d3aef913ad06fb3a04c657fb8cccd00ed87fdf91b50f193ff2d279
|
|
BLAKE2b-256 checksum How to use checksums |
ee364b3186374a21fba35f7abcfa2182ab51a6bac87aa881e3d53b96abd406ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.0
|
Security for dynaroute-mcp-server 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.