OpenAPI to MCP Server
Converts any OpenAPI/Swagger specification into MCP tools, allowing interaction with any REST API defined by the spec.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpenAPI to MCP Serverserve my pet store API spec"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
openapi-to-mcp
Convert any OpenAPI/Swagger spec into an MCP server, instantly exposing your REST API as tools for Claude.
uvx openapi-to-mcp serve ./spec.json --base-url https://api.example.com -a bearer --bearer-token $TOKENInstallation
No installation needed — just use uvx:
uvx openapi-to-mcp --helpOr install globally:
uv tool install openapi-to-mcpRelated MCP server: Swagger MCP
Quick Start
# See what tools will be generated
uvx openapi-to-mcp list-endpoints ./openapi.json
# Run MCP server
uvx openapi-to-mcp serve ./openapi.json --base-url https://api.example.comAuthentication
Supports all OpenAPI/Swagger security schemes:
# HTTP Basic
uvx openapi-to-mcp serve spec.json -b https://api.example.com \
-a basic -u user -p pass
# Bearer Token
uvx openapi-to-mcp serve spec.json -b https://api.example.com \
-a bearer --bearer-token $TOKEN
# API Key (header, query, or cookie)
uvx openapi-to-mcp serve spec.json -b https://api.example.com \
-a api-key-header --api-key $KEY --api-key-name X-API-Key
# OAuth2 Password (cookie-based login)
uvx openapi-to-mcp serve spec.json -b https://api.example.com \
-a oauth2-password -u user -p pass --login-url /auth/login
# OAuth2 Password (token-based)
uvx openapi-to-mcp serve spec.json -b https://api.example.com \
-a oauth2-password -u user -p pass --token-url /oauth/token
# OAuth2 Client Credentials
uvx openapi-to-mcp serve spec.json -b https://api.example.com \
-a oauth2-client --client-id $ID --client-secret $SECRET --token-url /oauth/tokenAdding to Claude Code
Add to ~/.claude.json or .mcp.json:
{
"mcpServers": {
"my-api": {
"command": "uvx",
"args": [
"openapi-to-mcp",
"serve",
"/path/to/spec.json",
"--base-url", "https://api.example.com",
"--auth-type", "bearer",
"--bearer-token", "your-token"
]
}
}
}Or generate a config:
uvx openapi-to-mcp generate-config ./spec.json \
--base-url https://api.example.com \
--server-name my-api \
-a bearer --bearer-token $TOKENFiltering Endpoints
Large APIs can expose hundreds of tools. Use tag filters:
# Only include specific tags
uvx openapi-to-mcp serve spec.json -b https://api.example.com \
--include-tag Users --include-tag Orders
# Exclude tags
uvx openapi-to-mcp serve spec.json -b https://api.example.com \
--exclude-tag Admin --exclude-tag InternalCommands
Command | Description |
| Run MCP server for an OpenAPI spec |
| Preview endpoints and generated tool names |
| Show full tool definitions as JSON |
| Generate Claude Code MCP config |
Tool Naming
Endpoints are converted to clean tool names:
Method | Path | Tool Name |
GET | /users |
|
POST | /users |
|
GET | /users/{id} |
|
PATCH | /users/{id} |
|
DELETE | /users/{id} |
|
How It Works
Parse — Reads OpenAPI 3.x spec (JSON or YAML, file or URL)
Generate — Converts each endpoint to an MCP tool with proper input schema
Authenticate — Handles login flows, stores tokens/cookies
Serve — Runs stdio MCP server, executes HTTP calls on tool invocation
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Afstkla/openapi-to-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server