Home / MCP / MCP OpenAPI Proxy MCP Server

MCP OpenAPI Proxy MCP Server

Exposes OpenAPI-defined REST APIs as MCP tools for flexible, endpoint-driven automation.

javascript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "glama": {
            "command": "uvx",
            "args": [
                "mcp-openapi-proxy"
            ],
            "env": {
                "OPENAPI_SPEC_URL": "https://glama.ai/api/mcp/openapi.json",
                "OPENAPI_LOGFILE_PATH": "/var/log/mcp-openapi-proxy.log",
                "OPENAPI_SIMPLE_MODE": "true"
            }
        }
    }
}

You run an MCP server that dynamically exposes REST APIs defined by OpenAPI specifications as MCP tools, letting you invoke any API endpoint from within your MCP workflows without writing custom adapters. This approach makes it easy to integrate external APIs into your tooling, while letting you control access and authentication through MCP features.

How to use

Start by choosing an MCP client to connect to the MCP server. You will configure the client to load the OpenAPI specification, then the server automatically creates tools for API endpoints or provides a simple, predefined set of tools in FastMCP mode. Use the tools to list available endpoints, call specific API operations, and filter which endpoints are exposed through whitelisting. You can also tailor authentication and headers to meet the requirements of each API.

How to install

Prerequisites: you need a runtime capable of running MCP servers (the provider typically uses a command-line runner named uvx). Ensure you have internet access to fetch the OpenAPI specification and start the MCP server.

Install the MCP server package via the runtime you use for MCP servers.

Run the server with the provided command and environment variables. You will point the server at an OpenAPI specification URL and, optionally, provide authentication tokens and extra headers.

Configuration and deployment examples

{
  "mcpServers": {
    "glama": {
      "command": "uvx",
      "args": ["mcp-openapi-proxy"],
      "env": {
        "OPENAPI_SPEC_URL": "https://glama.ai/api/mcp/openapi.json"
      }
    }
  }
}
{
  "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>"
      }
    }
  }
}
{
  "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"
      }
    }
  }
}

Environment variables to know and how they affect behavior

OpenAPI specification URL is required to load endpoints. You can enable simple mode by setting OPENAPI_SIMPLE_MODE to true, which exposes a fixed, predefined set of tools. You may filter which endpoints are exposed with TOOL_WHITELIST and customize how tool names appear with TOOL_NAME_PREFIX. You can override the base API URL with SERVER_URL_OVERRIDE for deployments that sit behind a gateway or proxy.

Examples of common configurations

Glama example focuses on quick testing with a single OPENAPI_SPEC_URL. Fly.io, Render, Slack, GetZep, Virustotal, Notion, Asana, APIs.guru, NetBox, Box API, and WolframAlpha examples show how to tailor authentication, headers, whitelists, and server URLs for various services.

{
  "mcpServers": {
    "glama": {
      "command": "uvx",
      "args": ["mcp-openapi-proxy"],
      "env": {
        "OPENAPI_SPEC_URL": "https://glama.ai/api/mcp/openapi.json"
      }
    }
  }
}
{
  "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>",
        "STRIP_PARAM": "token",
        "TOOL_NAME_PREFIX": "slack_"
      }
    }
  }
}
{
  "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_"
      }
    }
  }
}

Troubleshooting quick tips

If you cannot load endpoints, verify OPENAPI_SPEC_URL points to a valid OpenAPI document. Check TOOL_WHITELIST to ensure endpoints are correctly whitelisted. Ensure API_KEY and API_AUTH_TYPE match the API's requirements. Increase debug output with DEBUG=true to diagnose issues.

Notes on authentication and headers

By default, the server uses a Bearer token in the Authorization header. You can override this via API_AUTH_TYPE to support APIs that require Api-Key or other schemes. You can also attach extra headers through EXTRA_HEADERS to meet specific API requirements.

Tools you can work with

You can list and invoke tools that represent API endpoints defined in the loaded OpenAPI specification. Common tool groups include endpoints for listing APIs, retrieving metrics, and obtaining providers. These actions enable you to quickly explore and leverage many APIs from your MCP workflows.

Security and access control

Protect access to API keys and tokens by configuring environment variables in your MCP runtime and avoiding hard-coded secrets. Use the provided authentication modes and header customization to align with each API’s security requirements.

Notable sections of the setup you may reuse

OpenAPI_SPEC_URL provides the path to the OpenAPI document. TOOL_WHITELIST can constrain which endpoints become tools. TOOL_NAME_PREFIX adds a prefix to tool names. EXTRA_HEADERS lets you add custom HTTP headers to outgoing API requests. SERVER_URL_OVERRIDE allows you to point the server at a different base URL when needed.

Glossary of commands and endpoints

The server transforms OpenAPI endpoint paths into tool names by normalizing the paths and methods. For example, /chat/completions becomes chat_completions. Endpoints summaries and descriptions are used to describe each tool.

License and usage terms

This server is provided under the MIT License. Use, modify, and distribute in compliance with the license terms.

Available tools

listAPIs

Lists APIs defined in the loaded OpenAPI specification.

getMetrics

Retrieves usage and performance metrics for APIs exposed through the proxy.

getProviders

Returns provider information for the available APIs in the OpenAPI catalog.