G

swagger-mcp

...
Created 2/9/2025bydanishjsheikh

Language:

Go

Stars:

4

Forks:

2

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:
Watch the Demo

🙌 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:

  1. LLM Model API Key / Local LLM: Requires access to OpenAI, Claude, or Ollama models.
  2. 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

MCP Configuration

To integrate with mcphost, include the following configuration in .mcp.json:

{
    "mcpServers":
    {
        "swagger_loader": {
            "command": "mcp-swagger",
            "args": [""]
        }
    }
}

Demo Flow

  1. Some Backend:

    go install go install github.com/danishjsheikh/go-backend-demo@latest 
    go-backend-demo
    
  2. Ollama

    ollama run llama3.2
    
  3. MCP Client

    go install github.com/mark3labs/mcphost@latest
    mcphost -m ollama:llama3.2 --config 
    
             ## Flow Diagram
    

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! 🚀

Last updated: 3/3/2025

Publisher info

danishjsheikh's avatar

Danish Sheikh

Whiz of Websites and Social Shenanigans | Spreading Smiles through Code and Compassion

0
followers
0
following
9
repos

More MCP servers built with Go

mcp-server

learn to make some mcp servers

By yiGmMk1
linear-mcp-go

linear MCP server based on mcp-go

By geropl1
gomcptest

A proof-of-concept demonstrating a custom-built host implementing an OpenAI-compatible API with Google Gemini, function calling, and interaction with a dummy MCP server.

By owulveryck2