Skip to main content
Glama
lumishoang

OpenRouter MCP Server

by lumishoang

OpenRouter MCPサーバー

OpenRouterで利用可能な300以上のAIモデルを検索・照会するためのMCP(Model Context Protocol)サーバーです。

機能

  • モデルのリスト表示 — 価格、コンテキスト制限、機能を含むすべての利用可能なモデルを閲覧

  • 検索とフィルタリング — プロバイダー、価格、コンテキスト長、機能(ツール、ビジョンなど)でモデルを検索

  • モデルの比較 — 複数のモデルを並べて比較

  • 詳細情報の取得 — 特定のモデルの完全なメタデータを取得

  • キャッシュされたレスポンス — API呼び出しを削減するための5分間のキャッシュ

インストール

pip install openrouter-mcp

使用方法

OpenClawでの使用

openclaw.json MCPサーバー設定に追加します:

{
  "mcp": {
    "servers": {
      "openrouter-models": {
        "command": "openrouter-mcp",
        "env": {
          "OPENROUTER_API_KEY": "your-api-key"
        }
      }
    }
  }
}

その後、ゲートウェイを再起動します。エージェントはMCPツールを使用してOpenRouterモデルを照会できるようになります。

注: OPENROUTER_API_KEY はオプションですが、より高いレート制限(20 req/minから200 req/minへ)のために推奨されます。 キーの取得はこちらから: https://openrouter.ai/keys

エージェントの使用例:

# Agent can now call MCP tools like:
list_models(sort_by="context_length")
search_models(query="claude", max_input_price=5.0)
get_model(model_id="anthropic/claude-sonnet-4.6")
compare_models(model_ids="qwen/qwen3.6-plus,anthropic/claude-sonnet-4.6")

スタンドアロン (stdio)

export OPENROUTER_API_KEY=your-key
python -m openrouter_mcp.server

利用可能なツール

ツール

説明

list_models

モダリティフィルターと並べ替えオプション付きで全モデルをリスト表示

get_model

IDを指定して特定のモデルの詳細情報を取得

search_models

クエリ、プロバイダー、価格、コンテキスト、機能でモデルを検索・フィルタリング

compare_models

複数のモデルを並べて比較

refresh_cache

OpenRouter APIからモデルキャッシュを強制的に更新

コンテキスト長で並べ替えたモデルリスト

{
  "name": "list_models",
  "arguments": {
    "modality": "text",
    "sort_by": "context_length"
  }
}

100万トークンあたり5ドル未満のClaudeモデルを検索

{
  "name": "search_models",
  "arguments": {
    "query": "claude",
    "provider": "anthropic",
    "max_input_price": 5.0,
    "requires_tools": true
  }
}

3つのモデルを比較

{
  "name": "compare_models",
  "arguments": {
    "model_ids": "anthropic/claude-sonnet-4.6,qwen/qwen3.6-plus,openai/gpt-5.4"
  }
}

モデルの詳細を取得

{
  "name": "get_model",
  "arguments": {
    "model_id": "anthropic/claude-sonnet-4.6"
  }
}

APIリファレンス

list_models(modality, sort_by)

  • modality (str, デフォルト: "text"): 出力タイプでフィルタリング。オプション: text, image, audio, embeddings, all

  • sort_by (str, デフォルト: "name"): 並べ替え基準: name, created, price, context_length

get_model(model_id)

  • model_id (str, 必須): モデルのスラッグ(例: anthropic/claude-sonnet-4.6

search_models(query, provider, max_input_price, min_context, requires_tools, requires_vision, free_only)

  • query (str): モデル名/ID/説明のフリーテキスト検索

  • provider (str): プロバイダーでフィルタリング(例: anthropic, google, openai

  • max_input_price (float): 100万トークンあたりの最大入力価格(0 = 制限なし)

  • min_context (int): 最小コンテキストウィンドウサイズ

  • requires_tools (bool): ツール呼び出しをサポートするモデルのみ

  • requires_vision (bool): ビジョン/画像入力をサポートするモデルのみ

  • free_only (bool): 無料モデルのみ

compare_models(model_ids)

  • model_ids (str, 必須): カンマ区切りのモデルIDリスト

refresh_cache()

OpenRouter APIからモデルキャッシュを強制的に更新します。

レート制限

  • APIキーなし: 20リクエスト/分

  • APIキーあり: 200リクエスト/分

  • モデルデータは5分間キャッシュされます

APIキーの取得はこちらから: https://openrouter.ai/keys

ライセンス

MIT

貢献

貢献を歓迎します!GitHubでIssueまたはPRを作成してください。

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - A tier

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

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/lumishoang/openrouter-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server