crossroute-mcp
Sends prompts to configured OpenAI-compatible chat completions or responses endpoints and returns model completions, with cross-route failover.
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., "@crossroute-mcp list my configured model routes"
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.
crossroute-mcp
stdio MCP server with two tools:
list_routeslists configured upstream routes. It does not reveal API keys.completesends a prompt to one route and, when configured, fails over to another route that serves the same model.
Routes speak either an OpenAI-compatible API (chat_completions or responses) or an Anthropic-compatible Messages API. Secrets stay in environment variables named by the config file.
Requirements
Python 3.11 or newer.
Related MCP server: freellmpool
Install
From a checkout of this repository:
pip install -e .With uv:
uv syncThe console script is crossroute-mcp.
Configure
Copy the example config and edit the placeholders:
cp config.example.json config.jsonExport the API keys named in the config, or copy
.env.exampleto.envand fill it in..envandconfig.jsonare gitignored.
export CROSSROUTE_CONFIG="$PWD/config.json"
export PROVIDER_A_API_KEY="replace-me"
export PROVIDER_B_API_KEY="replace-me"config.example.json uses generic route names (provider-a, provider-b) and hostnames under example. Replace the base URLs and model ids with the gateways you actually use. Do not commit real keys.
Each route names its key with api_key_env. Optional api_key_env_fallbacks are extra environment variable names; empty ones are skipped. Set "enabled": false on a route object to leave it in the file without loading it. reasoning_budget_map supplies token budgets for Anthropic budget thinking. The example values are placeholders.
Environment variables:
Variable | Purpose |
| Path to the JSON config. When unset, |
| HTTP timeout in seconds. Default: |
| Key values. The config names the variable; this repo never stores the value. |
A minimal MCP client entry (placeholders only):
{
"mcpServers": {
"crossroute": {
"command": "crossroute-mcp",
"env": {
"CROSSROUTE_CONFIG": "/absolute/path/to/config.json",
"PROVIDER_A_API_KEY": "replace-me",
"PROVIDER_B_API_KEY": "replace-me"
}
}
}
}Run
crossroute-mcpThe process speaks MCP on stdin and stdout. Startup logs go to stderr and include the config path, route count, and safety mode. Prompt and response bodies are not logged.
Tools
list_routes returns route names, protocols, default models, reasoning levels, and the cross-route failover chains. Base URLs and key values are omitted.
complete arguments:
Argument | Required | Notes |
| yes | Route name from |
| yes | User text. Scanned locally before any network call. |
| no | Optional system text. Scanned the same way. |
| no | Overrides the route default. This is also the model used for cross-route matching. |
| no |
|
| no | Falls back to the route default, then |
| no | Sent only when you set it. Some reasoning models reject it. |
| no | Default |
If the result has suggest_local_fallback: true, the caller can finish with its own model. If safety_blocked is true, do not retry the same prompt anywhere.
Cross-route fallbacks
cross_route_fallbacks in the config is a list of failover chains. Each chain has:
id: a short name for the chain.match_models: model ids that select this chain.route_chain: ordered hops, each with arouteand amodel.
The intent model is the model argument when you pass one. Otherwise it is the entry route's default_model. When cross_route is true (the default) and that intent model matches a chain, a failure on the entry route is retried on the later hops in order. Hops that name an unknown or disabled route are skipped.
Same-route model_fallbacks run only on the entry route. A later hop uses the model named on that hop and does not expand that route's model_fallbacks.
Set cross_route to false to stay on the named route. The example chain example-model-failover tries provider-a first and then provider-b, both with example-model.
Safety
Before a request is sent, complete scans prompt and system for email addresses, payment card numbers, API keys and private keys, contract numbers, long pasted contracts or policy text, and unpublished financial figures.
Mode | Behavior |
| Default. Scan |
| Skip the scan. Set |
Unknown mode values fail closed and are treated as block. A blocked call returns safety_blocked: true and suggest_local_fallback: false. The error names the category only. Error text is English and does not include the matched substring.
Tests
python -m unittest discover -s tests -vLicense
MIT. See LICENSE.
The copyright line is Copyright (c) 2026 CheeInsight.
Available Tools
2 toolscompleteA
Call a named upstream route to generate text. Params: route (required), prompt (required), optional system, model, reasoning_level (none|minimal|low|medium|high|xhigh|max), max_tokens, temperature (only sent if provided; some reasoning models reject it). Locally blocks prompts containing PII, secrets, contract bodies, or unpublished financial figures before any network call. Returns JSON: {ok, route, protocol, model, reasoning_level, text, usage?, error?, safety_blocked?, suggest_local_fallback?, attempted_routes?, cross_route_used?}. If ok=false and suggest_local_fallback=true (timeout, overload, empty, or upstream error), the caller can finish with its own model. safety_blocked means do NOT fall back with the same sensitive prompt. Optional cross_route (default true): when the intent model matches config cross_route_fallbacks, failed entry route retries other sites with the SAME model; set false to pin to one route.
Inputs: route (required), prompt (required), model, system, +4 more. Returns: result
list_routesA
List configured upstream routes (name, protocol, defaults). Does not expose API keys or env values. Includes safety mode summary.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools serve clearly separate purposes: list_routes is a read-only discovery call, while complete performs the actual generation against a named route. The only friction is the bare name 'complete', which alone would be vague, but the description and the paired discovery tool make selection unambiguous.
Both names are snake_case lowercase verbs, so the surface is readable. However, list_routes follows a verb_noun pattern while complete is a bare verb with no object, so the two names do not form a predictable pair (e.g., list_routes / call_route would be more consistent).
Two tools is thin for a routing/gateway server, but the scope is deliberately narrow: discover routes, then invoke one. It sits at the borderline where the surface is defensible yet feels minimal rather than well-scoped.
The core lifecycle (discover routes, call a route) is covered, and the rich response envelope handles failure paths. Notable gaps remain: no per-route detail/health or availability check, no model/route status inspection, and no way to validate config despite the tool advertising fallback and safety-mode behavior.
Related MCP Connectors
AI model routing on your own vendor keys: pick the best model per prompt, or route and run it.
OpenAI-compatible BYOK LLM gateway: per-task routing, shadow evaluation, promotion gates.
AI routing, memory, guardrails, and governance. Routes across Claude, GPT, Gemini.
One API key for every AI model, routed to the cheapest provider. OpenAI-compatible.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables routing of ML tasks like chat, sentiment analysis, recommendations, and summarization to appropriate models through a dynamic YAML-based registry. Provides async FastAPI endpoints with streaming support, retry logic, and pluggable model architecture for scalable ML inference.4-
- FlicenseNot gradedqualityAmaintenancePools hundreds of cataloged free-tier, keyless, and trial LLM chat routes behind a single OpenAI-compatible endpoint, so agents can send chat completions with automatic failover, provider health checks, and usage tracking. It can start answering without any API keys whenever an enabled keyless route is available.-
- FlicenseNot gradedqualityAmaintenanceEnables coding agents and OpenAI- or Anthropic-compatible clients to send chat requests through a single local pooled endpoint that spans free provider tiers, with keyless startup, automatic failover, model discovery, and capacity/health inspection tools.-
- FlicenseNot gradedqualityAmaintenanceExposes an OpenAI-compatible gateway that pools 178 enabled free-tier and keyless chat routes across 23 providers, enabling agent clients to list models, check capacity and provider health, and route or fail over requests. It can answer without credentials when a keyless route is available.-