Swagger Explorer MCP

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.

Integrations

  • Enables the analysis and exploration of Swagger/OpenAPI specifications, including examining API endpoints, schemas, and response formats

Swagger エクスプローラー MCP

Claude を通じて Swagger/OpenAPI 仕様を調査および分析するための管理コントロール プレーン (MCP) サーバー。

クイックスタート

npx を使用してグローバルにインストールして実行します。

npx -y @johnneerdael/swagger-mcp

または環境変数を使用してインストールします:

npx -y @johnneerdael/swagger-mcp \ --env BASE_URL=/api \ --env AUTH_TOKEN=your-token \ --env PORT=3000

Claude Desktopのインストール

  1. クロードデスクトップを開く
  2. 設定(歯車アイコン)をクリックします
  3. 「ツールと統合」を選択
  4. 「MCPサーバーを追加」をクリックします
  5. 以下を入力してください:
    Name: Swagger Explorer Command: npx -y @johnneerdael/swagger-mcp Arguments: --swagger-url=$SWAGGER_URL
  6. 「インストール」をクリック

クロードとの使用

以下に、クロードとのやり取りの例をいくつか示します。

基本的なSwaggerの探索

Human: Can you explore the Swagger documentation at http://localhost:8080/docs? Claude: I'll help you explore that Swagger documentation using the Swagger Explorer MCP. Let me analyze the API endpoints and schemas for you: [Claude would then use the MCP to fetch and analyze the Swagger documentation]

特定のエンドポイントの分析

Human: What are the available response schemas for the /pets POST endpoint? Claude: I'll check the response schemas for that endpoint using the MCP. [Claude would use the MCP to fetch specific endpoint details]

スキーマ分析

Human: Can you show me the detailed structure of the Pet schema? Claude: I'll retrieve the detailed schema information using the MCP. [Claude would use the MCP to analyze the schema structure]

特徴

  1. 認証サポート
    • ベアラートークン認証
    • 環境変数で設定可能
  2. カスタムレスポンスフォーマット
    • 最小限のフォーマット: null/空の値を削除します
    • 詳細形式: メタデータとタイムスタンプを含む
    • 生の形式: 変更されていない応答
  3. スキーマ分析
    • 詳細な物件調査
    • 応答スキーマ分析
    • スキーマ関係
  4. API探索
    • パスリスト
    • メソッドフィルタリング
    • 回答形式の分析

構成

環境変数:

  • BASE_URL : APIのベースパス(デフォルト: '')
  • AUTH_TOKEN : 認証用のベアラートークン
  • PORT : サーバーポート(デフォルト: 3000)
  • SWAGGER_URL : デフォルトのSwaggerドキュメントURL

APIエンドポイント

APIを探索する

curl -X POST http://localhost:3000/api/explore \ -H "Authorization: Bearer your-token" \ -H "Content-Type: application/json" \ -d '{ "url": "http://your-swagger-url", "options": { "paths": true, "schemas": true } }'

スキーマの詳細を取得する

curl -X POST http://localhost:3000/api/schema-details \ -H "Authorization: Bearer your-token" \ -H "Content-Type: application/json" \ -d '{ "url": "http://your-swagger-url", "schemaName": "Pet" }'

レスポンススキーマを取得する

curl -X POST http://localhost:3000/api/response-schemas \ -H "Authorization: Bearer your-token" \ -H "Content-Type: application/json" \ -d '{ "url": "http://your-swagger-url", "path": "/pets", "method": "post" }'

応答形式

最小限のフォーマット

{ "status": "success", "data": { // Only non-null values } }

詳細なフォーマット

{ "status": "success", "timestamp": "2025-01-29T10:00:00.000Z", "data": { // Full response }, "metadata": { "version": "1.0", "format": "detailed" } }

一般的な使用例

  1. APIドキュメントレビュー
    Human: Can you summarize all the available endpoints and their purposes?
  2. スキーマ検証
    Human: What fields are required for creating a new pet?
  3. 応答分析
    Human: What are the possible error responses for the login endpoint?
  4. 統合計画
    Human: How should I structure my request to create a new order?

トラブルシューティング

  1. 接続の問題
    • Swagger URL にアクセスできることを確認する
    • 認証トークンが正しいか確認する
    • ポートが使用されていないことを確認してください
  2. 認証エラー
    • AUTH_TOKENが正しく設定されていることを確認する
    • リクエストにベアラートークンが含まれていることを確認する
  3. スキーマが見つかりません
    • スキーマ名が完全に一致しているかどうかを確認する
    • Swagger仕様が正しくロードされていることを確認する

セキュリティノート

  1. AUTH_TOKENが設定されている場合、MCPは認証を必要とする
  2. すべてのリクエストはデバッグのために記録されます
  3. 機密情報はキャッシュされません
  4. 不正使用を防ぐためにレート制限が適用されます

発達

貢献または変更するには:

  1. リポジトリをクローンする
  2. 依存関係をインストールします:
    npm install
  3. 建てる:
    npm run build
  4. ローカルで実行:
    npm start

ライセンス

MITライセンス - 詳細はLICENSEファイルを参照

-
security - not tested
F
license - not found
-
quality - not tested

ユーザーが Swagger/OpenAPI 仕様を探索および分析できるようにする管理コントロール プレーン サーバー。エンドポイント探索、スキーマ分析、カスタマイズ可能な応答フォーマットなどの機能を提供し、認証と Claude などのツールとの統合をサポートします。

  1. Quick Start
    1. Installation for Claude Desktop
      1. Usage with Claude
        1. Basic Swagger Exploration
        2. Analyzing Specific Endpoints
        3. Schema Analysis
      2. Features
        1. Configuration
          1. API Endpoints
            1. Explore API
            2. Get Schema Details
            3. Get Response Schemas
          2. Response Formats
            1. Minimal Format
            2. Detailed Format
          3. Common Use Cases
            1. Troubleshooting
              1. Security Notes
                1. Development
                  1. License
                    ID: 1z0w1koqpv