LABSCO 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: bodyrequest bodies, and OpenAPI 3.0 withrequestBodyschemas 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 —
--securityset tobasic,bearerorapiKey, with--basicAuth,--bearerAuthand--apiKeyAuthcarrying 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--sseHeadersand--httpHeaders - Three transports — stdio by default, SSE with
--sse, or StreamableHTTP with--http, which serves/mcpunless--httpPathsays 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
USE CASES
01
Giving a model access to your internal API
Point at the service's OpenAPI JSON and get a tool per endpoint, without writing an integration.
02
Exposing only the safe half of an API
Restrict the generated surface to read methods and the paths you intend, so write endpoints never appear as options.
03
Calling an API that wants a key in a header
Pass the credential as passAs:name=value and let every generated tool carry it automatically.
04
Serving the tools to a remote client
Run in StreamableHTTP or SSE mode on a chosen address and forward the caller's own auth headers through to the API.
BEFORE YOU INSTALL
What to know first
Requires
swagger-mcp on PATH
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
TERMINAL
go install github.com/danishjsheikh/swagger-mcp@latestMCP Clients
MCPHost
MCPHOST · JSON
{
"mcpServers": {
"swagger_loader": {
"command": "swagger-mcp",
"args": [
"--specUrl=<YOUR_SPEC_URL>"
]
}
}
}