What is Swagger MCP Server?
A server that ingests and serves Swagger/OpenAPI specifications through the Model Context Protocol (MCP). It automatically generates MCP tools from API endpoints and supports multiple authentication methods, making it suitable for developers who want to expose REST APIs to AI assistants via MCP.
How to use Swagger MCP Server?
Clone the repository, install dependencies with Yarn, create a .env file, and configure your Swagger/OpenAPI specification (file path or URL) in config.json. Start the development server with yarn dev, or build and run with yarn build and yarn start. The server listens on configurable host/port and exposes endpoints for health checks, SSE connections, and message posting.
Key features of Swagger MCP Server
- Loads Swagger/OpenAPI specifications from file or URL
- Supports Basic Auth, Bearer Token, API Key, and OAuth2 authentication
- Automatically generates MCP tools from API endpoints
- Server-Sent Events (SSE) support for real-time communication
- TypeScript support
Use cases of Swagger MCP Server
- Integrate any REST API defined by an OpenAPI spec into an MCP ecosystem
- Allow AI assistants to call API endpoints through auto-generated MCP tools
- Expose a personal or internal API to MCP clients without writing custom MCP servers
コメント