Converts OpenAPI specifications or local MCP servers into public HTTPS endpoints using a secure tunnel for use with AI clients.
Also known as Fetch-Hive/openapi-mcp, openapi-mcp, @fetch-hive/mcp-gateway
- Stars
- 1
- Tools
- —
- Downloads, 30 days
- 568
- Latest version
- 0.11.4
- Last commit
- Nov 10, 2026
- License
- Apache-2.0
What is Gateway (Open API To MCP) MCP?
Gateway (Open API To MCP) converts OpenAPI specifications or local MCP servers into public HTTPS endpoints using a secure tunnel for use with AI clients.
Summary generated from the project's README
About Gateway (Open API To MCP) MCP server
Exposing local APIs or existing MCP servers to AI clients like Claude, Cursor, or VS Code is what this tool accomplishes. It functions by converting OpenAPI specifications or running local processes into public HTTPS endpoints. Developers can use it to bridge the gap between a private development environment and remote AI agents without needing to manage inbound port forwarding.
Users can run the gateway locally to compile an OpenAPI document or use the tunnel command to wrap a stdio server or a Streamable HTTP URL. The system provides a public URL via a secure tunnel, allowing remote clients to connect using a bearer token. Security is handled through loopback binding by default, an SSRF-hardened outbound dialer, and specific flags like --allow-private-networks for accessing local resources.
Setup involves initializing the gateway and adding a specification via a file or a URL. For local development involving HTTP, the --insecure-http flag is required. The tool supports various deployment methods on PaaS or VPS providers and can be installed via Homebrew, Docker, or npm.
What you can do with it
- 1Expose local development APIsTurn a running web service on your laptop into a public endpoint for an AI editor.
- 2Tunnel existing MCP serversProvide a public HTTPS URL for a local stdio server so remote agents can access it.
- 3Convert OpenAPI specs to MCPTransform a standard OpenAPI documentation file into a functional MCP toolset.
- 4Securely connect remote AI clientsAllow tools like Cursor or Claude to interact with private network services using bearer tokens.
Written from the project's README. Every use case is checked against a quote from it.
How to install Gateway (Open API To MCP) MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Gateway (Open API To MCP) MCP in Claude Code
$ claude mcp add --env 'MCP_GATEWAY_TOKEN=<YOUR_MCP_GATEWAY_TOKEN>' openapi-mcp -- npx -y @fetch-hive/mcp-gatewayInstall Gateway (Open API To MCP) MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"openapi-mcp": {
"command": "npx",
"args": [
"-y",
"@fetch-hive/mcp-gateway"
],
"env": {
"MCP_GATEWAY_TOKEN": "<YOUR_MCP_GATEWAY_TOKEN>"
}
}
}
}Install Gateway (Open API To MCP) MCP in VS Code
.vscode/mcp.json
{
"servers": {
"openapi-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@fetch-hive/mcp-gateway"
],
"env": {
"MCP_GATEWAY_TOKEN": "<YOUR_MCP_GATEWAY_TOKEN>"
}
}
}
}Install Gateway (Open API To MCP) MCP in VS Code CLI
$ code --add-mcp '{"name":"openapi-mcp","type":"stdio","command":"npx","args":["-y","@fetch-hive/mcp-gateway"],"env":{"MCP_GATEWAY_TOKEN":"<YOUR_MCP_GATEWAY_TOKEN>"}}'Install Gateway (Open API To MCP) MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"openapi-mcp": {
"command": "npx",
"args": [
"-y",
"@fetch-hive/mcp-gateway"
],
"env": {
"MCP_GATEWAY_TOKEN": "<YOUR_MCP_GATEWAY_TOKEN>"
}
}
}
}Install Gateway (Open API To MCP) MCP in Codex
$ codex mcp add openapi-mcp --env 'MCP_GATEWAY_TOKEN=<YOUR_MCP_GATEWAY_TOKEN>' -- npx -y @fetch-hive/mcp-gatewayInstall Gateway (Open API To MCP) MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.openapi-mcp] command = "npx" args = ["-y", "@fetch-hive/mcp-gateway"] [mcp_servers.openapi-mcp.env] MCP_GATEWAY_TOKEN = "<YOUR_MCP_GATEWAY_TOKEN>"
Install Gateway (Open API To MCP) MCP in Gemini CLI
$ gemini mcp add -s user -e 'MCP_GATEWAY_TOKEN=<YOUR_MCP_GATEWAY_TOKEN>' openapi-mcp npx -- -y @fetch-hive/mcp-gatewayInstall Gateway (Open API To MCP) MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"openapi-mcp": {
"command": "npx",
"args": [
"-y",
"@fetch-hive/mcp-gateway"
],
"env": {
"MCP_GATEWAY_TOKEN": "<YOUR_MCP_GATEWAY_TOKEN>"
}
}
}
}Configuration
MCP_GATEWAY_TOKENRequiredSecretBearer token printed once by mcp-gateway init
| Name | Description | |
|---|---|---|
| MCP_GATEWAY_TOKEN | Bearer token printed once by mcp-gateway init | RequiredSecret |
Automated checks
Ran Nov 13, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablefetch-hive/openapi-mcp is public and reachablegithub.com/fetch-hive/openapi-mcp ↗Pass
- Package names this repository as its source@fetch-hive/mcp-gateway names fetch-hive/openapi-mcp as sourcenpmjs.com/package/@fetch-hive/mcp-gateway ↗Pass
- Build provenance (Sigstore attestation)Sigstore attestation for @fetch-hive/mcp-gatewaynpmjs.com/package/@fetch-hive/mcp-gateway/v/0.11.4#provenanc ↗Pass
- Open source license (OSI)Apache-2.0spdx.org/licenses/Apache-2.0.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-11-10github.com/fetch-hive/openapi-mcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @fetch-hive/mcp-gatewayPass
- No critical advisory in the package or its dependencies6 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubmcp-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
--tunneland remote clients gethttps://<name>.mcp.fetchhive.com/mcpwhile 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
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
- Connect Cursor, Codex, Claude Code
- Tunnel (local server, public URL)
- CLI reference
- Config schema
- Deploy (PaaS + VPS)
- SSRF policy
- Private-network flag
- Tunnel protocol
Licence
Apache License 2.0. See LICENSE and NOTICE.
Gateway (Open API To MCP) MCP questions
How do I add Gateway (Open API To MCP) MCP to Claude Code?
Run claude mcp add --env 'MCP_GATEWAY_TOKEN=<YOUR_MCP_GATEWAY_TOKEN>' openapi-mcp -- npx -y @fetch-hive/mcp-gateway in your terminal. Add --scope user to make it available in every project.
How do I add Gateway (Open API To MCP) MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How can I make my local API accessible to remote AI clients?
You can use the --tunnel flag to create a public HTTPS URL that allows remote clients to connect to your local process without requiring inbound port configuration.
Does the gateway support existing MCP servers?
Yes, it can tunnel an existing MCP server that is already running on your machine via HTTP or stdio.