OpenAPI to Model Context Protocol (MCP)
OpenAPI からモデルコンテキストプロトコル (MCP)
OpenAPI-MCP プロキシは OpenAPI 仕様を MCP ツールに変換し、AI エージェントがカスタム ラッパーなしで外部 API にアクセスできるようにします。

AIエージェントと外部API間のギャップを埋める
OpenAPI to Model Context Protocol(MCP)プロキシサーバーは、OpenAPI仕様を標準化されたMCPツール、リソース、プロンプトに動的に変換することで、AIエージェントと外部API間のギャップを埋めます。これにより、カスタムAPIラッパーが不要になり、統合が簡素化されます。
役に立つと思ったら、GitHub で ⭐ を付けてください。
Related MCP server: OpenAPI to MCP
主な特徴
FastMCP トランスポート:
stdio用に最適化されており、一般的な LLM オーケストレーターですぐに使用できます。OpenAPI 統合: OpenAPI 操作を解析し、呼び出し可能なツールとして登録します。
リソース登録: OpenAPI コンポーネント スキーマを、定義された URI を持つリソース オブジェクトに自動的に変換します。
プロンプト生成: API 操作に基づいてコンテキスト プロンプトを生成し、LLM が API を使用するようガイドします。
**OAuth2 サポート:**クライアント資格情報フローを介してマシン認証を処理します。
**JSON-RPC 2.0 サポート:**完全準拠のリクエスト/レスポンス構造。
自動メタデータ: OpenAPI 仕様からツール名、概要、スキーマを取得します。
サニタイズされたツール名: MCP の名前制約との互換性を確保します。
**柔軟なパラメータ解析:**クエリ文字列 (先頭に「?」が付く) と複数の JSON バリエーション (ドットと数値を含むキーを含む) をサポートします。
**強化されたパラメータ処理:**パラメータを正しいデータ型に自動的に変換します。
**拡張ツール メタデータ:**詳細なパラメーター情報と応答スキーマが含まれます。
クイックスタート
インストール
git clone https://github.com/gujord/OpenAPI-MCP.git
cd OpenAPI-MCP
pip install -r requirements.txtLLMオーケストレータの構成
Claude Desktop 、 Cursor 、 Windsurfの場合は、以下のスニペットを使用し、それに応じてパスを調整します。
{
"mcpServers": {
"petstore3": {
"command": "full_path_to_openapi_mcp/venv/bin/python",
"args": ["full_path_to_openapi_mcp/src/server.py"],
"env": {
"SERVER_NAME": "petstore3",
"OPENAPI_URL": "https://petstore3.swagger.io/api/v3/openapi.json"
},
"transport": "stdio"
}
}
}この構成を次のファイルに適用します。
カーソル:
~/.cursor/mcp.jsonウィンドサーフィン:
~/.codeium/windsurf/mcp_config.jsonClaude デスクトップ:
~/Library/Application Support/Claude/claude_desktop_config.json
full_path_to_openapi_mcp実際のインストール パスに置き換えます。
環境設定
変数 | 説明 | 必須 | デフォルト |
| OpenAPI仕様のURL | はい | - |
| MCPサーバー名 | いいえ |
|
| OAuth クライアント ID | いいえ | - |
| OAuthクライアントシークレット | いいえ | - |
| OAuthトークンエンドポイントURL | いいえ | - |
| OAuthスコープ | いいえ |
|
仕組み
**OpenAPI 仕様を解析します。**必要に応じて、
httpxとPyYAMLを使用して OpenAPI 仕様を読み込みます。操作を登録します。API操作を抽出し、適切な入力および応答スキーマを持つ MCP 互換ツールを生成します。
リソース登録: OpenAPI コンポーネント スキーマを、割り当てられた URI (例:
/resource/{name}) を持つリソース オブジェクトに自動的に変換します。プロンプト生成: API 操作に基づいてコンテキスト プロンプトを作成し、LLM が API の使用状況を理解できるようにします。
**認証:**クライアント資格情報フローによる OAuth2 認証をサポートします。
**パラメータ処理:**パラメータを必要なデータ型に変換し、柔軟なクエリ文字列と JSON 形式をサポートします。
**JSON-RPC 2.0 準拠:**ツールの相互作用のための標準通信プロトコルを保証します。
sequenceDiagram
participant LLM as LLM (Claude/GPT)
participant MCP as OpenAPI-MCP Proxy
participant API as External API
Note over LLM, API: Communication Process
LLM->>MCP: 1. Initialize (initialize)
MCP-->>LLM: Metadata, tools, resources, and prompts
LLM->>MCP: 2. Request tools (tools_list)
MCP-->>LLM: Detailed list of tools, resources, and prompts
LLM->>MCP: 3. Call tool (tools_call)
alt With OAuth2
MCP->>API: Request OAuth2 token
API-->>MCP: Access Token
end
MCP->>API: 4. Execute API call with proper formatting
API-->>MCP: 5. API response (JSON)
alt Type Conversion
MCP->>MCP: 6. Convert parameters to correct data types
end
MCP-->>LLM: 7. Formatted response from API
alt Dry Run Mode
LLM->>MCP: Call with dry_run=true
MCP-->>LLM: Display request information without executing call
endリソースとプロンプト
ツールに加えて、プロキシ サーバーは次のものを自動的に登録するようになりました。
リソース: OpenAPI コンポーネント スキーマから派生したリソース オブジェクトは、構造化データ処理のために定義された URI (例:
/resource/{name}) に登録されます。プロンプト: API 操作に基づいてコンテキスト プロンプトが生成され、LLM に使用ガイドが提供され、利用可能なエンドポイントの理解が向上します。
この拡張メタデータは、包括的な API コンテキストを提供することで統合を改善します。

貢献
このリポジトリをフォークします。
新しいブランチを作成します。
変更内容を明確に説明したプル リクエストを送信します。
ライセンス
役に立つと思ったら、GitHub で ⭐ を付けてください。
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.
Related MCP Servers
- Alicense-qualityFmaintenanceA standalone proxy that transforms any OpenAPI or Swagger-described REST API into an MCP server by mapping API operations to executable MCP tools. It enables AI clients to interact with existing web services through automated HTTP requests based on their official documentation.Last updated1316MIT
- Alicense-qualityDmaintenanceA universal MCP server that connects any REST API to AI assistants via OpenAPI or Postman specifications. It enables dynamic tool creation with GraphQL-style field selection and automatic schema inference for efficient data retrieval.Last updated475Inno Setup
- Alicense-qualityBmaintenanceTurns any OpenAPI specification into a fully working MCP server with a single command, enabling AI agents to call APIs without writing any glue code.Last updated27MIT
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
Free public MCP for AI agents — 193 tools, 44 workflows. No API key.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/gujord/OpenAPI-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server