swagger-mcp
mcp server which will dynamically define tools based on swagger
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.
To use swagger-mcp, ensure you have the required dependencies, install it using Go, and configure it with your MCP client by including the necessary settings in the .mcp.json file.
- Dynamic generation of MCP tools based on Swagger definitions. - Integration with various LLM models for enhanced functionality. - Easy setup and configuration for seamless use with MCP clients.
- Automating the generation of tools for API integration.
- Enhancing backend services with dynamically defined tools.
- Facilitating the development of applications that require real-time API interactions.
Add to your AI client
Use these steps to connect swagger-mcp in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"swagger-mcp-danishjsheikh": {
"command": "swagger-mcp",
"args": [
"--specUrl=<swagger/doc.json_url>"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"swagger-mcp-danishjsheikh": {
"command": "swagger-mcp",
"args": [
"--specUrl=<swagger/doc.json_url>"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"swagger-mcp-danishjsheikh": {
"command": "swagger-mcp",
"args": [
"--specUrl=<swagger/doc.json_url>"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"swagger-mcp-danishjsheikh": {
"type": "stdio",
"command": "swagger-mcp",
"args": [
"--specUrl=<swagger/doc.json_url>"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"swagger-mcp-danishjsheikh": {
"command": "swagger-mcp",
"args": [
"--specUrl=<swagger/doc.json_url>"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"swagger-mcp-danishjsheikh": {
"command": "swagger-mcp",
"args": [
"--specUrl=<swagger/doc.json_url>"
]
}
}
}FAQ
What dependencies are required to use swagger-mcp?
You need an LLM Model API Key or a local LLM, and any MCP client like mark3labs - mcphost.
How do I install swagger-mcp?
You can install it using the command: `go install github.com/danishjsheikh/swagger-mcpo@latest`.
Can swagger-mcp work with any MCP client?
Yes, it is designed to integrate with any MCP client that supports the required configuration.