
MCP Swagger Server
Automatically generates MCP servers from OpenAPI/Swagger specifications, enabling users to interact with any REST API through natural language with flexible endpoint filtering and authentication support.
README
MCP Swagger Server
Generate MCP (Model Context Protocol) servers from Swagger/OpenAPI specifications with flexible filtering.
Features
- Dynamic Tool Generation: Automatically creates MCP tools from OpenAPI endpoints
- Flexible Filtering: Control exposed endpoints via HTTP methods, paths, tags, and operation IDs
- Authentication: Built-in Bearer token support
- Type Safety: Automatic parameter validation and conversion
- FastMCP Integration: Built on the FastMCP framework for reliable MCP server implementation
Installation
# Install from source
pip install -e .
# Or install dependencies directly
pip install -r requirements.txt
Quick Start
# Basic usage (exposes GET endpoints by default)
mcp-swagger path/to/swagger.json
# With authentication
mcp-swagger swagger.json --api-token "your-token"
# Custom base URL
mcp-swagger swagger.json --base-url "https://api.example.com"
Filtering Options
Control which endpoints are exposed:
- HTTP Methods:
--methods get post put delete
- Path Patterns:
--paths "/api/*" --exclude-paths "/admin/*"
- Tags:
--tags public documents --exclude-tags internal
- Operation IDs:
--operation-ids list_docs get_doc --exclude-operation-ids delete_all
Examples
# Public read-only API
mcp-swagger api.json --methods get --tags public --exclude-paths "/admin/*"
# Specific operations only
mcp-swagger api.json --operation-ids list_docs get_doc search_docs
# Preview generated tools without starting server
mcp-swagger api.json --dry-run --methods get post
Configuration
Command Line Options
--host
: Server host (default: localhost)--port
: Server port (default: 8080)--transport
: Transport protocol:sse
orstreamable-http
(default)--timeout
: Request timeout in seconds (default: 30)--dry-run
: Preview tools without starting server
Environment Variables
API_BASE_URL
: Default base URL for the APIAPI_TOKEN
: API token for authentication
Docker
# Build image
docker build -t mcp-swagger .
# Run with configuration
docker run -p 8080:8080 \
-e API_BASE_URL=https://api.example.com \
-e API_TOKEN=your-token \
-v $(pwd)/swagger.json:/app/swagger.json \
mcp-swagger /app/swagger.json --methods get post
Architecture
config/
: CLI parsing and settingsfilters/
: Endpoint filtering logicgenerators/
: MCP tool generationparsers/
: OpenAPI spec parsingapi_client/
: HTTP client and authmodels/
: Data modelsutils/
: Utilities and logging
How It Works
- Load OpenAPI/Swagger specification (file or URL)
- Apply filters to select endpoints
- Generate FastMCP tools with parameter validation and auth
- Start MCP server with generated tools
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.