# Gateway (Open API To MCP) MCP server

> Converts OpenAPI specifications or local MCP servers into public HTTPS endpoints using a secure tunnel for use with AI clients.

- Repository: https://github.com/Fetch-Hive/openapi-mcp
- Page: https://hostedmcp.org/servers/fetch-hive/openapi-mcp
- Transport: stdio
- Stars: 1
- License: Apache-2.0
- Latest version: 0.11.4

## Install

### Claude Code

```sh
claude mcp add --env 'MCP_GATEWAY_TOKEN=<YOUR_MCP_GATEWAY_TOKEN>' openapi-mcp -- npx -y @fetch-hive/mcp-gateway
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "openapi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@fetch-hive/mcp-gateway"
      ],
      "env": {
        "MCP_GATEWAY_TOKEN": "<YOUR_MCP_GATEWAY_TOKEN>"
      }
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "openapi-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@fetch-hive/mcp-gateway"
      ],
      "env": {
        "MCP_GATEWAY_TOKEN": "<YOUR_MCP_GATEWAY_TOKEN>"
      }
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"openapi-mcp","type":"stdio","command":"npx","args":["-y","@fetch-hive/mcp-gateway"],"env":{"MCP_GATEWAY_TOKEN":"<YOUR_MCP_GATEWAY_TOKEN>"}}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "openapi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@fetch-hive/mcp-gateway"
      ],
      "env": {
        "MCP_GATEWAY_TOKEN": "<YOUR_MCP_GATEWAY_TOKEN>"
      }
    }
  }
}
```

### Codex

```sh
codex mcp add openapi-mcp --env 'MCP_GATEWAY_TOKEN=<YOUR_MCP_GATEWAY_TOKEN>' -- npx -y @fetch-hive/mcp-gateway
```

### Codex config.toml (`~/.codex/config.toml`)

```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>"
```

### Gemini CLI

```sh
gemini mcp add -s user -e 'MCP_GATEWAY_TOKEN=<YOUR_MCP_GATEWAY_TOKEN>' openapi-mcp npx -- -y @fetch-hive/mcp-gateway
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "openapi-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@fetch-hive/mcp-gateway"
      ],
      "env": {
        "MCP_GATEWAY_TOKEN": "<YOUR_MCP_GATEWAY_TOKEN>"
      }
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `MCP_GATEWAY_TOKEN` | yes | yes | Bearer token printed once by mcp-gateway init |

## FAQ

### 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.
