Reference Model Context Protocol server for AIgateway — one MCP endpoint that gives agents access to every AI modality we route (chat, embeddings, images, video, audio, voice, music, 3D, OCR, translation, classification, moderation, rerank, async jobs).
- Hosted:
https://api.aigateway.sh/mcp(Streamable HTTP, MCP 2025-03-26) - Legacy SSE:
https://api.aigateway.sh/mcp/sse(MCP 2024-11-05) - Tool schemas:
tools.tsin this repo - Inspector: api.aigateway.sh/mcp/inspect
This repo is also a Claude Code plugin marketplace. Installing the plugin wires up the MCP server and installs a skill that teaches the agent to discover models before calling them:
/plugin marketplace add aigateway-sh/mcp-server
/plugin install aigatewayYou'll be prompted for your AIgateway key (sk-aig-...) on first enable. Prefer to wire it by hand? Use the per-client snippets below.
MCP is the emerging standard for giving agents typed tools. AIgateway's MCP server exposes 19 high-level primitives — discovery (list_models, search_models, get_model) plus invocation (chat, embed, generate_image, transcribe, speak, translate, generate_video, generate_music, generate_3d, ocr, classify, moderate, rerank, detect_objects, and job control) — so agents don't need per-provider adapters.
Drop your AIgateway API key into any MCP-aware client and your agent suddenly has access to 1000+ models across every modality.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"aigateway": {
"type": "http",
"url": "https://api.aigateway.sh/mcp",
"headers": {
"Authorization": "Bearer sk-aig-YOUR_KEY"
}
}
}
}Restart Claude Desktop. The tools show up under the hammer icon.
claude mcp add --transport http aigateway https://api.aigateway.sh/mcp \
--header "Authorization: Bearer sk-aig-YOUR_KEY"Cursor Settings → MCP → Add Server:
{
"aigateway": {
"url": "https://api.aigateway.sh/mcp",
"headers": { "Authorization": "Bearer sk-aig-YOUR_KEY" }
}
}Same pattern — point at https://api.aigateway.sh/mcp with Authorization: Bearer sk-aig-.... The server speaks both Streamable HTTP (preferred) and SSE (legacy).
npx @modelcontextprotocol/inspector \
--transport streamable-http \
--server-url https://api.aigateway.sh/mcp \
--header "Authorization=Bearer sk-aig-YOUR_KEY"chat — route to 100+ text models (OpenAI-compatible)
embed — embeddings for RAG / semantic search
generate_image — text-to-image across FLUX, Ideogram, Stable Diffusion, DALL·E
transcribe — speech-to-text (Whisper, Deepgram, AssemblyAI)
speak — text-to-speech (ElevenLabs, OpenAI TTS, PlayHT)
translate — any-to-any language translation
classify — zero-shot classification
moderate — safety/moderation scoring
rerank — Cohere-style rerank for retrieval
ocr — document/image OCR
detect_objects — open-vocab object detection
generate_video — text-to-video (Runway, Luma, Kling)
generate_music — text-to-music (Suno, Udio, Stability)
generate_3d — text-to-3D (Meshy, Rodin, Stability)
get_job / cancel_job — control long-running async generations
list_models / search_models — discover what's routable right now
get_model — full invocation contract for a model (endpoint, request/response/streaming schema, quirks, runnable snippets); call before invoking an unfamiliar model
See tools.ts for the exact input/output schemas each tool exposes over MCP.
If you just want to call the same primitives from your own code without an MCP client, the HTTP API is identical to OpenAI's:
curl https://api.aigateway.sh/v1/chat/completions \
-H "Authorization: Bearer sk-aig-YOUR_KEY" \
-d '{
"model": "anthropic/claude-opus-4.7",
"messages": [{"role":"user","content":"hi"}]
}'SDKs — aigateway-js, aigateway-py, aigateway-cli.
If you want a custom MCP server that wraps a few specific AIgateway calls (e.g. "summarize this document" that internally does ocr → chat), build it with the MCP TypeScript SDK or Python SDK and call AIgateway from inside each tool. We plan to publish a small starter template here — follow the repo for updates.
- Hosted server runs on the same edge infrastructure as
api.aigateway.sh. - Live status: status.aigateway.sh.
- Failures fall back to next-best provider automatically when a lab is down.
- OpenAPI spec — github.com/aigateway-sh/openapi
- llms-txt capability map — github.com/aigateway-sh/llms-txt
- Examples — github.com/aigateway-sh/examples (includes
multimodal-agent) - Awesome list — github.com/aigateway-sh/awesome-ai-gateway
MIT. Tool schemas are canonical — if you build an alternate server that speaks the same shape, agents can swap between yours and ours transparently.