VS

vizioz/swagger-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

168 stars 26 forks 品質 63 トレンド 17MIT

vizioz/swagger-mcpは、https://github.com/vizioz/swagger-mcp.からインポートされたMCPサーバー候補です。

概要

vizioz/swagger-mcpは、https://github.com/vizioz/swagger-mcp.からインポートされたMCPサーバー候補です。

概要(AI 翻訳)

Swagger仕様に接続し、AIがそのサービス用のMCPサーバーを生成するために必要なすべてのモデルを構築するのを支援するMCPサーバーです。

特徴

  • Swagger仕様をダウンロードし、より速い参照のためにローカルに保存します。
  • すべてのエンドポイントとそのHTTPメソッドおよび記述のリストを返します
  • すべてのモデルのリストを返します
  • モデルを返す
  • 終点に接続するための返送サービス
  • MCP関数定義を返す
  • 完全なMCPツール定義を、完全なスキーマ情報で生成します
  • ツール説明にAI固有の指示を含める

前提条件

  • Node.js(v14以上)
  • NPMまたは糸

設置

  1. リポジトリのクローン:

  2. 依存関係のインストール:

  3. .env.exampleファイルに基づく.envファイルを作成する:

  4. .envファイルの更新。

構成

.envファイルを編集してアプリケーションを設定してください:

  • PORT:サーバーが動作するポート(デフォルト:3000)
  • NODE_ENV:環境(開発、生産、テスト)
  • LOG_LEVEL:ログレベル(情報、エラー、デバッグ)

使用法

アプリケーションの構築

アプリケーションを構築する:

これにより、TypeScriptのコードがMCPサーバーとして使えるようにコンパイルされます

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Swagger MCP

An MCP server that connects to a Swagger specification and helps an AI to build all the required models to generate a MCP server for that service.

Features

  • Downloads a Swagger specification and stores it locally for faster reference.
  • Returns a list of all the endpoints and their HTTP Methods and descriptions
  • Returns a list of all the models
  • Returns a model
  • Returns service to connect to the end point
  • Returns MCP function definitions
  • Generates complete MCP tool definitions with full schema information
  • Includes AI-specific instructions in tool descriptions

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn

Installation

  1. Clone the repository:
git clone https://github.com/readingdancer/swagger-mcp.git
cd swagger-mcp
  1. Install dependencies:
npm install
  1. Create a .env file based on the .env.example file:
cp .env.example .env
  1. Update the .env file.

Configuration

Edit the .env file to configure the application:

  • PORT: The port on which the server will run (default: 3000)
  • NODE_ENV: The environment (development, production, test)
  • LOG_LEVEL: Logging level (info, error, debug)

Usage

Building the application

Build the application:

npm run build

This will compile the TypeScript code ready to be used as an MCP Server

Running as an MCP Server

To run as an MCP server for integration with Cursor and other applications:

node build/index.js

You can also provide a Swagger URL via CLI argument:

node build/index.js --swagger-url="https://petstore.swagger.io/v2/swagger.json"

Or using the alternative format:

node build/index.js --swaggerUrl="https://petstore.swagger.io/v2/swagger.json"

Note: The CLI --swagger-url argument takes priority over the swaggerFilePath parameter in tool calls. If both are provided, the CLI argument will be used.

Using the MCP Inspector

To run the MCP inspector for debugging:

npm run inspector

Adding to Cursor

To add this MCP server to Cursor:

  1. Open Cursor Settings > Features > MCP
  2. Click “+ Add New MCP Server”
  3. Enter a name for the server (e.g., “Swagger MCP”)
  4. Select “stdio” as the transport type
  5. Enter the command to run the server:
    • Basic: node path/to/swagger-mcp/build/index.js
    • With Swagger URL: node path/to/swagger-mcp/build/index.js --swagger-url="https://your-api-url/swagger.json"
  6. Click “Add”

The Swagger MCP tools will now be available to the Cursor Agent in Composer.

Tip: If you provide the --swagger-url CLI argument when configuring the server, you won’t need to provide swaggerFilePath in tool calls, making the tools easier to use.

Available Swagger MCP Tools

The following tools are available through the MCP server:

  • getSwaggerDefinition: Downloads a Swagger definition from a URL
  • listEndpoints: Lists all endpoints from the Swagger definition (optional swaggerFilePath)
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →