openapi-mcp-server
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-mcp-serverexpose the Petstore API as tools"
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 MCP Server
A Model Context Protocol (MCP) server that dynamically exposes REST APIs as MCP tools by parsing OpenAPI specifications. Works with any OpenAPI-compliant API.
Features
Dynamic Tool Generation: Automatically creates MCP tools from OpenAPI specs
Two Operation Modes: Low-level (automatic) and FastMCP (predefined)
Flexible Authentication: Support for Bearer tokens, API keys, and custom headers
Endpoint Filtering: Whitelist/blacklist specific API endpoints
Parameter Stripping: Remove sensitive parameters from requests
Pre-built Presets: Includes configurations for popular APIs
Quick Start
# Install
pip install openapi-mcp-server
# Run with any OpenAPI service
openapi-mcp-server --openapi-url https://api.example.com/openapi.json --base-url https://api.example.com
# Use with Lemy (preset included)
openapi-mcp-server --preset lemy
# Test mode (verify tools without starting MCP)
openapi-mcp-server --preset lemy --testPresets
Lemy
openapi-mcp-server --preset lemy
# or
OPENAPI_PRESET=lemy openapi-mcp-serverCustom API
openapi-mcp-server \
--openapi-url https://your-api.com/openapi.json \
--base-url https://your-api.com \
--mode fastmcp \
--auth-token your-tokenInstallation
From PyPI
pip install openapi-mcp-serverOr with uv:
uv add openapi-mcp-serverLocal Installation (Development)
If you want to install from source for development or testing:
# Clone the repository
git clone https://github.com/yourusername/openapi-mcp-server.git
cd openapi-mcp-server
# Install in editable mode with development dependencies
pip install -e ".[dev]"
# Or with uv
uv pip install -e ".[dev]"
# Verify installation
openapi-mcp-server --help
# Run tests to ensure everything works
pytestThe editable installation (-e flag) allows you to modify the source code and see changes immediately without reinstalling.
Configuration
Environment Variables
Variable | Description | Default |
| Preset name (lemy, slack, etc.) | None |
| OpenAPI specification URL | Required |
| API base URL | Required |
| Server mode ( |
|
| API authentication key | None |
| Authentication header name |
|
| Authentication type |
|
| Comma-separated endpoint patterns | None |
| Comma-separated endpoint patterns | None |
| Prefix for tool names |
|
| Parameter to remove from requests | None |
| Enable debug logging |
|
Configuration File
Create a config.json:
{
"openapi_spec_url": "https://api.example.com/openapi.json",
"api_base_url": "https://api.example.com",
"mode": "fastmcp",
"api_key": "your-token",
"tool_whitelist": ["/users", "/posts"],
"debug": true
}Then run:
openapi-mcp-server --config config.jsonUsage with Claude Code
Add to your Claude Code MCP configuration:
{
"mcpServers": {
"my-api": {
"command": "openapi-mcp-server",
"args": ["--preset", "lemy"],
"env": {
"API_BASE_URL": "http://localhost:11981"
}
}
}
}Or for a custom API:
{
"mcpServers": {
"my-api": {
"command": "openapi-mcp-server",
"env": {
"OPENAPI_SPEC_URL": "https://api.example.com/openapi.json",
"API_BASE_URL": "https://api.example.com",
"API_KEY": "your-token",
"MCP_MODE": "fastmcp"
}
}
}
}Presets
Available Presets
lemy: Lemy AI platform
slack: Slack API (coming soon)
github: GitHub API (coming soon)
Creating Custom Presets
Create a preset file in presets/my-service.json:
{
"name": "my-service",
"openapi_spec_url": "https://api.myservice.com/openapi.json",
"api_base_url": "https://api.myservice.com",
"mode": "fastmcp",
"auth_header": "X-API-Key",
"auth_type": "Token",
"tool_name_prefix": "myservice_",
"fastmcp_tools": [
{
"name": "myservice_get_user",
"description": "Get user information",
"endpoint": "/users/{id}",
"method": "GET",
"parameters": {
"id": {"type": "string", "required": true, "in": "path"}
}
}
]
}Development
git clone https://github.com/yourusername/openapi-mcp-server
cd openapi-mcp-server
pip install -e ".[dev]"
# Run tests
pytest
# Test with Lemy
openapi-mcp-server --preset lemy --testExamples
Slack API
openapi-mcp-server \
--openapi-url https://api.slack.com/specs/openapi/v2/slack_web.json \
--base-url https://slack.com/api \
--auth-token xoxb-your-token \
--tool-prefix slack_GitHub API
openapi-mcp-server \
--openapi-url https://api.github.com/openapi.json \
--base-url https://api.github.com \
--auth-token ghp_your-token \
--auth-header Authorization \
--auth-type "Bearer"Custom Internal API
openapi-mcp-server \
--openapi-url http://internal-api:8080/openapi.json \
--base-url http://internal-api:8080 \
--mode fastmcp \
--whitelist "/api/v1/users,/api/v1/projects"License
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Add tests for your changes
Ensure all tests pass
Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
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
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/robotanica/openapi-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server