Infinite LLM Auto-Fallback Router
Routes chat completion requests to OpenAI-compatible /v1/chat/completions endpoints as part of the provider pool, with automatic failover and Anthropic-to-OpenAI payload conversion.
⚡ Infinite LLM Auto-Fallback Router — Stdio MCP Server, SSE Failover Proxy & 9Router Patch Kit (v2.2.0)
Zero-dependency Model Context Protocol (MCP) Server and multi-provider SSE auto-fallback proxy. Chain OpenAI, Anthropic (/v1/messages), Gemini, Groq, and OpenRouter into one uninterrupted local endpoint and expose failover diagnostics directly as MCP tools.
Authored by Scientist HM Shihabuddin Jashory (Shihab) (ORCID: 0009-0003-4163-0092) · Research & Evaluation Ecosystem with MD Rafiul Islam Shubho (Researcher, AI Evaluator & RLHF Specialist) — Vision Flow Group (TechBehemoths #101215) · Research Hub · Tools Hub · Studio
🔌 Model Context Protocol (MCP) Server
infinite-llm-fallback-router runs natively as a JSON-RPC 2.0 stdio MCP server (python3 -u llm_fallback_router.py --mcp or via Dockerfile) with zero external runtime dependencies (100% Python 3.9+ standard library).
Exposed MCP Tools
MCP Tool | Arguments | Purpose |
|
| Inspects configured LLM failover providers, credential readiness, cooldown timers, and failover counters. |
|
| Converts Anthropic |
|
| Routes a chat completion request across the configured provider pool with automatic circuit-breaker failover on HTTP 429/402/5xx. |
|
| Returns live circuit-breaker readiness diagnostics and provider pool health counters. |
MCP Client Configuration (claude_desktop_config.json, Cursor, Kiro, Windsurf)
{
"mcpServers": {
"infinite-llm-fallback-router": {
"command": "python3",
"args": ["-u", "/path/to/llm_fallback_router.py", "--mcp"]
}
}
}Run the MCP Server via Docker (Stdio)
docker build -t infinite-llm-fallback-router .
docker run -i --rm -e OPENAI_API_KEY="$OPENAI_API_KEY" infinite-llm-fallback-routerRelated MCP server: MCP-AI-Gateway
⚡ 1. Install via AI Agent (Claude Code, Antigravity, Cursor, Codex)
Paste this single prompt into your AI coding agent:
Prompt:
Clone https://github.com/jashory/infinite-llm-fallback-router and run "python install.py" to install the MCP server, local LLM fallback router, and Agent Skill.
💻 2. Install via CLI (Terminal / Skills CLI / pip)
# Option A: Agent Skills CLI
npx skills add jashory/infinite-llm-fallback-router
# Option B: Direct Git Clone + 1-Command Installer
git clone https://github.com/jashory/infinite-llm-fallback-router.git
cd infinite-llm-fallback-router && python install.py
# Option C: Global CLI Tool & MCP Server via pip / uv
pip install infinite-llm-fallback-router
# Or directly from GitHub:
pip install git+https://github.com/jashory/infinite-llm-fallback-router.git
# Run HTTP/SSE auto-fallback proxy:
llm-fallback-router --port 20128
# Run deterministic loopback failover & bridge self-test:
llm-fallback-router --self-test
# Start the stdio JSON-RPC 2.0 MCP server:
llm-fallback-router --mcp🔥 Features
Stdio JSON-RPC 2.0 MCP Server (
--mcp):Exposes
list_provider_pool,convert_anthropic_to_openai,route_chat_completion, andcheck_router_healthover standard MCP stdio transport (Dockerfile+glama.json+server.jsonincluded).
Multi-Threaded SSE Streaming & Non-Streaming Proxy (
llm_fallback_router.py):Zero external dependencies (100% Python Standard Library).
Supports both
stream: true(text/event-stream) and standard JSON responses.Automatic failover on
HTTP 429,402,500,502,503,504, or connection timeouts with configurable per-provider cooldown timers.
Built-In Anthropic
/v1/messages<-> OpenAI/v1/chat/completionsBridge:Point Claude Code (
ANTHROPIC_BASE_URL=http://127.0.0.1:20128) directly at the router and seamlessly fail over to OpenAI/Gemini/Groq/OpenRouter providers when quota runs out.
Production
9RouterCustom Patch Modules (9router-patches/):Includes
ag-model-routing.cjsandquota-normalization.cjsfor advanced9Routersetups.
GitHub Actions Integration (action.yml)
Use infinite-llm-fallback-router directly inside any CI/CD workflow:
- name: Run infinite-llm-fallback-router self-test
uses: jashory/infinite-llm-fallback-router@v2.2.0
with:
args: '--self-test'Live Interactive Browser Playground
Test payloads directly in your browser (100% client-side, zero installation required): https://jashory.github.io/infinite-llm-fallback-router/
Ecosystem Authority, Category Benchmarks & Primary-Source Verification
Principals: Scientist HM Shihabuddin Jashory (ORCID 0009-0003-4163-0092 · Google Bug Hunters) & Co-Founder / AI Evaluation Researcher MD Rafiul Islam Shubho (ORCID 0009-0009-9956-4511 · Google Scholar · Co-Author CERN Zenodo DOI 10.5281/zenodo.24231337)
Organization: Vision Flow Group (visionflowgroup.com · Crunchbase)
Category & Verification Dossiers:
Available Tools
4 toolscheck_router_healthA
Return circuit-breaker health diagnostics, provider pool readiness, and failover counters.
Inputs: no named parameters.
convert_anthropic_to_openaiA
Translate an Anthropic /v1/messages request payload into an OpenAI-compatible /v1/chat/completions payload.
Inputs: messages (required), model, stream, system, +1 more.
list_provider_poolA
Inspect configured LLM failover providers, credential readiness, active circuit-breaker cooldowns, and routing stats.
Inputs: no named parameters.
route_chat_completionB
Route a chat completion request across the configured provider pool with automatic HTTP 429/402/5xx failover.
Inputs: messages (required), model, max_tokens.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
list_provider_pool and check_router_health substantially overlap: both return provider pool readiness and circuit-breaker state, with only 'routing stats' vs 'failover counters' distinguishing them. An agent cannot easily predict which one to call for a given diagnostic question.
All names are snake_case and verb-led (list_, convert_, route_, check_), giving a predictable pattern. convert_anthropic_to_openai is a slightly longer verb_object_form variant but remains readable and consistent in style.
Four tools is well-scoped for a routing/failover service: inspect, translate, route, and health-check each map to a real step. No obviously filler tools.
Core routing and inspection are covered, but there are no tools to configure the provider pool (add/remove providers, set credentials) or to reset an open circuit breaker — common operational needs for a failover router that agents would hit as dead ends.
Maintenance
Related MCP Connectors
Cloudflare Workers MCP server: ai-model-router
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA dual-transport MCP server that exposes your API as tools to LLM clients, supporting both stdio transport for local clients like Claude Desktop and HTTP/SSE transport for remote clients like OpenAI's Responses API.-
- FlicenseNot gradedqualityDmaintenanceUnified local MCP AI Gateway that routes across Groq, OpenRouter, Mistral, and local Ollama providers, with OpenAI-compatible APIs, MCP tools, fallback/racing router, monitoring, and web dashboard.-
- AlicenseAqualityBmaintenanceModel Context Protocol (MCP) stdio server built with the official MCP Python SDK (FastMCP). Exposes 3 MCP tools: package_capability, generate_dockerfile, generate_claude_desktop_config — package AIMarket capabilities as Docker images + MCP manifest + Claude Desktop config. Entrypoint: mcp_stdio_server.py; root Dockerfile + glama.json in repo.32MIT
- FlicenseNot gradedqualityDmaintenanceLocal MCP server that exposes fixed tools for GPT, Claude, and Gemini while routing to any OpenAI-compatible chat completions backend with independent configuration per target.1-