Swagger MCP Server Documentation
Transform any Swagger/OpenAPI specification into an intelligent MCP server for AI agents
Table of Contents
🚀 Getting Started
- Installation Guide - Complete installation instructions and system requirements
- Quick Start Tutorial - Get your first MCP server running in 5 minutes
- Basic Configuration - Essential configuration for new users
📖 CLI Reference
- Command Reference - Complete CLI commands, options, and examples
- Configuration Management - Configuration file syntax and options
- Server Management - Starting, stopping, and monitoring servers
💡 Examples
- Sample Swagger Files - Real-world API examples for testing
- Configuration Examples - Ready-to-use configuration templates
- Integration Examples - AI assistant and tool integrations
📚 Guides
- Deployment Guide - Production deployment and best practices
- Performance Tuning - Optimization and scaling strategies
- Security Configuration - Hardening and production security
🔧 Troubleshooting
- Common Issues - Frequently encountered problems and solutions
- Error Reference - Error messages and resolution steps
- Diagnostic Tools - Tools and techniques for problem diagnosis
🔌 API Reference
- MCP Protocol Integration - Using MCP protocol with AI agents
- Extension Points - Customizing and extending functionality
- Development Guide - Contributing and development setup
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
- 🔄 One-Command Conversion: Transform Swagger files to MCP servers instantly
- 🔍 Intelligent Search: Advanced search across endpoints, parameters, and schemas
- ⚡ High Performance: Optimized indexing and caching for fast responses
- 🛡️ Production Ready: SSL support, authentication, and monitoring
- 🔧 Highly Configurable: Extensive configuration options for any deployment
- 📱 Cross-Platform: Works on Windows, macOS, and Linux
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
- Start with Installation Guide
- Follow Quick Start Tutorial
- Configure basics with Basic Configuration
For Developers
- Review CLI Reference
- Explore Configuration Reference
- Check Development Guide
For Operations
- Follow Deployment Guide
- Implement Security Configuration
- Monitor with Performance Tuning
For Troubleshooting
- Check Common Issues
- Search Error Reference
- Use Diagnostic Tools
Support and Community
Getting Help
- Documentation: Start here with comprehensive guides and references
- GitHub Issues: Report bugs
- Discussions: Community Q&A
- Examples: Real-world examples in this repository
Contributing
- Documentation: Help improve these docs
- Examples: Contribute integration examples
- Bug Reports: Submit detailed issue reports
- Feature Requests: Propose new functionality
Resources
- Source Code: GitHub Repository
- PyPI Package: swagger-mcp-server
- Docker Images: Docker Hub
License and Credits
This project is open source and available under the MIT License.
Built with:
- Click - Command-line interface framework
- Whoosh - Full-text search library
- FastAPI - Modern web framework for APIs
- SQLite - Embedded database engine
- OpenAPI Spec Validator - OpenAPI validation
Special thanks to the Model Context Protocol specification creators and the broader AI development community.