Swagger MCP
Scrapes Swagger UI to dynamically generate MCP tools at runtime using LLMs.
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:
go install github.com/danishjsheikh/swagger-mcp@latest
swagger-mcp
Run Configuration
To run swagger-mcp directly, use:
swagger-mcp --specUrl=https://your_swagger_api_docs.json
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:
{
"mcpServers":
{
"swagger_loader": {
"command": "swagger-mcp",
"args": ["--specUrl=<swagger/doc.json_url>"]
}
}
}
Demo Flow
-
Some Backend:
go install github.com/danishjsheikh/go-backend-demo@latest go-backend-demo -
Ollama
ollama run llama3.2 -
MCP Client
go install github.com/mark3labs/mcphost@latest mcphost -m ollama:llama3.2 --config <.mcp.json_file_path>
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! š
Server Terkait
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
MCP Starter Server
A minimal template for building AI assistant tools using the ModelContextProtocol.
Kestra Python MCP Server
A Python implementation of a Model Context Protocol server for interacting with Kestra.
Flutter MCP
Provides real-time Flutter/Dart documentation and pub.dev package information to AI assistants, supporting all packages on demand.
MCP Simple Server
A simple MCP server with streamable HTTP transport that supports basic math tools like add and multiply.
Zen MCP
An AI-powered server providing access to multiple models for code analysis, problem-solving, and collaborative development with guided workflows.
Smithery Reference Servers
A collection of reference implementations for Model Context Protocol (MCP) servers in Typescript and Python, demonstrating MCP features and SDK usage.
Open MCP Server
A service framework supporting the Model Context Protocol (MCP) to integrate enterprise systems and AI platforms via RESTful, gRPC, and Dubbo protocols.
SJ RedM MCP Server
A versatile MCP server for RedM development, providing access to RDR3 discoveries, framework documentation, native functions, and database operations.
Playwright IA: Midscene.js
Automate Playwright flows using natural language with Midscene.js and AI.
Alpaca MCP Server
Interact with Alpaca's Trading API for stocks, options, portfolios, and real-time market data using LLMs.