Swagger MCP Server Documentation

Transform any Swagger/OpenAPI specification into an intelligent MCP server for AI agents

Table of Contents

🚀 Getting Started

📖 CLI Reference

💡 Examples

📚 Guides

🔧 Troubleshooting

🔌 API Reference


Overview

The Swagger MCP Server converts any OpenAPI/Swagger specification into a fully functional MCP (Model Context Protocol) server. This enables AI coding assistants to intelligently query, understand, and utilize API documentation without the limitations of context windows.

Key Features

Architecture

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   AI Agent      │◄──►│   MCP Server     │◄──►│  Search Engine  │
│                 │    │                  │    │                 │
│ • Claude        │    │ • JSON-RPC API   │    │ • Endpoint Index│
│ • GPT-4         │    │ • Authentication │    │ • Schema Index  │
│ • Cursor        │    │ • Rate Limiting  │    │ • Full-Text     │
│ • Custom Tools  │    │ • Monitoring     │    │ • Relationships │
└─────────────────┘    └──────────────────┘    └─────────────────┘
                                │
                                ▼
                       ┌──────────────────┐
                       │  Swagger Parser  │
                       │                  │
                       │ • Validation     │
                       │ • Schema Extract │
                       │ • Relationship   │
                       │ • Indexing       │
                       └──────────────────┘

Quick Example

# Install
pip install swagger-mcp-server

# Convert Swagger to MCP Server
swagger-mcp-server convert api.json --name my-api

# Start server
cd mcp-server-my-api
swagger-mcp-server serve

# Query from AI agent
curl -X POST http://localhost:8080 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "searchEndpoints",
    "params": {"keywords": "user authentication"}
  }'

Documentation Categories

For New Users

For Developers

For Operations

For Troubleshooting


Support and Community

Getting Help

Contributing

Resources


License and Credits

This project is open source and available under the MIT License.

Built with:

Special thanks to the Model Context Protocol specification creators and the broader AI development community.