
vizioz/swagger-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
vizioz/swagger-mcp — это кандидат на сервер MCP, импортированный из https://github.com/vizioz/swagger-mcp.
Обзор
vizioz/swagger-mcp — это кандидат на сервер MCP, импортированный из https://github.com/vizioz/swagger-mcp.
Обзор (машинный перевод)
MCP-сервер, который подключается к спецификации Swagger и помогает ИИ создавать все необходимые модели для создания MCP-сервера для этого сервиса.
Особенности
- Скачает спецификацию Swagger и хранит её локально для более быстрого использования.
- Возвращает список всех конечных точек и их HTTP-методы и описания
- Возвращает список всех моделей
- Возвращает модель
- Возвращает сервис для подключения к конечной точке
- Возвращает определения функций MCP
- Генерирует полные определения инструментов MCP с полной информацией о схеме
- Включает инструкции, специфичные для ИИ, в описаниях инструментов
Предварительные требования
- Node.js (v14 или выше)
- NPM или пряжа
Установка
-
Клонировать репозиторий:
-
Установка зависимостей:
-
Создайте файл
.envна основе файла.env.example: -
Обновить файл
.env.
Конфигурация
Отредактировать файл .env для настройки приложения:
PORT: Порт, на котором будет работать сервер (по умолчанию: 3000)NODE_ENV: Окружающая среда (разработка, производство, тестирование)LOG_LEVEL: Уровень логирования (информация, ошибка, отладка)
Использование
Создание приложения
Создайте приложение:
Это скомпилирует код TypeScript, готовый к использованию в качестве MCP-сервера
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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
- Clone the repository:
git clone https://github.com/readingdancer/swagger-mcp.git
cd swagger-mcp
- Install dependencies:
npm install
- Create a
.envfile based on the.env.examplefile:
cp .env.example .env
- Update the
.envfile.
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:
- Open Cursor Settings > Features > MCP
- Click “+ Add New MCP Server”
- Enter a name for the server (e.g., “Swagger MCP”)
- Select “stdio” as the transport type
- 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"
- Basic:
- 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 URLlistEndpoints: Lists all endpoints from the Swagger definition (optionalswaggerFilePath)
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →