MCP Swagger Server

v1.0.0APIsstable

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.

mcpmcpserveropenapiopenapi-mcpswagger
Share:
66
Stars
0
Downloads
0
Weekly
0/5

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

Convert REST APIs with Swagger/OpenAPI docs to MCP tools.
Support authentication and SSL in API integrations.
Automatically expose documented APIs through MCP.
zaizaizhao

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMay 19, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-swagger-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 -g
2

Test 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 streamable
3

Configure 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-here
4

Add 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"
      }
    }
  }
}
5

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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-swagger-server": { "command": "npx", "args": ["-y", "mcp-swagger-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides