Skip to main content
Glama
OpenRouter MCP Server

OpenRouter MCP Server

by lumishoang

OpenRouter MCPサーバー

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

機能

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

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

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

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

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

Related MCP server: NanoBanana MCP Server

インストール

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を作成してください。

Available Tools

5 tools
compare_modelsB

Compare multiple models side by side.

Args: model_ids: Comma-separated model IDs

Inputs: model_ids (required). Returns: result

get_modelA

Get detailed info for one model.

Args: model_id: Model slug, e.g. 'anthropic/claude-sonnet-4.6'

Inputs: model_id (required). Returns: result

list_modelsB

List models available on OpenRouter.

Args: modality: Filter by output type. Options: text, image, audio, embeddings, all sort_by: Sort by: name, created, price, context_length

Inputs: modality, sort_by. Returns: result

refresh_cacheA

Force refresh the model cache from OpenRouter.

Inputs: no named parameters. Returns: result

search_modelsA

Search and filter OpenRouter models.

Args: query: Free-text search in model name/id/description provider: Filter by provider (anthropic, google, openai, etc.) max_input_price: Max input price per 1M tokens, 0 = no limit min_context: Minimum context window size requires_tools: Only models supporting tool calling requires_vision: Only models with vision/image input free_only: Only free models

Inputs: query, provider, max_input_price, min_context, +3 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a distinct purpose: get single model details, list with basic filters, search with advanced filters, compare multiple, and cache refresh. No overlapping functionality; descriptions clearly differentiate them.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using lowercase with underscores: list_models, search_models, get_model, compare_models, refresh_cache. No mixing of conventions.

    Tool Count5/5

    With 5 tools, the server provides a focused set for model discovery and management. This is neither too few nor too many for the domain of querying model information from OpenRouter.

    Completeness5/5

    The tool set covers all essential operations for interacting with OpenRouter models: listing, searching, getting details, comparing, and cache management. No obvious gaps like missing model capability queries, as search covers those.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that retrieves and provides AI model information from OpenAI, Anthropic, and Google through a unified interface.
      3
      84 npm
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      An MCP server that wraps the OpenRouter API, enabling users to access diverse language models like Google Gemini 3 Pro for chat and image tasks. It provides tools for generating completions and listing available models within MCP-compatible clients.
      -