AI agents + Swagger/OpenAPI = no more copying API docs into chats
I got tired of re-explaining my API to AI coding agents, so I built a Swagger MCP server.
While working with AI agents, I kept running into the same issue.
Whenever I started a backend-related feature, I had to explain the API again:
- Which endpoints exist
- Request/response structures
- DTOs and schemas
- Authentication requirements
Sometimes I even found myself copying sections from Swagger into the chat.
The bigger problem was when the backend changed. The AI could continue generating code based on an outdated API contract without realizing it.
So I built Swagger Reader MCP and open-sourced it.
It connects to a Swagger/OpenAPI specification and allows AI agents to:
- Discover available endpoints
- Read request and response models
- Explore schemas and DTOs
- Understand API contracts without manual explanation
- Refresh and read the latest spec when the backend changes
It isn't tied to any specific framework or project, so it should work with any API that exposes an OpenAPI/Swagger specification.
For private APIs, authentication is supported through:
- Query parameters
- Custom headers
- Bearer tokens
Credentials stay local and are not sent to any external service.
I've tested it with Cursor, Claude, Codex, and OpenCode.
I'm sharing it because it solved a real workflow problem for me, and I'm curious whether other developers working with AI agents run into the same issue.
Feedback, bug reports, feature requests, and contributions are all welcome.
GitHub and npm links are in the comments.