
tyktechnologies/api-to-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
tyktechnologies/api-to-mcp は [https://github.com/tyktechnologies/api-to-mcp.] からインポートされた MCP サーバーの候補です
概要
tyktechnologies/api-to-mcp は [https://github.com/tyktechnologies/api-to-mcp.] からインポートされた MCP サーバーの候補です
概要(AI 翻訳)
OpenAPI/Swagger 仕様から MCP (Model Context Protocol) サーバーを作成するツールで、AI アシスタントが API とやり取りできるようにします。 特定のAPIまたはサービスのためにあなた自身の決め付けられ、カスタマイズされたMCPsを作成して下さい。
概要
このプロジェクトは、OpenAPI 仕様を MCP ツールに変える動的 MCP サーバーを作成します。 REST API と AI アシスタントのシームレスな統合をモデルコンテキストプロトコルで実現し、任意の API を AI に接続可能なツールに変えます。
##特徴
- ファイルまたはHTTP/HTTPS URLからOpenAPIの動的読み込み
- ファイルや HTTP/HTTPS URL から読み込まれた OpenAPI オーバーレイのサポート
- MCP ツールへの OpenAPI 操作のカスタマイズ可能なマッピング
- 操作の高度なフィルタリングId と URL パスの両方の glob パターンを使用して
- フォーマット保存と位置メタデータによる包括的なパラメーター処理
- API認証処理
- MCP サーバーを構成するために使用されるOpenAPIメタデータ(タイトル、バージョン、説明)
- 階層説明フォールバック(操作説明→操作要約→パス要約)
- 環境変数とCLIによるカスタムHTTPヘッダーのサポート
- API 要求の追跡および同一証明のための X-MCP ヘッダー
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
OpenAPI to MCP Server
A tool that creates MCP (Model Context Protocol) servers from OpenAPI/Swagger specifications, enabling AI assistants to interact with your APIs. Create your own branded and customized MCPs for specific APIs or services.
Overview
This project creates a dynamic MCP server that transforms OpenAPI specifications into MCP tools. It enables seamless integration of REST APIs with AI assistants via the Model Context Protocol, turning any API into an AI-accessible tool.
Features
- Dynamic loading of OpenAPI specs from file or HTTP/HTTPS URLs
- Support for OpenAPI Overlays loaded from files or HTTP/HTTPS URLs
- Customizable mapping of OpenAPI operations to MCP tools
- Advanced filtering of operations using glob patterns for both operationId and URL paths
- Comprehensive parameter handling with format preservation and location metadata
- API authentication handling
- OpenAPI metadata (title, version, description) used to configure the MCP server
- Hierarchical description fallbacks (operation description → operation summary → path summary)
- Custom HTTP headers support via environment variables and CLI
- X-MCP header for API request tracking and identification
- Support for custom
x-mcpextensions at the path level to override tool names and descriptions
Using with AI Assistants
This tool creates an MCP server that allows AI assistants to interact with APIs defined by OpenAPI specifications. The primary way to use it is by configuring your AI assistant to run it directly as an MCP tool.
Setting Up in Claude Desktop
-
Ensure you have Node.js installed on your computer
-
Open Claude Desktop and navigate to Settings > Developer
-
Edit the configuration file (or it will be created if it doesn’t exist):
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add this configuration (customize as needed):
{
"mcpServers": {
"api-tools": {
"command": "npx",
"args": [
"-y",
"@tyk-technologies/api-to-mcp@latest",
"--spec",
"https://petstore3.swagger.io/api/v3/openapi.json"
],
"enabled": true
}
}
}
- Restart Claude Desktop
- You should now see a hammer icon in the chat input box. Click it to access your API tools.
Customizing the Configuration
You can adjust the args array to customize your MCP server with various options:
{
"mcpServers": {
"my-api": {
"command": "npx",
"args": [
"-y",
"@tyk-technologies/api-to-mcp@latest",
"--spec",
"./path/to/your/openapi.json",
"--overlays",
"./path/to/overlay.json,https://example.com/api/overlay.json",
"--whitelist",
"getPet*,POST:/users/*",
"--targetUrl",
"https://api.example.com"
],
インストール
npx -y @tyk-technologies/api-to-mcp@latest --spec https://petstore3.swagger.io/api/v3/openapi.json設定
{
"mcpServers": {
"api-tools": {
"command": "npx",
"args": [
"-y",
"@tyk-technologies/api-to-mcp@latest",
"--spec",
"https://petstore3.swagger.io/api/v3/openapi.json"
],
"enabled": true
}
}
}