OpenAPI MCP Server
OpenAPI MCP サーバー
OpenAPIエンドポイントをMCPリソースとして公開するモデルコンテキストプロトコル(MCP)サーバー。このサーバーにより、大規模言語モデルはMCPプロトコルを介してOpenAPI仕様で定義されたREST APIを検出し、操作できるようになります。
概要
この MCP サーバーは、次の 2 つのトランスポート方法をサポートしています。
Stdio トランスポート(デフォルト): 標準入出力を介して MCP 接続を管理する Claude Desktop などの AI システムと直接統合します。
ストリーミング可能な HTTP トランスポート: HTTP 経由でサーバーに接続し、Web クライアントやその他の HTTP 対応システムが MCP プロトコルを使用できるようにします。
Related MCP server: MCP OpenAPI Server
ユーザー向けクイックスタート
オプション 1: Claude Desktop (Stdio トランスポート) を使用する
このリポジトリをクローンする必要はありません。Claude Desktop をこの MCP サーバーを使用するように設定するだけで済みます。
Claude Desktop 構成ファイルを見つけるか作成します。
macOSの場合:
~/Library/Application Support/Claude/claude_desktop_config.json
次の構成を追加します。
{
"mcpServers": {
"openapi": {
"command": "npx",
"args": ["-y", "@ivotoby/openapi-mcp-server"],
"env": {
"API_BASE_URL": "https://api.example.com",
"OPENAPI_SPEC_PATH": "https://api.example.com/openapi.json",
"API_HEADERS": "Authorization:Bearer token123,X-API-Key:your-api-key"
}
}
}
}環境変数を実際の API 構成に置き換えます。
API_BASE_URL: APIのベースURLOPENAPI_SPEC_PATH: OpenAPI 仕様への URL またはパスAPI_HEADERS: API認証ヘッダーのコンマ区切りのキーと値のペア
オプション 2: HTTP クライアント (HTTP トランスポート) で使用する
HTTP クライアントでサーバーを使用するには:
インストールは不要です!npx を使用してパッケージを直接実行します。
npx @ivotoby/openapi-mcp-server \
--api-base-url https://api.example.com \
--openapi-spec https://api.example.com/openapi.json \
--headers "Authorization:Bearer token123" \
--transport http \
--port 3000HTTP リクエストを使用してサーバーと対話します。
# Initialize a session (first request)
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"client":{"name":"curl-client","version":"1.0.0"},"protocol":{"name":"mcp","version":"2025-03-26"}}}'
# The response includes a Mcp-Session-Id header that you must use for subsequent requests
# and the InitializeResult directly in the POST response body.
# Send a request to list tools
# This also receives its response directly on this POST request.
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Mcp-Session-Id: your-session-id" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
# Open a streaming connection for other server responses (e.g., tool execution results)
# This uses Server-Sent Events (SSE).
curl -N http://localhost:3000/mcp -H "Mcp-Session-Id: your-session-id"
# Example: Execute a tool (response will arrive on the GET stream)
# curl -X POST http://localhost:3000/mcp \
# -H "Content-Type: application/json" \
# -H "Mcp-Session-Id: your-session-id" \
# -d '{"jsonrpc":"2.0","id":2,"method":"tools/execute","params":{"name":"yourToolName", "arguments": {}}}'
# Terminate the session when done
curl -X DELETE http://localhost:3000/mcp -H "Mcp-Session-Id: your-session-id"輸送タイプ
標準入出力トランスポート(デフォルト)
stdioトランスポートは、標準入出力を介してMCP接続を管理するClaude DesktopなどのAIシステムと直接統合するために設計されています。これは最もシンプルなセットアップであり、ネットワーク設定は必要ありません。
使用する場合: Claude Desktop または stdio ベースの MCP 通信をサポートする他のシステムと統合する場合。
ストリーミング可能なHTTPトランスポート
HTTPトランスポートにより、MCPサーバーにHTTP経由でアクセスすることが可能になり、Webアプリケーションやその他のHTTP対応クライアントがMCPプロトコルとやり取りできるようになります。セッション管理、ストリーミングレスポンス、標準HTTPメソッドをサポートしています。
主な機能:
Mcp-Session-Idヘッダーによるセッション管理
initializeおよびtools/list要求に対する HTTP 応答は、POST で同期的に送信されます。その他のサーバーからクライアントへのメッセージ (例:
tools/execute結果、通知) は、Server-Sent Events (SSE) を使用して GET 接続を介してストリーミングされます。POST/GET/DELETEメソッドのサポート
使用する場合: MCP サーバーを、stdio ではなく HTTP 経由で通信する Web クライアントまたはシステムに公開する必要がある場合。
設定オプション
サーバーは、環境変数またはコマンドライン引数を使用して構成できます。
環境変数
API_BASE_URL- APIエンドポイントのベースURLOPENAPI_SPEC_PATH- OpenAPI 仕様へのパスまたは URLAPI_HEADERS- APIヘッダーのコンマ区切りのキーと値のペアSERVER_NAME- MCP サーバーの名前 (デフォルト: "mcp-openapi-server")SERVER_VERSION- サーバーのバージョン(デフォルト: "1.0.0")TRANSPORT_TYPE- 使用するトランスポートタイプ: "stdio" または "http" (デフォルト: "stdio")HTTP_PORT- HTTPトランスポートのポート(デフォルト: 3000)HTTP_HOST- HTTPトランスポートのホスト(デフォルト: "127.0.0.1")ENDPOINT_PATH- HTTPトランスポートのエンドポイントパス(デフォルト: "/mcp")
コマンドライン引数
npx @ivotoby/openapi-mcp-server \
--api-base-url https://api.example.com \
--openapi-spec https://api.example.com/openapi.json \
--headers "Authorization:Bearer token123,X-API-Key:your-api-key" \
--name "my-mcp-server" \
--version "1.0.0" \
--transport http \
--port 3000 \
--host 127.0.0.1 \
--path /mcpセキュリティに関する考慮事項
HTTPトランスポートは、DNSリバインディング攻撃を防ぐためにOriginヘッダーを検証します。
デフォルトでは、HTTPトランスポートはローカルホスト(127.0.0.1)にのみバインドされます。
他のホストに公開する場合は、追加の認証を実装することを検討してください
デバッグ
デバッグ ログを表示するには:
Claude Desktop で stdio トランスポートを使用する場合:
ログはClaude Desktopのログに表示されます
HTTP トランスポートを使用する場合:
npx @ivotoby/openapi-mcp-server --transport http 2>debug.log
開発者向け
開発ツール
npm run build- TypeScriptソースをビルドするnpm run clean- ビルド成果物を削除しますnpm run typecheck- TypeScript の型チェックを実行しますnpm run lint- ESLint を実行するnpm run dev- ソースファイルを監視し、変更があったら再構築するnpm run inspect-watch- 変更時に自動リロードするインスペクターを実行します
開発ワークフロー
リポジトリをクローンする
依存関係をインストール:
npm install開発環境を起動します:
npm run inspect-watchsrc/内の TypeScript ファイルに変更を加えるサーバーは自動的に再構築され、再起動します
貢献
リポジトリをフォークする
機能ブランチを作成する
変更を加える
テストとリンティングを実行します:
npm run typecheck && npm run lintプルリクエストを送信する
ライセンス
マサチューセッツ工科大学
This server cannot be deployed
Maintenance
Related MCP Connectors
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
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
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.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol Server that enables LLMs to interact with and execute REST API calls through natural language prompts, supporting GET/PUT/POST/PATCH operations on configured APIs.6Apache 2.0
- AlicenseBqualityDmaintenanceA Model Context Protocol server that loads multiple OpenAPI specifications and exposes them to LLM-powered IDE integrations, enabling AI to understand and work with your APIs directly in development tools like Cursor.737 npm90MIT

MockLoop MCP Serverofficial
AlicenseNot gradedqualityAmaintenanceA Model Context Protocol server that generates and runs mock API servers from API documentation like OpenAPI/Swagger specs, enabling developers and AI assistants to quickly spin up mock backends for development and testing.17MIT- AlicenseDqualityDmaintenanceA Model Context Protocol server that enables LLMs to explore and interact with API specifications by providing tools for loading, browsing, and getting detailed information about API endpoints.431 npm14ISC