Swagger to MCP
Converts Swagger/OpenAPI specifications into dynamic MCP tools, automatically generating endpoints with input/output schema validation for any API documented with OpenAPI/Swagger format.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Swagger to MCP Server
Convert any Swagger/OpenAPI specification into a dynamic Model Context Protocol (MCP) server.
Features
π Automatically generates MCP tools from Swagger/OpenAPI specs
π Supports both local files (.yaml, .yml, .json) and remote URLs
β Built-in JSON schema validation using AJV
π Dynamic endpoint mapping with path parameters
πͺΆ Generates MCP manifest (mcp.json) for easy integration
Installation
pnpm installUsage
Start the MCP server
pnpm startOr with a custom Swagger file:
node server.js --swagger=./path/to/your/spec.yamlGenerate manifest only (without starting server)
node server.js --swagger=./petstore.yaml --manifest-onlyUse a remote Swagger URL
node server.js --swagger=https://petstore.swagger.io/v2/swagger.jsonConfiguration
Create a .env file to configure the server:
MCP_PORT=4000How It Works
Load Swagger/OpenAPI spec - From local file or URL
Parse endpoints - Extract all paths and operations
Generate MCP tools - Each endpoint becomes an MCP tool with:
Input schema validation
Output schema definition
HTTP request handler
Start MCP server - Listen on configured port and handle tool requests
Example
The included petstore.yaml provides a simple example:
openapi: 3.0.1
info:
title: Swagger Petstore
version: 1.0.0
servers:
- url: https://petstore.swagger.io/v2
paths:
/pet/{petId}:
get:
summary: Find pet by ID
operationId: getPetById
parameters:
- name: petId
in: path
required: true
schema:
type: integer
responses:
'200':
description: successful operationThis generates an MCP tool that can fetch pet information by ID.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
Related MCP Connectors
Point Gecko at an OpenAPI spec; get first-call-correct, auth-hidden agent tools.
Convert, lint and generate LLM tool schemas for OpenAI, Anthropic, Gemini and MCP
MCP server for AI access to Swagger by SmartBear.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.