Skip to main content

Agent Empowerment (MCP)

Give your autonomous agents the power to control their own infrastructure. With the Model Context Protocol (MCP), agents can self-optimize, check costs, and create routers on the fly.

Cascade / WindsurfClineAny MCP-Compatible Agent
Why Give Agents Infrastructure Access?

The ModelPilot MCP Server enables AI coding assistants and autonomous agents to integrate ModelPilot directly into their workflow. Instead of relying on static configurations, your agent can:

Self-Migration
Agents can refactor legacy OpenAI code to ModelPilot automatically
Dynamic Routing
Agents can spin up specialized routers for specific tasks
Self-Testing
Agents verify router performance before deploying code
Cost Awareness
Agents check budget usage and optimize their own consumption

Configuration

Configure the MCP server in your AI assistant's settings:

Cascade / Windsurf
Add to your MCP settings file
json
{
  "mcpServers": {
    "modelpilot": {
      "command": "npm",
      "args": ["-y", "@modelpilot/mcp-server"],
      "env": {
        "MODELPILOT_API_KEY": "mp-your-api-key-here"
      }
    }
  }
}
Cline
Add to ~/.cline/mcp.json
json
{
  "mcpServers": {
    "modelpilot": {
      "command": "npx",
      "args": ["-y", "@modelpilot/mcp-server"],
      "env": {
        "MODELPILOT_API_KEY": "mp-your-api-key-here"
      }
    }
  }
}

Available Tools

The MCP server provides these tools to your AI assistant:

migrate_code
Convert OpenAI or Anthropic SDK code to ModelPilot

Shows converted code and estimated cost savings.

Example:
"Migrate this OpenAI code to ModelPilot"
create_router
Create a new AI model router with guided configuration

Your assistant will guide you through selecting models and optimization preferences.

Example:
"Create a cost-optimized router for my chatbot"
test_request
Test a router with a real request

Returns response, cost breakdown, latency, and which model was used.

Example:
"Test my router 'chatbot-123' with: Hello, how are you?"
get_usage_summary
View usage statistics and costs

Track spending for the last 24h, 7d, or 30d with detailed breakdowns.

Example:
"Show my usage for the last 7 days"
optimize_router
Get cost-saving recommendations

Receive actionable tips to reduce costs while maintaining quality.

Example:
"How can I optimize my chatbot router?"
compare_models
Compare models side-by-side

See detailed comparisons on cost, quality, and speed metrics.

Example:
"Compare GPT-5 vs Claude 4.5 Sonnet vs Gemini 3 Pro Pro"
get_balance
Check current credit balance and subscription status

View your balance, subscription tier, and monthly spending.

Example:
"What's my balance?"
generate_integration_code
Generate production-ready integration code

Get complete code in Python, JavaScript, or TypeScript with error handling and retries.

Example:
"Generate Python code for my router with error handling"

Built-in Documentation

The MCP server includes comprehensive documentation resources accessible through your AI assistant:

  • Quickstart Guide
  • OpenAI Migration Guide
  • Anthropic Migration Guide
  • Router Configuration Best Practices
  • Python SDK Reference
  • JavaScript SDK Reference
  • Routing Strategies Guide
  • Cost Optimization Strategies
  • Production Chatbot Example
  • Pricing Guide

Example Workflow

1
Migrate existing code
"Migrate this OpenAI code to ModelPilot and show me the cost savings"
python
# Your existing OpenAI code
from openai import OpenAI
client = OpenAI()

response = client.chat.completions.create(
  model="gpt-4",
  messages=[{"role": "user", "content": "Hello!"}]
)
2
Create optimized router
"Create a cost-optimized router with GPT-5-mini and Claude 4.5 Sonnet"
3
Test the router
"Test my new router with this prompt and show me the cost breakdown"
4
Monitor and optimize
"Show my usage for the last 7 days and suggest optimizations"