AI Gateway MCP Server
Allows querying Google models (Gemini 3 Flash, Pro) for search and Q&A.
Allows querying OpenAI models (GPT-5.4, GPT-5.4-mini, etc.) for Q&A, web search, and multi-model research.
Allows querying Perplexity models (Sonar, Sonar Pro, Sonar Reasoning Pro) for web search and research.
Integrates with Vercel AI Gateway to route requests to multiple AI providers with unified access.
Click on "Install 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., "@AI Gateway MCP Serversearch for latest AI developments"
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.
AI Gateway MCP Server
Vercel AI Gateway を通じて複数の AI プロバイダー・モデルに統一的にアクセスできる MCP サーバー。 Web 検索、マルチモデル調査・比較など、LLM を活用した 4 つのツールを提供します。
提供ツール
ask -- AI に質問
任意のモデルに質問を送り、回答を得ます。
パラメータ | 型 | 必須 | デフォルト | 説明 |
| string | Yes | - | 質問内容 |
| string | No |
| モデル ID |
| string | No | - | 追加コンテキスト |
| number | No | - | 最大出力トークン数(省略時はモデル任せ) |
search -- Web 検索
検索対応モデルを使って最新情報を取得します。
パラメータ | 型 | 必須 | デフォルト | 説明 |
| string | Yes | - | 検索クエリ |
| string | No |
| 検索対応モデル ID |
| number | No | - | 最大出力トークン数(省略時はモデル任せ) |
research -- マルチモデル調査・比較
複数モデルに並列クエリし、結果を統合または比較表示します。
パラメータ | 型 | 必須 | デフォルト | 説明 |
| string | Yes | - | 調査クエリ |
| string | No |
|
|
| string[] | No | mode に応じた 4 モデル | 2~4 モデル ID の配列 |
| boolean | No |
|
|
| string | No |
| 統合に使うモデル( |
| number | No | - | 各モデルの最大出力トークン数(省略時はモデル任せ) |
| number | No | - | 統合の最大出力トークン数(省略時はモデル任せ) |
処理フロー:
Query Stage: 指定(またはデフォルト)モデルに並列リクエスト
searchデフォルト:perplexity/sonar,gemini-3-flash,gpt-5-miniaskデフォルト:gpt-5.4,claude-opus-4.6,gemini-3.1-pro-preview,sonar-reasoning-pro
Synthesis Stage (
synthesize:true):openai/gpt-5.4が全結果を精査・統合し、矛盾点を指摘、ソースを明記Comparison (
synthesize:false): 各モデルの回答をコスト・レイテンシ付きで並列表示
list_models -- モデル一覧
利用可能なモデルの情報(価格・能力・検索コスト)を表示します。
パラメータ | 型 | 必須 | 説明 |
| string | No | プロバイダーでフィルタ( |
| string | No | 能力でフィルタ( |
Related MCP server: Multi-Search MCP Server
サポートモデル
OpenAI
モデル ID | 入力 | 出力 | 検索 | 特徴 |
| $2.50 | $15.00 | Yes | OpenAI 最上位。推論・コード・エージェント性能が 5.2 から大幅向上、1.05M コンテキスト、キャッシュ割引 90% |
| $0.75 | $4.50 | Yes | GPT-5 Mini の上位版。推論・コーディング・ビジョンが大幅向上、400K コンテキスト |
| $0.20 | $1.25 | Yes | GPT-5 Nano の上位版。Web 検索対応で GPT-5 Mini より安い、コーディングも向上 |
| $1.75 | $14.00 | Yes | エージェント型コード特化版。5.2-codex から 25% 高速化、mid-task steering 対応、Terminal-Bench 最高水準 |
| $0.25 | $2.00 | Yes | 低コスト汎用モデル。コーディングに特に強く、推論・検索も対応する万能型 |
| $0.05 | $0.40 | No | 最安モデル。シンプルな生成・分類向けで推論・検索は非対応 |
| $0.10 | $0.50 | No | OpenAI 公開の OSS モデル。低コストで推論・コード対応、検索非対応 |
Anthropic
モデル ID | 入力 | 出力 | 検索 | 特徴 |
| $5.00 | $25.00 | Yes | Anthropic 最上位。SWE-bench 最強クラスでコーディング精度が突出、1M コンテキスト |
| $3.00 | $15.00 | Yes | Opus の約 1/2 コストで高品質。エージェント用途やコスパ重視の汎用タスク向け、1M コンテキスト |
| $1.00 | $5.00 | Yes | Anthropic 軽量モデル。低レイテンシで検索・コード対応、高速処理向け |
モデル ID | 入力 | 出力 | 検索 | 特徴 |
| $0.50 | $3.00 | Yes | Google Search grounding 対応で検索精度が高い。コーディングも強く、search デフォルト、1M コンテキスト |
| $0.25 | $1.50 | No | 最速クラスのスループット。低コストで推論・知識に強いが検索非対応、preview 版 |
| $2.00 | $12.00 | Yes | Google 最上位。科学推論・マルチモーダルに強く、Gemini 3 Pro の後継、1M コンテキスト |
Perplexity
モデル ID | 入力 | 出力 | 検索 | 特徴 |
| $1.00 | $1.00 | Yes | 検索特化で最安。単発の事実確認やニュース検索に最適、低レイテンシ |
| $3.00 | $15.00 | Yes | 高精度検索。最大 5 回の内部検索で深掘りでき、技術ドキュメントの詳細調査向け |
| $2.00 | $8.00 | Yes | 推論+検索のハイブリッド。根拠付きの分析が必要な複雑な調査向け |
価格は 1M トークンあたり(USD)
セットアップ
1. 環境変数
Vercel AI Gateway の API キーを取得し、設定します。
変数名 | 必須 | 説明 |
| Yes | Vercel AI Gateway API キー |
| No |
|
プライバシー・データ保持
各プロバイダーへのリクエストに、プライバシー保護のための設定を自動付与します。
プロバイダー | 対応 |
OpenAI |
|
Anthropic | API 経由はデフォルトで学習不使用 |
有料 API はデフォルトで学習不使用 | |
Perplexity | API はデフォルトで Zero Data Retention |
ZERO_DATA_RETENTION=true を設定すると、Vercel AI Gateway レベルの ZDR が有効になり、ZDR 契約済みプロバイダーにのみリクエストがルーティングされます。Perplexity は自前で ZDR を保証しているため Gateway ZDR の適用対象外です。
2. MCP 設定
npx で使う場合(推奨)
Claude Code
claude mcp add ai-gateway npx @ayatec/ai-gateway-mcp-server -e AI_GATEWAY_API_KEY=your-keyClaude Desktop / その他の MCP クライアント
{
"mcpServers": {
"ai-gateway": {
"command": "npx",
"args": ["@ayatec/ai-gateway-mcp-server"],
"env": {
"AI_GATEWAY_API_KEY": "your-key"
}
}
}
}ローカルビルドで使う場合
開発中のバージョンを使いたい場合や、ソースを修正して使いたい場合はこちら。
git clone https://github.com/ayatec/ai-gateway-mcp-server.git
cd ai-gateway-mcp-server
cp .env.example .env
# .env を編集して API キーを設定
pnpm install
pnpm buildClaude Code
claude mcp add ai-gateway node /path/to/ai-gateway-mcp-server/dist/index.js -e AI_GATEWAY_API_KEY=your-keyClaude Desktop / その他の MCP クライアント
{
"mcpServers": {
"ai-gateway": {
"command": "node",
"args": ["/path/to/ai-gateway-mcp-server/dist/index.js"],
"env": {
"AI_GATEWAY_API_KEY": "your-key"
}
}
}
}開発
コマンド
pnpm install # 依存パッケージインストール
pnpm build # ビルド
pnpm dev # ウォッチモードでビルド
pnpm start # サーバー起動(ビルド後)
pnpm dev:tool # ツールの手動テスト
pnpm test # テスト実行
pnpm test:watch # テスト(ウォッチモード)
pnpm type-check # 型チェック
pnpm lint # ESLint実行
pnpm lint:fix # ESLint自動修正
pnpm format # Prettier実行
pnpm format:check # フォーマットチェックローカルテスト
pnpm dev:tool で各ツールを個別にテストできます。
# ask(デフォルト: gpt-5.4)
pnpm dev:tool ask --question "TypeScriptの利点は?"
# ask(モデル指定)
pnpm dev:tool ask --question "Rustとは?" --model "anthropic/claude-sonnet-4.6"
# search(デフォルト: google/gemini-3-flash)
pnpm dev:tool search --query "Vercel AI SDK 最新情報"
# research(4モデル並列検索→統合、デフォルト)
pnpm dev:tool research --query "WebAssemblyの現状と将来"
# research(askモード、比較表示)
pnpm dev:tool research --query "関数型プログラミングの利点" --mode ask --synthesize false
# research(モデル指定)
pnpm dev:tool research --query "latest TypeScript features" --models '["openai/gpt-5.4","perplexity/sonar"]'
# list_models
pnpm dev:tool list_models
pnpm dev:tool list_models --provider openai
pnpm dev:tool list_models --capability searchリリース
Changesets でバージョン管理しています。
changeset ファイルを作成して main に push
GitHub Actions が自動で CHANGELOG 更新・バージョンバンプ・npm publish
技術スタック
TypeScript (ESM, NodeNext, strict)
Vercel AI SDK --
gatewayプロバイダーで全モデルに統一アクセスMCP SDK -- Model Context Protocol サーバー実装
Zod -- スキーマバリデーション
Vitest -- テスト
Changesets -- バージョン管理・CHANGELOG 自動生成
ライセンス
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ayatec/ai-gateway-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server