Integrations
Integrates with Ollama to allow running local LLMs as an alternative to cloud-based models for processing API interactions.
Connects with OpenAI models to process API definitions and interact with Swagger-documented endpoints.
Automatically extracts Swagger UI definitions from API endpoints to dynamically generate MCP tools at runtime, enabling AI agents to interact with any Swagger-documented API without manual tool implementation.
swagger-mcp
Overview
swagger-mcp
is a tool designed to scrape Swagger UI by extracting the swagger.json
file and dynamically generating well-defined mcp tools at runtime. These tools can be utilized by the MCP client for further tool selection.
📽️ Demo Video
Check out demo video showcasing the project in action:
🙌 Support
If you find this project valuable, please support me on LinkedIn by:
- 👍 Liking and sharing our demo post
- 💬 Leaving your thoughts and feedback in the comments
- 🔗 Connecting with me for future updates
Your support on LinkedIn will help me reach more people and improve the project!
Prerequisites
To use swagger-mcp
, ensure you have the following dependencies:
- LLM Model API Key / Local LLM: Requires access to OpenAI, Claude, or Ollama models.
- Any MCP Client: (Used mark3labs - mcphost)
Installation and Setup
Follow these steps to install and run swagger-mcp
:
Run Configuration
To run swagger-mcp
directly, use:
Main flags:
--specUrl
: Swagger/OpenAPI JSON URL (required)--sseMode
: Run in SSE mode (default: false, if true runs as SSE server, otherwise uses stdio)--sseAddr
: SSE server listen address in IP:Port or :Port format (if empty, will use IP:Port from --sseUrl)--sseUrl
: SSE server base URL (if empty, will use sseAddr to generate, e.g. http://IP:Port or http://localhost:Port)- If both --sseAddr and --sseUrl are set, they are used as-is without auto-complement.
--baseUrl
: Override base URL for API requests--security
: API security type (basic
,apiKey
, orbearer
)--basicAuth
: Basic auth in user:password format--bearerAuth
: Bearer token for Authorization header--apiKeyAuth
: API key(s), formatpassAs:name=value
(e.g.header:token=abc,query:user=foo,cookie:sid=xxx
)- See main.go for all supported flags and options.
MCP Configuration
To integrate with mcphost
, include the following configuration in .mcp.json
:
Demo Flow
- Some Backend:Copy
- OllamaCopy
- MCP ClientCopy
Flow Diagram
🛠️ Need Help
I am working on improving tool definitions to enhance:
✅ Better error handling for more accurate responses
✅ LLM behavior control to ensure it relies only on API responses and does not use its own memory
✅ Preventing hallucinations and random data generation by enforcing strict data retrieval from APIs
If you have insights or suggestions on improving these aspects, please contribute by:
- Sharing your experience with similar implementations
- Suggesting modifications to tool definitions
- Providing feedback on current limitations
Your input will be invaluable in making this tool more reliable and effective! 🚀
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
swagger-mcp is a tool designed to scrape Swagger UI by extracting the swagger.json file and dynamically generating well-defined mcp tools at runtime. These tools can be utilized by the MCP client for further tool selection.
Related MCP Servers
- -securityAlicense-qualityA Python-based MCP server that integrates OpenAPI-described REST APIs into MCP workflows, enabling dynamic exposure of API endpoints as MCP tools.Last updated -239PythonMIT License
- -securityAlicense-qualityA server that enables interaction with any API that has a Swagger/OpenAPI specification through Model Context Protocol (MCP), automatically generating tools from API endpoints and supporting multiple authentication methods.Last updated -61TypeScriptApache 2.0
- -securityAlicense-qualityAn MCP server that connects to a Swagger specification and helps an AI to build all the required models to generate a MCP server for that service.Last updated -19TypeScriptMIT License
- -securityAlicense-qualityMCP server providing token-efficient access to OpenAPI/Swagger specs via MCP Resources for client-side exploration.Last updated -355TypeScriptMIT License
Appeared in Searches
- A tool to manage and process a list of Swagger API endpoints
- A service for generating websites in MCP
- Save all service information from mcp.so-like websites to local storage
- A GitHub repository for an MCP server with a clear description of config.json
- Discussing Application Architectures and Server Costing