Labsco
MCP SERVER

Swagger MCP

by danishjsheikh

Turn any Swagger 2.0 or OpenAPI 3.0 document into MCP tools at runtime — one tool per endpoint, with path filters, method filters and four auth modes.

API Specifications & HTTP Tooling
Summary
One binary, any documented API.

Generating a tool per endpoint means the model sees real parameter names and types rather than a generic HTTP call, and the filter flags matter more than they look — a large spec would otherwise flood the tool list, and `--includePaths` with `--includeMethods` is how you keep it to the read-only slice you meant. Credentials sit on the command line, so treat the client config file as a secret.

What it is

A Go binary that reads an API specification and generates MCP tools dynamically, one per endpoint, so an MCP client can call the API without anyone hand-writing a wrapper. Required and optional fields come from the schema's `required` array and are carried into the generated tool definitions.

What you get
  • Swagger 2.0 handled with path, query and header parameters plus `in: body` request bodies, and OpenAPI 3.0 with `requestBody` schemas resolved inline or from `$ref`
  • A spec loaded from a URL or a `file://` path — `--specUrl`
  • The exposed surface narrowed before it reaches the model — `--includePaths`, `--excludePaths`, `--includeMethods`, `--excludeMethods`, each taking comma-separated values or regex patterns
  • Four authentication modes — `--security` set to `basic`, `bearer` or `apiKey`, with `--basicAuth`, `--bearerAuth` and `--apiKeyAuth` carrying the credential; API keys can go in a header, query string or cookie
  • Static headers added to every request with `--headers`, or client headers forwarded through with `--sseHeaders` and `--httpHeaders`
  • Three transports — stdio by default, SSE with `--sse`, or StreamableHTTP with `--http`, which serves `/mcp` unless `--httpPath` says otherwise
Requirements

A Swagger or OpenAPI JSON document the server can reach, and whatever credential that API expects, passed on the command line. Install with `go install github.com/danishjsheikh/swagger-mcp@latest`. `--specUrl` is the only required flag; `--baseUrl` overrides the base URL for the actual requests. Any MCP client works — the README's own walkthrough uses mcphost.

Setup effort

One command — go install github.com/danishjsheikh/swagger-mcp@latest