MCP server for real 9router admin/runtime API over stdio transport.
This project is now aligned to the verified API contract on local runtime (http://127.0.0.1:20128) and no longer assumes fake /admin/* endpoints.
Core (aligned with requested names):
9router_health9router_list_providers9router_get_provider9router_create_provider9router_update_provider9router_delete_provider9router_list_combos9router_get_combo9router_create_combo9router_update_combo(experimental; upstream/runtime behavior may be unreliable)9router_delete_combo9router_get_settings9router_update_settings9router_get_usage_stats
Optional extensions (supported by current 9router):
9router_list_provider_nodes9router_create_provider_node9router_list_api_keys9router_create_api_key
GET /api/settingsPATCH /api/settings(for settings update tool)GET /api/providersGET /api/providers/:idPOST /api/providersPUT /api/providers/:idDELETE /api/providers/:idGET /api/combosGET /api/combos/:idPOST /api/combosPUT /api/combos/:idDELETE /api/combos/:idGET /api/provider-nodesPOST /api/provider-nodesGET /api/keysPOST /api/keysGET /api/usage/stats?period=7d
Verified runtime facts:
requireLogin=falserequireApiKey=falsehasPassword=false
So this MCP defaults to no auth headers.
Optional auth support exists as secondary mode via env (for deployments that enable auth).
Copy .env.example and adjust it for your environment.
export NINE_ROUTER_BASE_URL="http://127.0.0.1:20128"# none | bearer | apiKey | both
export NINE_ROUTER_AUTH_MODE="none"
# optional if auth mode needs them
export NINE_ROUTER_BEARER_TOKEN="<token>"
export NINE_ROUTER_API_KEY="<api-key>"
# optional timeout
export NINE_ROUTER_TIMEOUT_MS="15000"Backward-compatible env aliases are still accepted:
NINE_ROUTER_ADMIN_BASE_URLNINE_ROUTER_ADMIN_TOKENNINE_ROUTER_ADMIN_API_KEYNINE_ROUTER_ADMIN_TIMEOUT_MS
cd research/9router-admin-mcp
npm install
cp .env.example .env
npm run build
npm startDevelopment mode:
npm run devInput schemas are updated to follow real route behavior as closely as possible from inspected 9router code:
- Providers create/update fields mirror
/api/providersand/api/providers/:idroute handlers - Combos enforce
nameregex (^[a-zA-Z0-9_-]+$) and usemodels: string[] - Usage period matches valid set:
24h | 7d | 30d | 60d | all - Settings update accepts known fields and allows additional keys (
catchall) because 9router settings are extensible
- Read provider/combo/settings resources against live
/api/* - Create/get/delete combos confirmed against live host; combo update should be treated as experimental for now
- Read usage stats by period
- Read/create provider nodes and API keys (optional tools)
- Health tool reports real runtime auth posture based on
/api/settings