MCP-OpenAPI
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実行している場合):
{
"mcpServers": {
"todos": {
"command": "uvx",
"args": [
"mcp-openapi",
"--openapi-url=http://localhost:8000/openapi.json",
"stdio"
]
}
}
}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 deployed
Maintenance
Related MCP Connectors
MCP server for AI access to Swagger by SmartBear.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA 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.171 npm115Apache 2.0
- AlicenseAqualityDmaintenanceA Model Context Protocol server that enables AI assistants to make HTTP requests (GET, POST, PUT, DELETE) to external APIs through standardized MCP tools.42MIT
- FlicenseNot gradedqualityDmaintenanceAutomatically converts any OpenAPI specification into an MCP server, exposing all HTTP endpoints as callable tools with support for various authentication methods and request types.2-
- AlicenseCqualityCmaintenanceMCP server that turns OpenAPI specs into tools and calls API123 npm5MIT