mcp-gateway: OpenAPI to MCP endpoint tool

mcp-gateway: OpenAPI to MCP endpoint tool

openapi-mcp-fetch-hive•byfetch-hive

A CLI that compiles an OpenAPI spec into an MCP endpoint for clients, or tunnels a locally running MCP server to a public HTTPS URL.

License: Apache License 2.0•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Compiles OpenAPI 3.0/3.1 documents into a versioned IR and serves the resulting tools over Streamable HTTP or stdio.
  • •Works against either a live public API spec or an API running locally, such as a localhost instance or Docker compose stack.
  • •With the tunnel option, exposes a loopback process at a public HTTPS MCP URL without opening an inbound port.
  • •Can tunnel an MCP server the CLI did not compile, either a Streamable HTTP URL or a stdio server.

BEST FOR

  • •Developers who want to expose an existing REST API with an OpenAPI spec as MCP tools for editor or agent clients.
  • •Teams running an MCP server on localhost that need to reach remote clients through a public URL.
  • •Self-hosting on PaaS or VPS platforms with a required bearer token and spec URL configured.

ABOUT OPENAPI-MCP-FETCH-HIVE

mcp-gateway: OpenAPI to MCP endpoint tool is cataloged as an MCP server attributed to fetch-hive. A CLI that compiles an OpenAPI spec into an MCP endpoint for clients, or tunnels a locally running MCP server to a public HTTPS URL. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Apache License 2.0. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for mcp-gateway: OpenAPI to MCP endpoint tool are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What security defaults does mcp-gateway use?

It binds to loopback by default, requires a bearer token, and uses an SSRF-hardened outbound dialer; binding 0.0.0.0 requires an explicit expose flag.

Do I need an account to use the tunnel?

No account is needed for an anonymous tunnel URL, though login is available for optional named URLs.

Can I connect an API that only serves plain HTTP on localhost?

Yes, with the insecure-http and allow-private-networks flags together, and the host must be loopback, RFC1918, or IPv6 ULA.

上游原版 README

在 GitHub 查看同一版本原文

README.md · d4a316b325e6 · 采集于 2026-11-13 14:15:04 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

mcp-gateway

An open-source project by Fetch Hive.

OpenAPI to MCP, with a tunnel. Turn an OpenAPI spec, or an MCP server already running on your machine, into an MCP endpoint any client can call: Cursor, Codex, Claude Code, VS Code, ChatGPT, Claude, or any MCP client.

  • Live API or localhost. Compile a public spec, or the API on your laptop: a WIP branch, localhost:3000, a Docker compose stack.
  • Public HTTPS URL, no inbound port. Add --tunnel and remote clients get https://<name>.mcp.fetchhive.com/mcp while your process stays on loopback.
  • Safe defaults. Loopback bind, bearer token required, SSRF-hardened outbound dialer.

Prefer a hosted MCP Gateway with tokens, quotas, and a dashboard? https://fetchhive.com/mcp

Two equally important flows

1. Local / branch API → editor

Your server is already running on this machine. It does not need to be an MCP server. The gateway compiles the OpenAPI document and serves the MCP endpoint. mcp-gateway tunnel <mcp-url> is the other flow: the local process already speaks MCP. A plain REST app returning 404 for POST /mcp is expected.

Compile from a file, or from the OpenAPI URL the API already serves. Use one add-spec command, not both.

mcp-gateway init --allow-private-networks
# from a file:
mcp-gateway add-spec --name demo --file ./openapi.yaml \
  --base-url http://127.0.0.1:3000 --insecure-http
# or from the URL the API already serves:
mcp-gateway add-spec --name demo \
  --url http://127.0.0.1:3000/openapi.json \
  --insecure-http --allow-private-networks
export MCP_GATEWAY_TOKEN=…   # printed once by init
mcp-gateway test demo list_pets --args '{}'
mcp-gateway serve demo
mcp-gateway inspect demo --client cursor      # or: codex | claude-code | vscode | claude

--allow-private-networks is required for loopback and RFC1918. --insecure-http is required when the API speaks HTTP (typical on localhost). Both flags are required together to fetch an http:// spec URL, and that host must be loopback, RFC1918, or IPv6 ULA. A public http:// URL is refused. --file does not fetch anything; --base-url is the origin of this checkout, not production, and still needs both flags when that origin is HTTP on a private host.

2. Live API → editor or agent

Same compiler, public HTTPS OpenAPI, no private-network flag.

mcp-gateway init
mcp-gateway add-spec --name demo --url https://api.example.com/openapi.json
export MCP_GATEWAY_TOKEN=…
mcp-gateway serve demo
mcp-gateway inspect demo --client cursor

Or skip operating a process: hosted MCP Gateway. PaaS / VPS: deploy.

3. Local server, remote client

The process stays on loopback. An outbound tunnel gives you https://<slug>.mcp.fetchhive.com/mcp for OpenAI, Claude, Cursor, and any other client that can send a bearer header. No account. The URL is released 30 minutes after the CLI exits.

export MCP_GATEWAY_TOKEN=…
mcp-gateway serve demo --tunnel

The same tunnel also sits in front of an MCP server this CLI did not compile: a Streamable HTTP URL, or a stdio server.

mcp-gateway tunnel http://127.0.0.1:8000/mcp
mcp-gateway tunnel --stdio -- npx -y @modelcontextprotocol/server-filesystem /tmp

On a terminal, each finished call prints the HTTP method, status, duration, path, and the JSON-RPC method. tools/call also prints the tool name. That label is omitted when the body is streamed or larger than 64 KiB. Library info logs stay off that screen unless you set RUST_LOG or [log] level. Colors follow --color and NO_COLOR.

Details: Tunnel.

mcp-gateway login is optional for an anonymous URL. It stores an fh_cli_ account token in credentials.toml next to config.toml (mode 0600 on Unix). serve --name and tunnel --name read that token and keep https://<name>.mcp.fetchhive.com/mcp while the process is offline. doctor reads the file only to report the file mode and the email. Anonymous tunnels do not require login. See Account and Persistent names.

Deploy

Deploy to Render Deploy to Heroku Deploy to DigitalOcean

Guides: Render · Heroku · DigitalOcean · Hetzner. Vercel cannot run this server (why).

Set MCP_GATEWAY_TOKEN and MCP_GATEWAY_SPEC_URL (HTTPS OpenAPI; loopback HTTP is the local flow above, not this image). The image reads PORT itself (distroless, no shell). After deploy, paste mcp-gateway inspect demo --client cursor (replace the URL with your https://…/mcp) into the editor.

Install

# Homebrew — use the fully qualified name (Homebrew 6 trusts only this formula).
# `brew tap` then `brew install mcp-gateway` is refused until you `brew trust`.
brew install Fetch-Hive/tap/mcp-gateway

# Docker (linux/amd64 and linux/arm64)
docker run --rm -p 127.0.0.1:8787:8787 ghcr.io/fetch-hive/mcp-gateway:0.11.4 version

# npm — wrapper plus the prebuilt binary for this machine
npx --yes @fetch-hive/mcp-gateway version

# GitHub Release installer
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/Fetch-Hive/openapi-mcp/releases/latest/download/mcp-gateway-cli-installer.sh | sh

# From a checkout of this repo
cargo install --path crates/mcp-gateway-cli

mcp-gateway compiles OpenAPI 3.0/3.1 to a versioned IR, serves tools over Streamable HTTP or stdio, and injects upstream credentials from env or file references. Outbound HTTP uses an SSRF-hardened dialer.

Security

Default bind is loopback. Binding 0.0.0.0 requires --expose. Upstream private networks and localhost require --allow-private-networks. Report vulnerabilities to tom@fetchhive.com — see SECURITY.md.

Docs

Licence

Apache License 2.0. See LICENSE and NOTICE.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for mcp-gateway: OpenAPI to MCP endpoint tool from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/openapi-mcp-fetch-hive)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools