A server that ingests and serves Swagger/OpenAPI specifications through the Model Context Protocol (MCP).
- Loads Swagger/OpenAPI specifications
- Supports multiple authentication methods:
- Basic Auth
- Bearer Token
- API Key (header or query)
- OAuth2
- Automatically generates MCP tools from API endpoints
- Server-Sent Events (SSE) support for real-time communication
- TypeScript support
This is a personal server!! Do not expose it to the public internet. If the underlying API requires authentication, you should not expose the MCP server to the public internet.
- secrets - the MCP server should be able to use secrets from the user to authenticate requests to the API
- Comprehensive test suite
- Node.js (v18 or higher)
- Yarn package manager
- TypeScript
- Clone the repository:
git clone https://github.com/dcolley/swagger-mcp.git
cd swagger-mcp- Install dependencies:
yarn install- Create a
.envfile based on the example:
cp .env.example .env-
Configure your Swagger/OpenAPI specification:
- Place your Swagger file in the project (e.g.,
swagger.json) - Or provide a URL to your Swagger specification
- Place your Swagger file in the project (e.g.,
-
Update the configuration in
config.jsonwith your server settings: