mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-01 12:52:11 +03:00
## Bug Fixes - fix(lint): resolve 5 explicit 'any' violations in open-sse/services/usage.ts - quotas: Record<string,any> → Record<string,UsageQuota> - window: any → JsonRecord (hasUtilization + createQuotaObject) - (error as any) → (error as Error) in 2 catch blocks - valueRecord = toRecord(value) to safely pass unknown to JsonRecord fn ## Documentation - docs: move 29 README.<lang>.md from root to docs/i18n/<lang>/README.md (root now contains only English README.md) - docs(i18n): sync all 11 docs/*.md to 30 language folders (319 updates) Languages: ar bg da de es fi fr he hu id in it ja ko ms nl no phi pl pt pt-BR ro ru sk sv th uk-UA vi zh-CN ## Maintenance - chore: delete all duplicate auto-generated draft GitHub releases (v2.0.17–v2.1.0)
88 lines
4.9 KiB
Markdown
88 lines
4.9 KiB
Markdown
🌐 **Languages:** 🇺🇸 [English](../../README.md) · 🇧🇷 [pt-BR](../pt-BR/MCP-SERVER.md) · 🇪🇸 [es](../es/MCP-SERVER.md) · 🇫🇷 [fr](../fr/MCP-SERVER.md) · 🇩🇪 [de](../de/MCP-SERVER.md) · 🇮🇹 [it](../it/MCP-SERVER.md) · 🇷🇺 [ru](../ru/MCP-SERVER.md) · 🇨🇳 [zh-CN](../zh-CN/MCP-SERVER.md) · 🇯🇵 [ja](../ja/MCP-SERVER.md) · 🇰🇷 [ko](../ko/MCP-SERVER.md) · 🇸🇦 [ar](../ar/MCP-SERVER.md) · 🇮🇳 [in](../in/MCP-SERVER.md) · 🇹🇭 [th](../th/MCP-SERVER.md) · 🇻🇳 [vi](../vi/MCP-SERVER.md) · 🇮🇩 [id](../id/MCP-SERVER.md) · 🇲🇾 [ms](../ms/MCP-SERVER.md) · 🇳🇱 [nl](../nl/MCP-SERVER.md) · 🇵🇱 [pl](../pl/MCP-SERVER.md) · 🇸🇪 [sv](../sv/MCP-SERVER.md) · 🇳🇴 [no](../no/MCP-SERVER.md) · 🇩🇰 [da](../da/MCP-SERVER.md) · 🇫🇮 [fi](../fi/MCP-SERVER.md) · 🇵🇹 [pt](../pt/MCP-SERVER.md) · 🇷🇴 [ro](../ro/MCP-SERVER.md) · 🇭🇺 [hu](../hu/MCP-SERVER.md) · 🇧🇬 [bg](../bg/MCP-SERVER.md) · 🇸🇰 [sk](../sk/MCP-SERVER.md) · 🇺🇦 [uk-UA](../uk-UA/MCP-SERVER.md) · 🇮🇱 [he](../he/MCP-SERVER.md) · 🇵🇭 [phi](../phi/MCP-SERVER.md)
|
|
|
|
---
|
|
|
|
# OmniRoute MCP Server Documentation
|
|
|
|
> Model Context Protocol server with 16 intelligent tools
|
|
|
|
## Installation
|
|
|
|
OmniRoute MCP is built-in. Start it with:
|
|
|
|
```bash
|
|
omniroute --mcp
|
|
```
|
|
|
|
Or via the open-sse transport:
|
|
|
|
```bash
|
|
# HTTP streamable transport (port 20130)
|
|
omniroute --dev # MCP auto-starts on /mcp endpoint
|
|
```
|
|
|
|
## IDE Configuration
|
|
|
|
See [IDE Configs](integrations/ide-configs.md) for Antigravity, Cursor, Copilot, and Claude Desktop setup.
|
|
|
|
---
|
|
|
|
## Essential Tools (8)
|
|
|
|
| Tool | Description |
|
|
| :------------------------------ | :--------------------------------------- |
|
|
| `omniroute_get_health` | Gateway health, circuit breakers, uptime |
|
|
| `omniroute_list_combos` | All configured combos with models |
|
|
| `omniroute_get_combo_metrics` | Performance metrics for a specific combo |
|
|
| `omniroute_switch_combo` | Switch active combo by ID/name |
|
|
| `omniroute_check_quota` | Quota status per provider or all |
|
|
| `omniroute_route_request` | Send a chat completion through OmniRoute |
|
|
| `omniroute_cost_report` | Cost analytics for a time period |
|
|
| `omniroute_list_models_catalog` | Full model catalog with capabilities |
|
|
|
|
## Advanced Tools (8)
|
|
|
|
| Tool | Description |
|
|
| :--------------------------------- | :---------------------------------------------- |
|
|
| `omniroute_simulate_route` | Dry-run routing simulation with fallback tree |
|
|
| `omniroute_set_budget_guard` | Session budget with degrade/block/alert actions |
|
|
| `omniroute_set_resilience_profile` | Apply conservative/balanced/aggressive preset |
|
|
| `omniroute_test_combo` | Live-test all models in a combo |
|
|
| `omniroute_get_provider_metrics` | Detailed metrics for one provider |
|
|
| `omniroute_best_combo_for_task` | Task-fitness recommendation with alternatives |
|
|
| `omniroute_explain_route` | Explain a past routing decision |
|
|
| `omniroute_get_session_snapshot` | Full session state: costs, tokens, errors |
|
|
|
|
## Authentication
|
|
|
|
MCP tools are authenticated via API key scopes. Each tool requires specific scopes:
|
|
|
|
| Scope | Tools |
|
|
| :------------- | :----------------------------------------------- |
|
|
| `read:health` | get_health, get_provider_metrics |
|
|
| `read:combos` | list_combos, get_combo_metrics |
|
|
| `write:combos` | switch_combo |
|
|
| `read:quota` | check_quota |
|
|
| `write:route` | route_request, simulate_route, test_combo |
|
|
| `read:usage` | cost_report, get_session_snapshot, explain_route |
|
|
| `write:config` | set_budget_guard, set_resilience_profile |
|
|
| `read:models` | list_models_catalog, best_combo_for_task |
|
|
|
|
## Audit Logging
|
|
|
|
Every tool call is logged to `mcp_tool_audit` with:
|
|
|
|
- Tool name, arguments, result
|
|
- Duration (ms), success/failure
|
|
- API key hash, timestamp
|
|
|
|
## Files
|
|
|
|
| File | Purpose |
|
|
| :------------------------------------------- | :------------------------------------------ |
|
|
| `open-sse/mcp-server/server.ts` | MCP server creation + 16 tool registrations |
|
|
| `open-sse/mcp-server/transport.ts` | Stdio + HTTP transport |
|
|
| `open-sse/mcp-server/auth.ts` | API key + scope validation |
|
|
| `open-sse/mcp-server/audit.ts` | Tool call audit logging |
|
|
| `open-sse/mcp-server/tools/advancedTools.ts` | 8 advanced tool handlers |
|