QuickRouter MCP Server
# QuickRouter MCP Server
A local Model Context Protocol server for browsing QuickRouter models and pricing, estimating text-token costs, and sending non-streaming text chat requests. The server communicates over stdio and requires Node.js 20 or newer.
[](https://glama.ai/mcp/servers/YunSongMax/quickrouter-mcp-server)
## Run
Run the [npm package](https://www.npmjs.com/package/quickrouter-mcp-server):
```sh
npx -y quickrouter-mcp-server
```
To run from source, run `npm ci`, then `npm run build` and `node dist/index.js`. Set the client command to `node` and its first argument to the absolute path of `dist/index.js`. The process waits for MCP messages on stdin.
The three catalog tools work without a key. To enable chat, set `QUICKROUTER_API_KEY` in the local server process environment. Get a key from the [QuickRouter console](https://api.quickrouter.ai/console/token). Keep it out of source control. Chat sends the selected model ID and message text to `https://api.quickrouter.ai/v1/chat/completions` and may incur charges. Catalog tools fetch `https://quickrouter.ai/api/model-pricing` without the key.
## Client configuration
These examples use the npm package. For the local build, substitute the `node` command and script path described above. If a GUI client cannot find `npx`, use the absolute path returned by `command -v npx` on macOS or Linux, or `where npx` on Windows.
### Claude Desktop
Open **Settings → Developer → Edit Config**, add the entry to `claude_desktop_config.json`, then restart Claude Desktop. For chat, inject `QUICKROUTER_API_KEY` in the local process environment. If the app does not inherit that environment, set the key in the private config's server-level `env` map. [Local MCP setup](https://modelcontextprotocol.io/docs/develop/connect-local-servers)
```json
{
"mcpServers": {
"quickrouter": {
"command": "npx",
"args": ["-y", "quickrouter-mcp-server"]
}
}
}
```
### Cursor / Grok Build
Add this to `.cursor/mcp.json` for the project or `~/.cursor/mcp.json` for your account. Start the client with the key in its environment if enabling chat. To use catalog tools only, omit the `env` entry. [MCP configuration](https://docs.grok.com/build/agents-window/mcp)
```json
{
"mcpServers": {
"quickrouter": {
"type": "stdio",
"command": "npx",
"args": ["-y", "quickrouter-mcp-server"],
"env": {"QUICKROUTER_API_KEY": "${env:QUICKROUTER_API_KEY}"}
}
}
}
```
### Windsurf / Devin Desktop
Add the entry through the MCP settings. Existing Windsurf installations use `~/.codeium/windsurf/mcp_config.json`. Devin Desktop uses `~/.config/devin/mcp_config.json` for the user scope, or `.devin/mcp_config.local.json` for a local project override. Inject the key through the local process environment or the private server-level `env` map if using chat. [Current Devin MCP configuration](https://docs.devin.ai/desktop/devin-local/customizations#mcp-servers)
```json
{
"mcpServers": {
"quickrouter": {
"command": "npx",
"args": ["-y", "quickrouter-mcp-server"]
}
}
}
```
### Claude Code
Use a project `.mcp.json` file and run `claude mcp list` to confirm the registration. Omit `env` when using the catalog without a key. [MCP scopes and environment expansion](https://code.claude.com/docs/en/mcp)
```json
{
"mcpServers": {
"quickrouter": {
"type": "stdio",
"command": "npx",
"args": ["-y", "quickrouter-mcp-server"],
"env": {"QUICKROUTER_API_KEY": "${QUICKROUTER_API_KEY}"}
}
}
}
```
## Tools
| Tool | Common inputs | Result |
| --- | --- | --- |
| `list_models` | `query`, `family`, `limit` | Matching model IDs, capability tags, and catalog endpoint URLs. The in-memory catalog cache expires after 60 seconds. |
| `get_model_pricing` | `model_id` | Exact or unique partial match with group rates, price units, published rate tiers, capabilities, and pricing timestamp. Unknown context windows are returned as `null`. |
| `estimate_cost` | `model_id`, `input_tokens`, `output_tokens`, optional `requests`, `group` | Per-request and total USD for applicable text-token rates. Uses each group's matching published input and output tiers. |
| `chat_completion` | `messages`, optional `model`, `max_tokens` | Text, returned model, finish reason, and available token usage. Defaults to `claude-sonnet-5-5`. Requires `QUICKROUTER_API_KEY`. |
For example, estimate ten identical requests with `{"model_id":"gpt-6.2-sol","input_tokens":1200,"output_tokens":300,"requests":10}`. Batch here means a repeated-request estimate. The estimate covers uncached text and excludes cache, media and batch discounts. The actual API key group, rate tier, and usage in the console determine charges. Consult [QuickRouter pricing](https://quickrouter.ai/pricing).
For a text chat, send `{"messages":[{"role":"user","content":"Reply with OK."}],"max_tokens":32}`. Custom model IDs are passed through to the gateway and require model access on your key. Use `max_tokens` where the selected route accepts it. HTTP 401 indicates a rejected key, 403 indicates denied access, and 429 indicates a rate or quota limit. The server does not automatically retry chat calls.
## Model IDs
The following 13 IDs were checked in the [public QuickRouter catalog](https://quickrouter.ai/api/model-pricing). Availability for chat depends on your key group.
| Family | IDs |
| --- | --- |
| GPT | `gpt-6.2-astra`, `gpt-6.2-sol`, `gpt-6.1-terra` |
| Claude | `claude-opus-5-5`, `claude-fable-5-2`, `claude-sonnet-5-5`, `claude-haiku-5-5` |
| Gemini | `gemini-4-carbon`, `gemini-4-hydrogen`, `gemini-4-neon` |
| DeepSeek | `deepseek-v4.1-flash`, `deepseek-v4-pro` |
| Grok | `grok-4.7` |
## Development
```sh
npm ci
npm run typecheck
npm run test
npm run build
npm pack --dry-run
```
The production dependency is the official TypeScript SDK v1 line, `@modelcontextprotocol/sdk`, with Zod validation. Unit tests use MCP InMemoryTransport and mocked fetch. The software is distributed under the [MIT License](LICENSE).
TDQS
Scored across 4 tools
The four tools split cleanly into model discovery (list_models), single-model detail (get_model_pricing), cost math (estimate_cost), and actual inference (chat_completion). The only mild overlap is between get_model_pricing and estimate_cost, since both surface rate information, but the descriptions make the lookup-vs-calculation boundary clear.
All names are snake_case and three of four follow a verb_noun pattern (get_model_pricing, list_models, estimate_cost). chat_completion is a noun-phrase outlier, a minor deviation but still predictable and readable in context.
Four tools is well-scoped for a router/pricing service: list, inspect, estimate, and invoke. Each tool has a distinct job and none feels redundant or padded.
The pricing-to-inference lifecycle is covered end to end, with filters and repeat/billing-group options on estimation. Gaps are minor but real: no streaming, no embeddings or non-chat endpoints, and no account balance/usage check to complement the cost estimates.