
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
mcp-openapi-proxy is a Python package that implements a Model Context Protocol (MCP) server, designed to dynamically expose REST APIs—defined by OpenAPI specifications—as MCP tools. This facilitates seamless integration of OpenAPI-described APIs into MCP-based workflows.
The package offers two operational modes:
/chat/completions
becomes chat_completions()
).list_functions()
and call_function()
) based on static configurations.Bearer
by default for API_KEY
in the Authorization header, customizable for APIs like Fly.io requiring Api-Key
.Install the package directly from PyPI using the following command:
uvx mcp-openapi-proxy
To incorporate mcp-openapi-proxy into your MCP ecosystem configure it within your mcpServers
settings. Below is a generic example:
{
"mcpServers": {
"mcp-openapi-proxy": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "${OPENAPI_SPEC_URL}",
"API_KEY": "${API_OPENAPI_KEY}"
}
}
}
}
Refer to the Examples section below for practical configurations tailored to specific APIs.
OPENAPI_SIMPLE_MODE=true
.OPENAPI_SPEC_URL
: (Required) The URL to the OpenAPI specification JSON file (e.g. https://example.com/spec.json
or file:///path/to/local/spec.json
).OPENAPI_LOGFILE_PATH
: (Optional) Specifies the log file path.OPENAPI_SIMPLE_MODE
: (Optional) Set to true
to enable FastMCP mode.TOOL_WHITELIST
: (Optional) A comma-separated list of endpoint paths to expose as tools.TOOL_NAME_PREFIX
: (Optional) A prefix to prepend to all tool names.API_KEY
: (Optional) Authentication token for the API sent as Bearer <API_KEY>
in the Authorization header by default.API_AUTH_TYPE
: (Optional) Overrides the default Bearer
Authorization header type (e.g. Api-Key
for GetZep).STRIP_PARAM
: (Optional) JMESPath expression to strip unwanted parameters (e.g. token
for Slack).DEBUG
: (Optional) Enables verbose debug logging when set to "true", "1", or "yes".EXTRA_HEADERS
: (Optional) Additional HTTP headers in "Header: Value" format (one per line) to attach to outgoing API requests.SERVER_URL_OVERRIDE
: (Optional) Overrides the base URL from the OpenAPI specification when set, useful for custom deployments.TOOL_NAME_MAX_LENGTH
: (Optional) Truncates tool names to a max length.OPENAPI_SPEC_URL_<hash>
– a variant for unique per-test configurations (falls back to OPENAPI_SPEC_URL
).IGNORE_SSL_SPEC
: (Optional) Set to true
to disable SSL certificate verification when fetching the OpenAPI spec.IGNORE_SSL_TOOLS
: (Optional) Set to true
to disable SSL certificate verification for API requests made by tools.For testing you can run the uvx command as demonstrated in the examples then interact with the MCP server via JSON-RPC messages to list tools and resources. See the "JSON-RPC Testing" section below.
Glama offers the most minimal configuration for mcp-openapi-proxy requiring only the OPENAPI_SPEC_URL
environment variable. This simplicity makes it ideal for quick testing.
Retrieve the Glama OpenAPI specification:
curl https://glama.ai/api/mcp/openapi.json
Ensure the response is a valid OpenAPI JSON document.
Add the following configuration to your MCP ecosystem settings:
{
"mcpServers": {
"glama": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "https://glama.ai/api/mcp/openapi.json"
}
}
}
}
Start the service with:
OPENAPI_SPEC_URL="https://glama.ai/api/mcp/openapi.json" uvx mcp-openapi-proxy
Then refer to the JSON-RPC Testing section for instructions on listing resources and tools.
Fly.io provides a simple API for managing machines making it an ideal starting point. Obtain an API token from Fly.io documentation.
Retrieve the Fly.io OpenAPI specification:
curl https://raw.githubusercontent.com/abhiaagarwal/peristera/refs/heads/main/fly-machines-gen/fixed_spec.json
Ensure the response is a valid OpenAPI JSON document.
Update your MCP ecosystem configuration:
{
"mcpServers": {
"flyio": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/abhiaagarwal/peristera/refs/heads/main/fly-machines-gen/fixed_spec.json",
"API_KEY": "<your_flyio_token_here>"
}
}
}
}
<your_flyio_token_here>
).Api-Key
for Fly.io’s header-based authentication (overrides default Bearer
).After starting the service refer to the JSON-RPC Testing section for instructions on listing resources and tools.
Render offers infrastructure hosting that can be managed via an API. The provided configuration file examples/render-claude_desktop_config.json
demonstrates how to set up your MCP ecosystem quickly with minimal settings.
Retrieve the Render OpenAPI specification:
curl https://api-docs.render.com/openapi/6140fb3daeae351056086186
Ensure the response is a valid OpenAPI document.
Add the following configuration to your MCP ecosystem settings:
{
"mcpServers": {
"render": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "https://api-docs.render.com/openapi/6140fb3daeae351056086186",
"TOOL_WHITELIST": "/services,/maintenance",
"API_KEY": "your_render_token_here"
}
}
}
}
Launch the proxy with your Render configuration:
OPENAPI_SPEC_URL="https://api-docs.render.com/openapi/6140fb3daeae351056086186" TOOL_WHITELIST="/services,/maintenance" API_KEY="your_render_token_here" uvx mcp-openapi-proxy
Then refer to the JSON-RPC Testing section for instructions on listing resources and tools.
Slack’s API showcases stripping unnecessary token payload using JMESPath. Obtain a bot token from Slack API documentation.
Retrieve the Slack OpenAPI specification:
curl https://raw.githubusercontent.com/slackapi/slack-api-specs/master/web-api/slack_web_openapi_v2.json
Ensure it’s a valid OpenAPI JSON document.
Update your configuration:
{
"mcpServers": {
"slack": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/slackapi/slack-api-specs/master/web-api/slack_web_openapi_v2.json",
"TOOL_WHITELIST": "/chat,/bots,/conversations,/reminders,/files,/users",
"API_KEY": "<your_slack_bot_token, starts with xoxb>",
"STRIP_PARAM": "token",
"TOOL_NAME_PREFIX": "slack_"
}
}
}
}
xoxb-...
, replace <your_slack_bot_token>
).slack_
to tool names.After starting the service refer to the JSON-RPC Testing section for instructions on listing resources and tools.
GetZep offers a free cloud API for memory management with detailed endpoints. Since GetZep did not provide an official OpenAPI specification, this project includes a generated spec hosted on GitHub for convenience. Users can similarly generate OpenAPI specs for any REST API and reference them locally (e.g. file:///path/to/spec.json
). Obtain an API key from GetZep's documentation.
Retrieve the project-provided GetZep OpenAPI specification:
curl https://raw.githubusercontent.com/matthewhand/mcp-openapi-proxy/refs/heads/main/examples/getzep.swagger.json
Ensure it’s a valid OpenAPI JSON document. Alternatively, generate your own spec and use a file://
URL to reference a local file.
Update your configuration:
{
"mcpServers": {
"getzep": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/matthewhand/mcp-openapi-proxy/refs/heads/main/examples/getzep.swagger.json",
"TOOL_WHITELIST": "/sessions",
"API_KEY": "<your_getzep_api_key>",
"API_AUTH_TYPE": "Api-Key",
"TOOL_NAME_PREFIX": "zep_"
}
}
}
}
file:///path/to/your/spec.json
for a local file)./sessions
endpoints.Api-Key
for header-based authentication.zep_
to tool names.After starting the service refer to the JSON-RPC Testing section for instructions on listing resources and tools.
This example demonstrates:
Retrieve the Virustotal OpenAPI specification:
curl https://raw.githubusercontent.com/matthewhand/mcp-openapi-proxy/refs/heads/main/examples/virustotal.openapi.yml
Ensure that the response is a valid OpenAPI YAML document.
Add the following configuration to your MCP ecosystem settings:
{
"mcpServers": {
"virustotal": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/matthewhand/mcp-openapi-proxy/refs/heads/main/examples/virustotal.openapi.yml",
"EXTRA_HEADERS": "x-apikey: ${VIRUSTOTAL_API_KEY}",
"OPENAPI_SPEC_FORMAT": "yaml"
}
}
}
}
Key configuration points:
OPENAPI_SPEC_FORMAT="yaml"
.Launch the proxy with the Virustotal configuration:
OPENAPI_SPEC_URL="https://raw.githubusercontent.com/matthewhand/mcp-openapi-proxy/refs/heads/main/examples/virustotal.openapi.yml" API_KEY="your_virustotal_api_key" API_AUTH_HEADER="x-apikey" API_AUTH_TYPE="" OPENAPI_SPEC_FORMAT="yaml" uvx mcp-openapi-proxy
After starting the service, refer to the JSON-RPC Testing section for instructions on listing resources and tools.
Notion’s API requires specifying a particular version via HTTP headers. This example uses the EXTRA_HEADERS
environment variable to include the required header, and focuses on verifying the OpenAPI specification.
Retrieve the Notion OpenAPI specification:
curl https://storage.googleapis.com/versori-assets/public-specs/20240214/NotionAPI.yml
Ensure the response is a valid YAML document.
Add the following configuration to your MCP ecosystem settings:
{
"mcpServers": {
"notion": {
"command": "uvx",
"args": [
"mcp-openapi-proxy"
],
"env": {
"API_KEY": "ntn_<your_key>",
"OPENAPI_SPEC_URL": "https://storage.googleapis.com/versori-assets/public-specs/20240214/NotionAPI.yml",
"SERVER_URL_OVERRIDE": "https://api.notion.com",
"EXTRA_HEADERS": "Notion-Version: 2022-06-28"
}
}
}
}
Launch the proxy with the Notion configuration:
OPENAPI_SPEC_URL="https://storage.googleapis.com/versori-assets/public-specs/20240214/NotionAPI.yml" SERVER_URL_OVERRIDE="https://api.notion.com" EXTRA_HEADERS="Notion-Version: 2022-06-28" API_KEY="ntn_<your_key>" uvx mcp-openapi-proxy
After starting the service, refer to the JSON-RPC Testing section for instructions on listing resources and tools.
Asana provides a rich set of endpoints for managing workspaces, tasks, projects, and users. The integration tests demonstrate usage of endpoints such as GET /workspaces
, GET /tasks
, and GET /projects
.
Retrieve the Asana OpenAPI specification:
curl https://raw.githubusercontent.com/Asana/openapi/refs/heads/master/defs/asana_oas.yaml
Ensure the response is a valid YAML (or JSON) document.
Add the following configuration to your MCP ecosystem settings:
{
"mcpServers": {
"asana": {
"command": "uvx",
"args": [
"mcp-openapi-proxy"
],
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/Asana/openapi/refs/heads/master/defs/asana_oas.yaml",
"SERVER_URL_OVERRIDE": "https://app.asana.com/api/1.0",
"TOOL_WHITELIST": "/workspaces,/tasks,/projects,/users",
"API_KEY": "${ASANA_API_KEY}"
}
}
}
}
Note: Most Asana API endpoints require authentication. Set ASANA_API_KEY
in your environment or .env
file with a valid token.
Start the service with:
ASANA_API_KEY="<your_asana_api_key>" OPENAPI_SPEC_URL="https://raw.githubusercontent.com/Asana/openapi/refs/heads/master/defs/asana_oas.yaml" SERVER_URL_OVERRIDE="https://app.asana.com/api/1.0" TOOL_WHITELIST="/workspaces,/tasks,/projects,/users" uvx mcp-openapi-proxy
You can then use the MCP ecosystem to list and invoke tools for endpoints like /dcim/devices/
and /ipam/ip-addresses/
.
APIs.guru provides a directory of OpenAPI definitions for thousands of public APIs. This example shows how to use mcp-openapi-proxy to expose the APIs.guru directory as MCP tools.
Retrieve the APIs.guru OpenAPI specification:
curl https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/apis.guru/2.2.0/openapi.yaml
Ensure the response is a valid OpenAPI YAML document.
Add the following configuration to your MCP ecosystem settings:
{
"mcpServers": {
"apisguru": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/apis.guru/2.2.0/openapi.yaml"
}
}
}
}
Start the service with:
OPENAPI_SPEC_URL="https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/apis.guru/2.2.0/openapi.yaml" uvx mcp-openapi-proxy
You can then use the MCP ecosystem to list and invoke tools such as listAPIs
, getMetrics
, and getProviders
that are defined in the APIs.guru directory.
NetBox is an open-source IP address management (IPAM) and data center infrastructure management (DCIM) tool. This example demonstrates how to use mcp-openapi-proxy to expose the NetBox API as MCP tools.
Retrieve the NetBox OpenAPI specification:
curl https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/netbox.dev/3.4/openapi.yaml
Ensure the response is a valid OpenAPI YAML document.
Add the following configuration to your MCP ecosystem settings:
{
"mcpServers": {
"netbox": {
"command": "uvx",
"args": ["mcp-openapi-proxy"],
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/netbox.dev/3.4/openapi.yaml",
"API_KEY": "${NETBOX_API_KEY}"
}
}
}
}
Note: Most NetBox API endpoints require authentication. Set NETBOX_API_KEY
in your environment or .env
file with a valid token.
Start the service with:
OPENAPI_SPEC_URL="https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/netbox.dev/3.4/openapi.yaml" API_KEY="$NETBOX_API_KEY" uvx mcp-openapi-proxy
You can then use the MCP ecosystem to list and invoke tools for endpoints like /dcim/devices/
and /ipam/ip-addresses/
.
You can integrate the Box Platform API using your own developer token for authenticated access to your Box account. This example demonstrates how to expose Box API endpoints as MCP tools.
examples/box-claude_desktop_config.json
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/box.com/2.0.0/openapi.yaml",
"TOOL_WHITELIST": "/folders/{folder_id}/items,/files/{file_id},/search,/recent_items",
"API_KEY": "${BOX_API_KEY}"
}
Set your Box developer token as an environment variable in .env
:
BOX_API_KEY=your_box_developer_token
Or run the proxy with a one-liner:
OPENAPI_SPEC_URL="https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/box.com/2.0.0/openapi.yaml" API_KEY="$BOX_API_KEY" uvx mcp-openapi-proxy
You can now use the MCP ecosystem to list and invoke Box API tools. For integration tests, see tests/integration/test_box_integration.py
.
Note: developer api keys for free tier box users are limited to 60 minutes :(.
You can integrate the WolframAlpha API using your own App ID for authenticated access. This example demonstrates how to expose WolframAlpha API endpoints as MCP tools.
examples/wolframalpha-claude_desktop_config.json
{
"mcpServers": {
"wolframalpha": {
"command": "uvx",
"args": [
"mcp-openapi-proxy"
],
"env": {
"OPENAPI_SPEC_URL": "https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/wolframalpha.com/v0.1/openapi.yaml",
"API_KEY": "${WOLFRAM_LLM_APP_ID}"
}
}
}
}
Set your WolframAlpha App ID as an environment variable in .env
:
WOLFRAM_LLM_APP_ID=your_wolfram_app_id
Or run the proxy with a one-liner:
OPENAPI_SPEC_URL="https://raw.githubusercontent.com/APIs-guru/openapi-directory/refs/heads/main/APIs/wolframalpha.com/v0.1/openapi.yaml" API_KEY="$WOLFRAM_LLM_APP_ID" uvx mcp-openapi-proxy
You can now use the MCP ecosystem to list and invoke WolframAlpha API tools. For integration tests, see tests/integration/test_wolframalpha_integration.py
.
For alternative testing, you can interact with the MCP server via JSON-RPC. After starting the server, paste the following initialization message:
{"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"claude-ai","version":"0.1.0"}},"jsonrpc":"2.0","id":0}
Expected response:
{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":"2024-11-05","capabilities":{"experimental":{},"prompts":{"listChanged":false},"resources":{"subscribe":false,"listChanged":false},"tools":{"listChanged":false}},"serverInfo":{"name":"sqlite","version":"0.1.0"}}}
Then paste these follow-up messages:
{"method":"notifications/initialized","jsonrpc":"2.0"}
{"method":"resources/list","params":{},"jsonrpc":"2.0","id":1}
{"method":"tools/list","params":{},"jsonrpc":"2.0","id":2}
TOOL_WHITELIST
matches desired endpoints.API_KEY
and API_AUTH_TYPE
are correct.DEBUG=true
for detailed output to stderr.uvx mcp-openapi-proxy
FAQs
MCP server for exposing OpenAPI specifications as MCP tools.
We found that mcp-openapi-proxy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.