MCP Swagger Server
Automatically converts REST APIs with Swagger/OpenAPI documentation into MCP tools, making any documented API accessible to MCP-compatible clients. Supports authentication, SSL handling, and flexible configuration for seamless API integration.
What is MCP Swagger Server?
MCP Swagger Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to automatically converts rest apis with swagger/openapi documentation into mcp tools, making any documented api accessible to mcp-compatible clients. supports authentication, ssl handling, and flexible ...
Automatically converts REST APIs with Swagger/OpenAPI documentation into MCP tools, making any documented API accessible to MCP-compatible clients. Supports authentication, SSL handling, and flexible configuration for seamless API integration.
This server falls under the APIs and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Automatically converts REST APIs with Swagger/OpenAPI docume
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-swagger-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP Swagger Server
MCP Swagger Server automatically converts any REST API that has a Swagger or OpenAPI specification into a set of callable MCP tools, making documented APIs instantly accessible to AI assistants without writing any custom integration code. You point the server at an OpenAPI spec URL or file, and it dynamically generates tools for every operation defined in the spec, handling authentication, SSL, and base URL configuration. It supports stdio, SSE, and streamable HTTP transports and works with any MCP-compatible client.
Prerequisites
- Node.js 16 or later installed on your system
- A Swagger 2.0 or OpenAPI 3.x specification URL or local file for the API you want to expose
- An API key or Bearer token if the target API requires authentication
- An MCP-compatible client such as Claude Desktop or Cursor
Install mcp-swagger-server globally
Install the package globally to get the 'mss' and 'mcp-swagger-server' CLI commands available system-wide.
npm i mcp-swagger-server -gTest with a public OpenAPI spec
Verify the installation works by pointing the server at a public Swagger spec. This launches the interactive terminal interface.
mss --openapi https://petstore.swagger.io/v2/swagger.json \
--transport streamableConfigure with authentication for a private API
For APIs requiring a Bearer token, supply it via the --bearer-token flag or the API_TOKEN environment variable.
mss --openapi https://api.example.com/openapi.json \
--transport stdio \
--base-url https://api.example.com/v1 \
--auth-type bearer \
--bearer-token your-api-token-hereAdd to your MCP client configuration
Add the server to claude_desktop_config.json. Use environment variables for sensitive values like the API token rather than hardcoding them in the args array.
{
"mcpServers": {
"my-api": {
"command": "mss",
"args": [
"--openapi", "https://api.example.com/openapi.json",
"--transport", "stdio",
"--auth-type", "bearer"
],
"env": {
"API_TOKEN": "your-bearer-token-here",
"MCP_BASE_URL": "https://api.example.com/v1"
}
}
}
}Restart Claude Desktop and verify tools are loaded
Restart Claude Desktop. Ask Claude to list the available API tools — it should enumerate one tool per API operation defined in your OpenAPI spec.
MCP Swagger Server Examples
Client configuration
Claude Desktop config running mcp-swagger-server against a private API with Bearer token authentication via environment variable.
{
"mcpServers": {
"my-api": {
"command": "mss",
"args": [
"--openapi",
"https://api.example.com/openapi.json",
"--transport",
"stdio",
"--auth-type",
"bearer"
],
"env": {
"API_TOKEN": "your-bearer-token-here",
"MCP_BASE_URL": "https://api.example.com/v1"
}
}
}
}Prompts to try
Example AI assistant requests once the Swagger MCP server is connected to a REST API.
- "List all the API tools available from the connected OpenAPI spec"
- "Search for a pet named 'Fluffy' using the Petstore API"
- "Create a new order via the API with these details: [order details]"
- "What endpoints does this API expose for user management?"
- "Call the /users/{id} endpoint for user ID 42 and summarize the response"Troubleshooting MCP Swagger Server
Server fails to parse the OpenAPI spec with a schema error
Ensure the spec URL returns valid JSON or YAML and is publicly accessible (or on localhost). Some APIs return the spec only with an Accept header — use a local file path instead: 'mss --openapi ./openapi.json'. Both Swagger 2.0 and OpenAPI 3.x are supported.
API calls return 401 Unauthorized through the MCP tools
Confirm API_TOKEN is set correctly in the env block of your config and that --auth-type bearer is in the args. Also verify MCP_BASE_URL matches the API's base path — a mismatch between the spec's server URL and the actual endpoint is a common cause of auth failures.
Too many tools are generated and Claude struggles to pick the right one
Use the --operation-filter-methods flag to limit to specific HTTP methods (e.g., 'GET,POST') or --operation-filter-paths with a wildcard pattern to expose only the API paths you actually need. This keeps the tool count manageable for AI selection.
Frequently Asked Questions about MCP Swagger Server
What is MCP Swagger Server?
MCP Swagger Server is a Model Context Protocol (MCP) server that automatically converts rest apis with swagger/openapi documentation into mcp tools, making any documented api accessible to mcp-compatible clients. supports authentication, ssl handling, and flexible configuration for seamless api integration. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP Swagger Server?
Follow the installation instructions on the MCP Swagger Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with MCP Swagger Server?
MCP Swagger Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP Swagger Server free to use?
Yes, MCP Swagger Server is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
MCP Swagger Server Alternatives — Similar APIs Servers
Looking for alternatives to MCP Swagger Server? Here are other popular apis servers you can use with Claude, Cursor, and VS Code.
Kong
★ 43.4k🦍 The API and AI Gateway
API Mega List
★ 5.4kThis GitHub repo is a powerhouse collection of APIs you can start using immediately to build everything from simple automations to full-scale applications. One of the most valuable API lists on GitHub—period. 💪
Fetch
★ 5.4kFetch web content and convert to markdown for AI consumption
Fusio
★ 2.1kSelf-Hosted API Management for Builders
Korean Law
★ 1.8k국가법령정보MCP v4.0 | 법제처 41개 API → 17개 MCP 도구. 법령·판례·조례 검색 + LLM 환각 방지 인용검증 + 조문 영향 그래프(impact_map) + 시점 비교 자동 diff(time_travel) + 시민 5단계 실행 가이드(action_plan) | 41 Korean legal APIs → 17 MCP tools
RuleGo
★ 1.5k⛓️RuleGo is a lightweight, high-performance, embedded, next-generation component orchestration rule engine framework for Go.
Browse More APIs MCP Servers
Explore all apis servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP Swagger Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP Swagger Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.