Integrations
MCP-OpenAPI
OpenAPI 仕様からの HTTP メソッドをツールとして公開するモデル コンテキスト プロトコルサーバー。
[!警告] これは概念実証であり、まだ完全にテストおよび文書化されていません。
使用法
各MCP-OpenAPIサーバーは、単一のOpenAPI仕様からの操作を公開します。複数のインスタンスを実行して複数の仕様を公開することもできます。
このパッケージはPyPI @ [ mcp-openapi
][pypi]で入手できます。uvx uvx mcp-openapi --openapi-url https://httpbin.org/spec.json (sse | stdio)
でサーバーを起動できます。
Claude の設定例 (ポート 8000 でfastapi dev tests/todos.py
実行している場合):
OpenAPI URL は、環境変数MCP_OPENAPI_URL
として渡すこともできます。
SSE として実行する場合、次のようにサーバーを構成できます。
--fastmcp-sse-host
- MCPサーバーを提供するホスト--fastmcp-sse-port
- MCPサーバーを提供するポート
追加のグローバル オプションがあります:
--fastmcp-debug
- MCP サーバーのデバッグ モードを有効にする--fastmcp-log-level
- MCP サーバーのログレベル
これらは、 FASTMCP_
プレフィックスを使用して環境変数で設定することもできます (例: FASTMCP_LOG_LEVEL=DEBUG
)。
仕組み
- MCP-OpenAPI サーバーは、OpenAPI 仕様 URL で初期化されます。
- サーバーは OpenAPI 仕様を取得して解析し、各パス操作をツールとして登録します。
- 登録されたツールを使用して FastMCP サーバーが起動されます。
- クライアントがツールを要求すると、MCP サーバーは API に HTTP 要求を送信し、応答を返します。
サポートされているOpenAPI/Swaggerバージョン
スワガー 2.0 | オープンAPI 3.0 | オープンAPI 3.1 |
---|---|---|
:x: | :heavy_check_mark: | :heavy_check_mark: |
このパッケージは、JSON および YAML 形式で OpenAPI 3.0 および 3.1 仕様をサポートしています。
私たちは、内部的にopenapi-parserを使用しており、これは非常に包括的で、外部仕様への参照の解決をサポートしています。
将来の構成オプション
[!INFO] これらはまだ実装されていません。
エンドポイントの制限
デフォルトでは、すべてのエンドポイントがツールとして公開されます。公開するエンドポイントを制限することができます。
- パスパターンによって、
- HTTPメソッドでは、
- 公開する個々の操作を明示的にリストし、
- OpenAPI タグを使用してルートを選択します。
API認証の処理
MCP-OpenAPI はターゲット API に API リクエストを送信します。グローバル認証トークンを使用できます。
--auth-token
- OpenAPI 仕様に応じて使用されるベアラー トークン、または base64 形式の基本資格情報。
さまざまな認証トークン (クライアント ユーザーごとなど) を使用してリクエストを生成できるが、LLM にトークンを認識させないことができれば便利です。未定。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
OpenAPI 仕様で定義された HTTP メソッドをツールとして公開し、モデル コンテキスト プロトコルを介して API との対話を可能にする MCP サーバー。
Related Resources
Related MCP Servers
- -securityAlicense-qualityMCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.Last updated -43TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server implementation that enables connection between OpenAI APIs and MCP clients for coding assistance with features like CLI interaction, web API integration, and tool-based architecture.Last updated -9Python
- -securityAlicense-qualityA server that enables interaction with any API that has a Swagger/OpenAPI specification through Model Context Protocol (MCP), automatically generating tools from API endpoints and supporting multiple authentication methods.Last updated -11TypeScriptApache 2.0
- -securityAlicense-qualityA server that translates Model Context Protocol (MCP) tool callings to traditional HTTP API requests, allowing existing HTTP APIs to be integrated into MCP territory through configurable mappings.Last updated -PythonApache 2.0