MCP JSON-RPC 2.0 Failover Router Integration Guide
Instead of wiring 33 distinct upstream MCP servers into an agent's context window, FuelRouter collapses all 5 capability pools and circuit breaker controls into 5 flat JSON-RPC 2.0 tools at POST https://fuelrouter.fastmesh.dev/mcp.
FuelRouter Flat MCP Tool Surface (POST /mcp)
| MCP Tool Name | Underlying REST Equivalent | Billing Behavior | Primary Agent Use Case |
|---|---|---|---|
| router_list_pools | GET /v1/router/pools | $0.00 (Free) | Inspect redacted pool health, circuit states, and remaining quotas |
| router_quote | POST /v1/router/quote | $0.00 (Free) | Dry-run cache hit prediction and ranked upstream plan |
| router_dispatch | POST /v1/router/dispatch | Outcome toll ($0 on 503/422) | Execute resilient cached or live failover across any of 5 pools |
| router_metrics | GET /v1/router/metrics | $0.00 (Free) | Audit cache hit ratio, saved upstream spend, and gross margin |
| router_circuit_reset | POST /v1/router/circuit/reset | $0.00 (Free) | Reset tripped upstream or pool circuit breakers to CLOSED |
Context-Window Efficiency for Multi-Agent Orchestrators
Registering dozens of per-vendor search, scrape, embedding, and enrichment tools bloats agent system prompts and confuses tool selection. FuelRouter exposes a minimal 5-tool schema over standard JSON-RPC 2.0 supporting initialize, tools/list, and tools/call.
Every tools/call response delivers both human-readable text inside content[0].text and machine-typed JSON inside structuredContent so agent harnesses can branch deterministically on cache_hit, charged_micros, and backoff_advice.
Zero-Config Budget & Safety Propagation Over MCP
Every security redline enforced on the REST surface—SSRF blocking, Anti-Fake-200 scanning, zero-secret vault proxying, max_cost_micros budget locks, and $0 exhaustion billing—applies identically to POST /mcp.
Agents can chain router_quote -> router_dispatch -> router_metrics within a single MCP session without managing vendor SDKs or secret rotation.
Complete JSON-RPC 2.0 MCP Handshake & Tool Invocation
curl -fsSL -X POST "https://fuelrouter.fastmesh.dev/mcp" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}'
curl -fsSL -X POST "https://fuelrouter.fastmesh.dev/mcp" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "router_quote",
"arguments": {
"pool_id": "ai_chat_json",
"tenant_id": "mcp_client_01",
"inputs": {"prompt": "Summarize SLA metrics as JSON."}
}
}
}'
MCP Client Integration Checklist
- Call initialize followed by tools/list on startup to cache the compact 5-tool schema.
- Always pass tenant_id and max_cost_micros in router_dispatch arguments to unlock 10% repeat pricing and spend caps.
- Parse structuredContent.charged_micros and structuredContent.receipt_sha256 for automated accounting.
- Point local development agents to http://127.0.0.1:9051/mcp and production fleets to https://fuelrouter.fastmesh.dev/mcp.
Frequently Asked Technical Questions
Which JSON-RPC 2.0 methods does POST /mcp implement?
FuelRouter implements initialize, tools/list, and tools/call over HTTP POST with application/json payloads.
Are router_list_pools, router_quote, and router_metrics free to call?
Yes. All discovery, dry-run quote, telemetry, and reset operations carry $0 charge.
Does POST /mcp expose any raw upstream API keys in tool schemas or outputs?
No. All MCP outputs pass through the same zero-secret redaction scrubber as REST routes.
Live Try-Now Console & Machine Discovery
Test failover routing, dry-run quotes, and circuit breaker metrics on the live gateway or connect via JSON-RPC 2.0 MCP.
Related FuelRouter Architecture Guides
- SSRF Protection & Cloud Metadata IP Blocking in API Gateways — SSRF protection cloud metadata IP blocking API gateway
- SQLite WAL Thread-Safe Quota Ledger & Concurrency Architecture — SQLite WAL thread-safe API quota ledger concurrency
- $0 Exhaustion Billing Guarantee & Redacted Backoff Traces — zero dollar API exhaustion billing and redacted failover trace