@abhishekkumar00019/swagger-mcp
@abhishekkumar00019/swagger-mcp
Swagger 2.0 または OpenAPI 3.x の仕様をその場で呼び出し可能な MCP ツールに変換する、動的な Model Context Protocol (MCP) サーバーです。
任意の OpenAPI/Swagger JSON または YAML 仕様 URL を指定すると、すべての API エンドポイントが自動的に Claude、Copilot、ChatGPT、Cursor、Windsurf、その他の MCP 対応クライアント向けの対話型ツールになります。
✨ 機能
🔄 動的ツール生成 — 起動時に Swagger 2.0 および OpenAPI 3.x の仕様を自動的に解析します。
🛠️ ゼロボイラープレート — 仕様 URL を指定するだけで、すべてのエンドポイントが即座に MCP ツールとして公開されます。
🔐 柔軟な認証サポート — Bearer トークン、API キー、Basic 認証を環境変数や CLI フラグで簡単に設定できます。
🌐 スマートなベース URL 解決 — 設定 → スペックのサーバー定義 → スペックのオリジン URL の順にベース URL を自動的に導出します。
🔁 ホットリロード — 実行時に
_swagger_mcp_reloadツールを使用して、スペックをライブで再取得・再解析します。📝 リッチなスキーマと説明 — OpenAPI のパラメータとリクエストボディを厳密な JSON スキーマに変換し、正確な LLM ツール呼び出しを実現します。
⏱️ 設定可能なタイムアウトとカスタムヘッダー — カスタムリクエストヘッダーとリクエストタイムアウトのしきい値を簡単に設定できます。
Related MCP server: Swagger to MCP
🚀 クイックスタート
オプション A: npx 経由で直接(インストール不要)
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json npx @abhishekkumar00019/swagger-mcpオプション B: グローバル NPM インストール
npm install -g @abhishekkumar00019/swagger-mcp
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json swagger-mcpオプション C: ローカルリポジトリのセットアップ
クローンと依存関係のインストール:
git clone https://github.com/itachiuchihadev/swagger-mcp.git cd swagger-mcp npm installプロジェクトのビルド:
npm run buildローカルで実行:
SWAGGER_MCP_SPEC_URL=https://petstore.swagger.io/v2/swagger.json node dist/index.js
⚙️ MCP クライアント設定
以下は、npx @abhishekkumar00019/swagger-mcp を使用した一般的な MCP クライアントの設定例です。
1. Claude Desktop
claude_desktop_config.json に追加します:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json",
"SWAGGER_MCP_BEARER_TOKEN": "your-api-token-here"
}
}
}
}2. Claude Code (CLI)
Claude Code CLI から直接追加します:
claude mcp add swagger-mcp -- npx -y @abhishekkumar00019/swagger-mcp --spec-url https://petstore.swagger.io/v2/swagger.jsonまたは、プロジェクトルートの .mcp.json に追加します:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}3. GitHub Copilot / VS Code
ワークスペースまたはグローバル VS Code 設定の .vscode/mcp.json に追加します:
{
"server": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json",
"SWAGGER_MCP_API_KEY": "your-api-key"
}
}
}
}4. Cursor
.cursor/mcp.json に追加するか、Cursor 設定 → 機能 → MCP で設定します:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}5. Windsurf
~/.codeium/windsurf/mcp_config.json に追加します:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}6. Roo Code / Cline(VS Code 拡張機能)
cline_mcp_settings.json(または roo_code_mcp_settings.json)に追加します:
{
"mcpServers": {
"swagger-mcp": {
"command": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"],
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}7. ChatGPT & OpenAI (Custom GPTs / Assistants / API)
OpenAPI 仕様の直接インポート(ネイティブ Custom GPT アクション): ChatGPT Custom GPT は OpenAPI 仕様をネイティブにサポートしています。中間サーバーを必要とせず、Custom GPT Builder の Actions セクションに Swagger/OpenAPI JSON/YAML 仕様 URL を直接インポートできます。
MCP HTTP/SSE ゲートウェイ経由:
ChatGPT または OpenAI エージェントを HTTP/SSE ブリッジ(例: supergateway や mcp-remote)経由でこの MCP サーバーに接続する場合は、SSE プロキシを使用して swagger-mcp を起動します:
npx supergateway --stdio "npx -y @abhishekkumar00019/swagger-mcp --spec-url https://petstore.swagger.io/v2/swagger.json" --port 80008. Zed Editor
~/.config/zed/settings.json に追加します:
{
"context_servers": {
"swagger-mcp": {
"command": {
"path": "npx",
"args": ["-y", "@abhishekkumar00019/swagger-mcp"]
},
"env": {
"SWAGGER_MCP_SPEC_URL": "https://petstore.swagger.io/v2/swagger.json"
}
}
}
}🔧 設定リファレンス
すべての設定パラメータは、環境変数または CLI 引数で指定できます。SWAGGER_MCP_SPEC_URL が唯一の必須パラメータです。
環境変数 | CLI 引数 | 必須 | デフォルト | 説明 |
|
| はい | — | Swagger/OpenAPI 仕様 URL |
|
| いいえ | 自動導出 | ターゲット API のベース URL を上書き |
|
| いいえ | — |
|
|
| いいえ | — | API キーのヘッダー値 |
|
| いいえ |
| API キーのカスタムヘッダー名 |
|
| いいえ | — | Basic 認証のユーザー名 |
|
| いいえ | — | Basic 認証のパスワード |
|
| いいえ |
| HTTP リクエストのタイムアウト(ミリ秒) |
|
| いいえ |
| JSON 文字列としての追加 HTTP ヘッダー |
🔑 認証例
複数の認証方法を同時に設定できます:
# Bearer Token
SWAGGER_MCP_BEARER_TOKEN=sk-your-token-here
# API Key (Custom Header)
SWAGGER_MCP_API_KEY=your-api-key
SWAGGER_MCP_API_KEY_HEADER=X-Custom-Key
# Basic Auth
SWAGGER_MCP_BASIC_USER=admin
SWAGGER_MCP_BASIC_PASS=secret123[!NOTE] Bearer と Basic 認証の両方が指定されている場合、Basic 認証が
Authorizationヘッダーを上書きします。複数のヘッダーが必要な場合は、Bearer トークンと API キーヘッダーを組み合わせてください。
🏷️ ツール命名規則
OpenAPI 仕様のエンドポイントは、次の優先順位で MCP ツールに変換されます:
優先度 | ソース | 例 |
第1 | 仕様で定義された |
|
第2 | タグ + メソッド + パス |
|
第3 | メソッド + パス |
|
🧰 組み込みメタツール
ツール | 説明 |
| Swagger 仕様をライブで再取得・再解析します。サーバーを再起動せずに API を開発・更新する際に便利です。 |
📁 プロジェクト構成
swagger-mcp/
├── package.json
├── tsconfig.json
├── src/
│ ├── index.ts # Entry point & CLI argument parser
│ ├── server.ts # MCP server initialization & tool registration
│ ├── swagger-parser.ts # OpenAPI 2.0/3.x spec fetcher & parser
│ ├── tool-builder.ts # Converts OpenAPI operations -> JSON Schema tools
│ ├── request-handler.ts # Proxies MCP tool calls to HTTP endpoints
│ ├── auth.ts # Authentication header builder
│ ├── config.ts # Environment & CLI configuration manager
│ └── types.ts # Shared TypeScript interfaces
└── dist/ # Compiled JavaScript output📄 ライセンス
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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 Connectors
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
MCP server for AI access to Swagger by SmartBear.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceDynamically generates MCP tools from Swagger/OpenAPI specifications by extracting swagger.json files at runtime. Enables natural language interaction with any REST API that has Swagger documentation.-
- AlicenseNot gradedqualityNot gradedmaintenanceAutomatically converts Swagger/OpenAPI specifications into dynamic MCP tools, enabling interaction with any REST API through natural language by loading specs from local files or URLs.-
- FlicenseNot gradedqualityDmaintenanceDynamically converts any API with an OpenAPI v3 specification into MCP tools for AI assistants. It supports multiple authentication methods including OAuth2, Bearer tokens, and API keys for flexible integration.-
- AlicenseNot gradedqualityCmaintenanceConverts any OpenAPI/Swagger API specification into MCP tools that AI assistants can use to interact with the API.377MIT
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/itachiuchihadev/swagger_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server