swagger-mcp
@danishjsheikh
About swagger-mcp
mcp server which will dynamically define tools based on swagger
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"swagger_loader": {
"command": "swagger-mcp",
"args": [
"--specUrl=<swagger/doc.json_url>"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is swagger-mcp?
swagger-mcp is a tool that reads a Swagger 2.0 or OpenAPI 3.0 specification and dynamically generates MCP tools at runtime—one tool per API endpoint. It is designed for MCP clients to enable LLM-driven API interaction.
How to use swagger-mcp?
Install via go install github.com/danishjsheikh/swagger-mcp@latest, then run it with a spec URL. Use flags like --specUrl, --sse, --http, --security, and --includePaths to configure authentication, transports, and endpoint filtering. Integrate with MCP clients (e.g., mcphost) via a .mcp.json config.
Key features of swagger-mcp
- Dynamically generates MCP tools from Swagger/OpenAPI specs
- Supports Swagger 2.0 and OpenAPI 3.0
- Handles path, query, header parameters and request bodies
- Honors required/optional fields from schema
requiredarrays - Runs in stdio, SSE, or StreamableHTTP mode
- Supports authentication: basic, bearer, API key
- Allows path/method include/exclude filtering
Use cases of swagger-mcp
- Enable LLMs to call any API documented by an OpenAPI spec
- Quickly prototype an MCP server for a REST API without manual coding
- Filter specific endpoints or HTTP methods for focused LLM interactions
- Integrate with MCP-compatible clients like
mcphostfor agentic workflows
FAQ from swagger-mcp
What spec formats does swagger-mcp support?
Swagger 2.0 (swagger: "2.0") and OpenAPI 3.0 (openapi: "3.0.x"), including inline and $ref schemas for request bodies and parameters.
What runtime dependencies are required?
An LLM model API key (OpenAI, Claude, or local models via Ollama) and any MCP client (e.g., mcphost). The server itself is a Go binary.
How do I pass authentication credentials?
Use the --security flag (basic, bearer, or apiKey) along with the corresponding flag (--basicAuth, --bearerAuth, or --apiKeyAuth). For API key, specify passAs (header/query/cookie) and the key-value pair.
Can I filter which endpoints become tools?
Yes, use --includePaths or --excludePaths for path filtering and --includeMethods or --excludeMethods for HTTP method filtering.
How does swagger-mcp handle request bodies?
Swagger 2.0 in: body parameters and OpenAPI 3.0 requestBody.content.<media-type>.schema are supported. Fields in the required array become required MCP tool arguments; others are optional.
Frequently asked questions
What spec formats does swagger-mcp support?
Swagger 2.0 (`swagger: "2.0"`) and OpenAPI 3.0 (`openapi: "3.0.x"`), including inline and `$ref` schemas for request bodies and parameters.
What runtime dependencies are required?
An LLM model API key (OpenAI, Claude, or local models via Ollama) and any MCP client (e.g., `mcphost`). The server itself is a Go binary.
How do I pass authentication credentials?
Use the `--security` flag (`basic`, `bearer`, or `apiKey`) along with the corresponding flag (`--basicAuth`, `--bearerAuth`, or `--apiKeyAuth`). For API key, specify passAs (header/query/cookie) and the key-value pair.
Can I filter which endpoints become tools?
Yes, use `--includePaths` or `--excludePaths` for path filtering and `--includeMethods` or `--excludeMethods` for HTTP method filtering.
How does swagger-mcp handle request bodies?
Swagger 2.0 `in: body` parameters and OpenAPI 3.0 `requestBody.content.<media-type>.schema` are supported. Fields in the `required` array become required MCP tool arguments; others are optional.
Basic information
More Other MCP servers

EverArt
modelcontextprotocolModel Context Protocol Servers
IDA Pro MCP
mrexodiaAI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP.
Nginx UI
0xJackyYet another WebUI for Nginx
Inbox Zero AI
elie222The world's best AI personal assistant for email. Open source app to help you reach inbox zero fast.
Activepieces
activepiecesAI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
Comments