9router-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
9router-mcp
MCP server (stdio, newline-delimited JSON-RPC 2.0) for a local 9router LLM gateway. No dependencies; requires Bun.
Tools
router_models- live models, pool headroom and seven-day call statisticsrouter_headroom- pool capacity, cooldowns and in-flight callsrouter_chat- chat with exactly one model; never silently switches models, suggests an alternative from the task rows on rate limitrouter_probe- sequential eight-token probesrouter_usage- read-only usage totals by key namerouter_search/router_fetch- search and page fetch; paid Firecrawl needsallow_firecrawl: true
Related MCP server: io.github.0xzr/freellmpool
Install
claude mcp add -s user 9router-mcp -- bun /absolute/path/to/9router-mcp/index.tsAdd -e NAME=value for any variable below.
Configuration (environment)
ROUTER_BASE: router origin; defaulthttp://127.0.0.1:20128. Loopback127.0.0.1only.ROUTER_CACHE: shared state directory (limits.json,calls.jsonl); default~/.cache/pi-runs.ROUTER_DB: router SQLite file; default~/.9router/data.sqlite. Read-only.ROUTER_HEADROOM_SCRIPT: executable run with--json; defaultmodel-headroom. Must print an array or{pools: [...]}of{pool, percent_left, status, reset_at}.ROUTER_TASK_ROWS: path to a JSON file of fallback rows; defaulttask-rows.jsonnext toindex.ts.
Task rows are ordered lists of model IDs from weakest to strongest:
[["glm/example-small"], ["cx/example-medium", "cx/example-large"]]When a model in a row is rate limited, the next healthy model in the same row is suggested as alternative.
Safety
Key redaction: values from the router
apiKeystable,sk-strings,Bearertokens and secret-named fields are replaced with[REDACTED]in all output and logs. Only key names are ever selected for usage.Rate limits: per-pool concurrency caps, cooldowns from
retry-after(or 5 minutes doubling to 60), a learned cap of N-1 after a 429, and a fusion-call cap.Prompts are never logged; the router DB is never written; no authorization header is sent.
Tests
bun test <file>Run files one at a time. mutation.test.ts temporarily edits router.ts and restores it; run it alone.
Known gaps
Search/fetch are not covered by the shared limits.
Upstream body reads lack independent deadlines.
A crashed process can leave a lock needing manual removal.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
OpenAI-compatible LLM gateway: pay per request with an API key, signed receipt for each call.
OpenAI-compatible BYOK LLM gateway: per-task routing, shadow evaluation, promotion gates.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceExposes an OpenAI- and Anthropic-compatible HTTP, SSE, and stdio gateway that wraps multiple subscription CLIs, adding prompt-injection defense, PII redaction, cost-aware routing, and reasoning-trace capture for MCP-compatible clients like Claude Desktop and Cursor.15Apache 2.0
- 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.-
- FlicenseNot gradedqualityAmaintenanceEnables agents and OpenAI-compatible coding tools to discover and route across a pooled catalog of free LLM providers, chat models, and live provider health behind a single gateway. Includes keyless-start capability, automatic failover on rate limits or outages, and local usage tracking.-