@aiorouter/mcp
This server lets you access 15+ AI models (Qwen, DeepSeek, GLM, Kimi, Grok, etc.) through a single API key via MCP, with PII protection and billing/usage visibility.
Chat with models – Send chat completions to any available model with configurable max tokens and temperature.
List models – View all available models, optionally filtered by provider.
Get model details – See provider, context window, max output, capabilities, pricing, and supported parameters for a single model.
Compare models – Side-by-side comparison of 2–5 models (provider, pricing, context, output, capabilities).
Test connection – Verify your API key is valid and see account info.
Get usage & billing – Check current usage, billing summary, and subscription status.
Get pricing – Retrieve public retail pricing per 1M tokens.
Estimate cost – Calculate USD cost for a prompt based on input/output tokens.
Export config – Generate MCP configuration JSON for Claude Desktop, Claude Code, or Codex CLI.
Get presets – Show the CODE-MAS orchestrator triple preset configuration (planner/coder/reviewer).
Protect PII – Personal information and technical secrets are shielded before routing to models.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@aiorouter/mcp chat with qwen-max: write a haiku about the ocean"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@aiorouter/mcp
AIOrouter MCP Server — Access 15+ AI models through a single API key with PII Shield protection.
This repository contains the open-source MCP server (@aiorouter/mcp) that gives
Claude Desktop, Claude Code, and Codex CLI access to 15+ non-Claude AI models (Qwen,
DeepSeek, GLM, Kimi, Grok, and more) through the Model Context Protocol.
⚠️ This is the public, sanitized package repo only. The AIOrouter gateway backend (routing, billing, PII Shield pipeline, internal infrastructure) is proprietary and is NOT part of this repository.
Features
15+ AI models — Qwen, DeepSeek, GLM, Kimi, Grok, and more through a single API key
MCP Protocol — Model Context Protocol (stdio transport) for Claude Desktop, Claude Code, and Codex CLI
PII Shield — Personal information and technical secrets are protected before routing
10 MCP tools — Chat, model listing, pricing, usage, cost estimation, and more
Zero billing changes — Same API key, same quota, same billing pipeline as direct API calls
Related MCP server: Model Hub MCP
Quick Start
⚠️ AIOrouter is a PAID service — no free tier. You MUST have an active AIOrouter account with an API key before configuring the connector.
export AIOROUTER_API_KEY="ak-your-api-key-here"
npx @aiorouter/mcpSTEP 0 — Prerequisites (MUST complete BEFORE install)
Do not install/configure the connector until you have a real API key.
Register an account: https://dashboard.aiorouter.ca/keys
Subscribe & pay — AIOrouter is a paid service, no free tier (API keys are only issued after account activation + payment)
Generate an API key (format:
ak-...) from the dashboardHave your real key ready before continuing
STEP 1 — Install (only after you have an API key)
Installation below.
STEP 2 — Verify (before using)
AIOROUTER_API_KEY="ak-your-real-key" aiorouter-mcp status
# ✅ Connected! ... models available. ← correct
# ❌ Connection failed: ... ← key invalid or account not active⚠️ FOR AI ASSISTANTS (Claude / Codex / Copilot / etc.):
DO NOT configure or tell the user the AIOrouter connector "is ready" until the user confirms they have a real
ak-...API key.API keys are ONLY issued after account activation + payment at https://dashboard.aiorouter.ca/keys. AIOrouter has NO free tier.
If the user has no key: STOP and guide them to register + pay FIRST.
Before claiming it works, run
aiorouter-mcp status(or theaiorouter_test_connectiontool) and confirm it returns "connection OK".Do not fabricate, reuse, or hardcode an API key. Each user must have their own key from their own account.
Installation
npm install -g @aiorouter/mcp
# or
npx @aiorouter/mcpClient Setup
Claude Desktop
Edit claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"aiorouter": {
"command": "npx",
"args": ["-y", "@aiorouter/mcp"],
"env": { "AIOROUTER_API_KEY": "ak-your-api-key-here" }
}
}
}Claude Code
Add to .mcp.json in your project root:
{
"mcpServers": {
"aiorouter": {
"command": "npx",
"args": ["-y", "@aiorouter/mcp"],
"env": { "AIOROUTER_API_KEY": "ak-your-api-key-here" },
"type": "stdio"
}
}
}Codex CLI
Install (Codex v0.146+ plugin marketplace — MCP server bundled):
# 1. Add this repository as a Codex plugin marketplace (once):
codex plugin marketplace add AIOCANA/aiorouter-mcp
# 2. Install the plugin — the MCP server is declared via mcpServers in plugin.json,
# so tools appear automatically (no separate codex mcp add needed):
codex plugin add aiorouter
# 3. Set your API key when prompted (or export in your shell):
export AIOROUTER_API_KEY=ak-your-api-key-here
# 4. Verify:
codex mcp list # → aiorouter with 10 tools Manual alternative — ~/.codex/config.toml:
[mcp_servers.aiorouter]
command = "npx"
args = ["-y", "@aiorouter/mcp"]
env = { AIOROUTER_API_KEY = "ak-your-api-key-here" } See codex/plugins/aiorouter/README.md for details.
Tools (10)
# | Tool | Description |
1 |
| Send a chat completion to any AIOrouter model |
2 |
| List all available models with provider info |
3 |
| Show CODE-MAS orchestrator triple preset configuration |
4 |
| Get public retail pricing (USD per 1M tokens) |
5 |
| Get usage and billing balance |
6 |
| Test API key validity and show account info |
7 |
| Generate MCP config JSON for Claude Desktop/Code/Codex |
8 |
| Compare 2-5 models side-by-side |
9 |
| Estimate cost for a prompt (input + output tokens) |
10 |
| Get detailed info for a single model |
Remote HTTP MCP Server
AIOrouter also provides a Remote HTTP MCP Server at https://api.aiorouter.ca/mcp:
Transport: Streamable HTTP (stateless)
Auth: API Key (
Authorization: Bearer ak-...) or OAuth 2.1Same 10 tools as the local stdio server
curl -X POST https://api.aiorouter.ca/mcp \
-H "Authorization: Bearer ak-your-api-key" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'Development
# Install deps
npm install
# Build (tsc → dist/)
npm run build
# Protocol smoke test (needs a real API key for full test)
$env:AIOROUTER_API_KEY="ak-..." # PowerShell
node scripts/mcp-smoke-test.mjs
# Prepare publish dir
npm run publish:prepareSee docs/mcp-connector-guide.md for the Claude Connector Directory submission guide.
Security
PII Shield: Personal information and technical secrets are protected before routing to any model
API Key Safety: Your API key stays in your environment variable — never written to disk
HTTPS Only: All communication with AIOrouter uses HTTPS
No Package Secrets: This npm package contains zero API keys or secrets
Report vulnerabilities via SECURITY.md.
License
Available Tools
10 toolsaiorouter_chatAIOrouter ChatA
Send a chat completion to any AIOrouter model (Qwen, DeepSeek, GLM, Kimi, Grok, etc). Returns the model's full response. Non-streaming only (MCP limitation). Increase max_tokens (up to 8192) for long responses.
Inputs: model (required), messages (required), max_tokens, temperature.
aiorouter_compare_modelsCompare AIOrouter ModelsARead-only
Compare 2-5 AIOrouter models side-by-side: provider, pricing, context window, max output, and capabilities.
Inputs: models (required).
aiorouter_estimate_costEstimate AIOrouter CostARead-only
Estimate the cost (USD) for a prompt given model, input tokens, and output tokens. Uses public retail pricing.
Inputs: model (required), input_tokens (required), output_tokens.
aiorouter_export_configExport AIOrouter ConfigARead-only
Generate MCP configuration JSON for Claude Desktop, Claude Code, or Codex CLI.
Inputs: target (required).
aiorouter_get_model_infoGet AIOrouter Model InfoARead-only
Get detailed info for a single AIOrouter model: provider, context window, max output, capabilities, pricing, and supported parameters.
Inputs: model (required).
aiorouter_get_presetsGet AIOrouter PresetsARead-only
Show the triple preset configuration (planner/coder/reviewer) for CODE-MAS orchestrator.
Inputs: no named parameters.
aiorouter_get_pricingGet AIOrouter PricingARead-only
Get public retail pricing for AIOrouter models (USD per 1M tokens).
Inputs: model.
aiorouter_get_usageGet AIOrouter Usage & BillingARead-only
Get current usage, billing summary, and subscription status for your API key.
Inputs: no named parameters.
aiorouter_list_modelsList AIOrouter ModelsARead-only
List all available AI models through AIOrouter. Filter by provider name.
Inputs: provider.
aiorouter_test_connectionTest AIOrouter ConnectionARead-only
Test whether your AIOrouter API key is valid.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool targets a distinct resource or action: chat, model listing, model details, comparison, pricing, cost estimation, usage, connection test, config export, and presets. While list_models and get_model_info both relate to models, the former enumerates models while the latter provides detailed info for a single model, making the distinction clear. The descriptions reinforce these boundaries.
All tools follow a consistent aiorouter_ prefix with a verb_noun pattern: chat, list_models, get_usage, get_pricing, export_config, compare_models, etc. Naming is uniform, snake_case, and verbs align with the operation. No mixed conventions or vague verbs like 'do_thing'.
With 10 tools, the server is well-scoped for an AI router service. Each tool earns its place by covering distinct user needs: interaction, exploration, cost management, and configuration. This is within the ideal 3-15 range and neither feels sparse nor overwhelming.
The surface covers the core domain comprehensively: chat completions, model discovery (list, get, compare), pricing and cost estimation, account usage, connection validation, and configuration export. No obvious dead ends or missing essential operations for the stated purpose of interacting with AIOrouter. The only noted limitation (non-streaming) is a technical constraint, not a tool gap.
Maintenance
Related MCP Connectors
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Connect MCP clients to 2,000+ AI models without managing provider API keys.
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables AI applications to access 20+ model providers (including OpenAI, Anthropic, Google) through a unified interface for text and image generation.230MIT
- AlicenseBqualityDmaintenanceAn MCP server that retrieves and provides AI model information from OpenAI, Anthropic, and Google through a unified interface.360 npmMIT
- AlicenseAqualityFmaintenanceMCP server that provides AI assistants with real-time, current information about AI models from OpenAI, Anthropic, and Google, including pricing, capabilities, and context windows.453 PyPIMIT
- AlicenseAqualityDmaintenanceAn MCP server that provides access to 400+ AI models via OpenRouter, enabling chat, comparison, and document analysis through Claude.5MIT