Skip to main content
Glama
OpenAPI MCP Gateway

OpenAPI MCP Gateway

by RemyTinco

OpenAPI MCP Gateway

A command-line tool that turns local OpenAPI files into MCP tools for AI agents such as Claude Code. Point it at the OpenAPI schema of an existing REST API, say which operations may be used, and the agent can call them. The backend application does not change and you write no Python.

  • Several REST APIs behind one MCP server, each with its own credentials. A credential is only ever sent to the backend it belongs to.

  • Safe by default: only GET and HEAD operations are exposed unless you say otherwise.

  • Works with any OpenAPI 3.0.x or 3.1.x document in YAML or JSON (Django REST Framework with drf-spectacular, FastAPI, Flask, and others). The gateway runs on your machine over stdio.

Quickstart (about 60 seconds)

You need Python 3.14 or newer and uv. The package is not on PyPI yet; until the first release, install from a clone:

git clone https://github.com/RemyTinco/openapi-mcp-gateway
cd openapi-mcp-gateway
uv tool install .        # installs the `openapi-mcp-gateway` command

Once released it will be uv tool install openapi-mcp-gateway.

Check the bundled example, which needs no network access:

export SHOP_API_TOKEN=any-value-for-this-check
openapi-mcp-gateway validate --config examples/single-backend/gateway.yaml
openapi-mcp-gateway list-tools --config examples/single-backend/gateway.yaml

Expected tools: shop_products_list, shop_products_retrieve and shop_orders_list. Register the gateway with Claude Code, using an absolute path:

claude mcp add --transport stdio openapi-gateway \
  -- openapi-mcp-gateway serve --config "$PWD/examples/single-backend/gateway.yaml"

The example points at shop.example.com, which does not exist, so tool calls fail with a backend_unavailable error. To use your own API, follow Getting started.

Related MCP server: OpenAPI MCP Server

Documentation

Page

What is in it

Getting started

Install, export a schema, configure a backend, connect Claude Code

Configuration

Every configuration key, tool names, error payloads, logging

Exposure modes

read_only, allowlist, all, exclusions and path patterns

Authentication

Bearer tokens, API keys, how secrets are handled

Security

What the gateway protects, and what it does not

Architecture

How it works, design decisions, FastMCP limitations, benchmark

Acceptance

Which test or document proves each v1.0 acceptance criterion

Examples

Three runnable configurations

Contributing

Development setup and checks

Security note

The gateway lets an AI agent act on your APIs. Expose only operations that are appropriate for the agent, give it credentials with the least privilege the backend allows, and remember that the gateway does not redact upstream responses: whatever an exposed operation returns, the agent sees. GET and HEAD are only nominally safe. Read Security before pointing the gateway at a production API. To report a vulnerability see SECURITY.md.

Licence

Apache License 2.0. See LICENSE.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Exposes REST API endpoints defined in an OpenAPI Specification as MCP tools, allowing AI models to call them via the ModelContext Protocol.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Exposes REST API endpoints defined by OpenAPI specifications as MCP tools, enabling LLMs to discover and interact with those APIs through MCP.
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Turns any OpenAPI 3.0/3.1 spec into validated MCP tools, letting hosts call allowed API operations locally with strict schemas, secure credential handling, and read-only-by-default filtering.
      3
      MIT