Skip to content
MCP Servers
MCP

tunnelMcp

Ships with tunnel-client: tunnel-client is the customer-run agent behind Secure MCP Tunnel. It connects a private or localhost MCP (Model Context Protocol) server to ChatGPT, Codex, the Responses API, and…

From plugin
tunnel-client
6471 skill1 MCP

Claude Code

$ claude mcp add tunnelMcp -- node ./mcp/server.cjs --stdio

Security report

Info

Not enough data

  • Known flaws

    Not published

  • Signed build

    Not published

  • Maintained

    Nov 18, 2026

    Last push

  • Licence

    Apache-2.0

  • Runs as

    Local process

    On your machine

  • Deprecated

    Not published

Signals from public registries, not an audit. Checked Nov 20, 2026.

tunnel-client README

Secure MCP Tunnel client

tunnel-client is the customer-run agent behind Secure MCP Tunnel. It connects a private or localhost MCP (Model Context Protocol) server to ChatGPT, Codex, the Responses API, and AgentKit through an OpenAI-hosted MCP tunnel endpoint, while keeping the MCP server off the public internet.

This CLI and its Go SDK run beside your private MCP server. Applications call the OpenAI-hosted /v1/mcp/{tunnel_id} endpoint through their MCP transport; the runtime receives those requests and delivers responses. The poll/response endpoints are the runtime's queue protocol for client implementers. See the architecture for the request flow and the protocol when building a compatible runtime.

Use it when:

  • You have an MCP server on a laptop, VM, Kubernetes cluster, or private network and need an OpenAI-hosted product to reach it.
  • Security will not approve a new inbound firewall rule or public endpoint for the MCP server.
  • You want an operator-visible daemon with /healthz, /readyz, /metrics, and /ui before a connector or API call depends on it.

If you searched for "secure MCP tunnel", "MCP tunnel ChatGPT", "connect local MCP server to ChatGPT", "connect local MCP server to Codex", "localhost to ChatGPT", or "Codex local MCP", start with tunnel-client help quickstart, then read the onboarding guide below.

Start Here

  • Selecting a regional control-plane endpoint? Use --control-plane.residency, CONTROL_PLANE_RESIDENCY, or YAML control_plane.residency. See the endpoint catalog and mTLS settings. Endpoint selection is independent of regional Tunnel service availability.
  • Need the shortest working path from localhost or a private MCP server to ChatGPT or Codex? Start with docs/onboarding.md.
  • Need the customer-shareable network and trust-boundary story? Read docs/architecture.md.
  • Need roles, groups, tunnel IDs, or API keys? Read docs/permissions.md.
  • Need Docker, Kubernetes, or VM deployment guidance? Read docs/deployment/overview.md.
  • Need to debug readiness, connector discovery, or OAuth? Read docs/troubleshooting.md.
  • Building a compatible client in another language? Read docs/protocol.md and use docs/openapi.json. Optional client features use the common X-Tunnel-Client-Capabilities header.
  • Upgrading for server-directed polling placement? Read the routing correction and activation notes. Supporting clients work with existing services immediately; corrections are enabled separately after client release. No configuration change is needed.
  • Using MCP timing or distributed tracing? Read the timing release and rollback guidance. Trace forwarding is disabled by default; opt in with --mcp.forward-trace-context to carry W3C trace context in MCP params._meta over stdio and Streamable HTTP. Opt-in local span export uses --tracing.enabled --tracing.file=/private/new-trace.jsonl. Complete traces require compatible service queue handoff and caller parent propagation first.
  • Forwarding the original HTTP request ID? MCP HTTP forwarding is enabled by default. Use --forward-request-id=mcp,harpoon to include Harpoon REST requests, --forward-request-id=mcp,oauth to include eligible queued OAuth discovery requests, or --forward-request-id=none to disable automatic forwarding. The same setting is available as FORWARD_REQUEST_ID or top-level YAML forward_request_id; see request ID forwarding.
  • Using a namespaced tunnel ID? Preserve the full ID returned by the service. The client accepts legacy IDs and aliases with a four-character namespace; see tunnel identifiers.
  • Embedding an MCP server directly in a Go process? Use the Go SDK with the MCP SDK's in-memory transport; see examples/go-sdk-inmemory.

Try the embedded demo

With a runtime API key and tunnel ID, run the built-in server_info, echo, and uppercase tools without a separate MCP server:

export CONTROL_PLANE_API_KEY="sk-..."
export CONTROL_PLANE_TUNNEL_ID="tunnel_0123456789abcdef0123456789abcdef"
tunnel-client run --embedded-stateless-mcp-stub --health.listen-addr 127.0.0.1:0

--embedded-stateless-mcp-stub uses stateless MCP handling even when a client sends initialize and notifications/initialized. It issues no MCP session ID, and these demo tools do not require MCP session affinity between processes. OAuth and application state have separate requirements.

--embedded-mcp-stub keeps its existing compatibility behavior: legacy initialization and session requests use stateful handling; self-contained modern discovery and tool requests use stateless handling. Choose one embedded mode per run. Both share the embedded listen-address, Unix-socket, server-name, and server-version options; see embedded demo configuration for defaults and target conflicts.

Embed as a Go SDK

The module can run in the same process as a Go MCP server. The MCP server does not need to bind a port or use stdio: give the server side of an in-memory MCP transport pair to your server and the client side to tunnelclient.New.

go get github.com/openai/tunnel-client
import (
    "context"

    "github.com/modelcontextprotocol/go-sdk/mcp"
    tunnelclient "github.com/openai/tunnel-client"
)

ctx := context.Background()
server := mcp.NewServer(&mcp.Implementation{Name: "my-server", Version: "1.0.0"}, nil)
serverTransport, tunnelTransport := mcp.NewInMemoryTransports()
go server.Run(ctx, serverTransport)

client, err := tunnelclient.New(tunnelclient.Config{
    TunnelID: "tunnel_0123456789abcdef0123456789abcdef",
    APIKey:   apiKey,
}, tunnelTransport)
if err != nil {
    return err
}
return client.Run(ctx)

The runnable Go SDK example registers an echo tool and connects it to the OpenAI Tunnel control plane.

If your gateway serves tunnel runtime requests under a custom path, set --control-plane.tunnel-base-path=/custom/tunnels or set Config.TunnelBasePath in the Go SDK. The default is /v1/tunnels. To send an extra header on runtime requests, pass --control-plane.extra-headers "X-Example-Header: example" or set Config.ControlPlaneExtraHeaders in the SDK. Configuration reference

Documentation Map

Install with Homebrew

On macOS, Homebrew is the supported installation path. Directly downloaded release ZIPs are not currently notarized and can be blocked by Gatekeeper. If a manually downloaded archive is blocked, do not use xattr, spctl, or Open Anyway to bypass the check; install from the official OpenAI tap instead:

brew install openai/tools/tunnel-client

Verify the installed version, then start with the guided setup:

tunnel-client --version
tunnel-client help quickstart

The Formula installs the matching tunnel-client, bundled cloudflared, and companion manifest together, while exposing only the tunnel-client command. It also installs Bash, Zsh, and Fish completions for that version. If your shell does not load them automatically, follow Homebrew's shell completion setup. For Docker, Kubernetes, or VM deployments, see docs/deployment/overview.md.

To generate the shareable guide output locally:

make end-user-guide-screenshots
make end-user-guide-html
make end-user-guide-slides

Start at macOS login

The Homebrew Formula supports brew services. It supervises tunnel-client run using the profile at $(brew --prefix)/etc/tunnel-client.yaml, starts at login, and restarts the runtime after it exits. Installation and upgrades do not create or replace that profile.

First, select the profile you already configured. If it belongs to a managed alias, find its profile_path with tunnel-client runtimes status <alias> --json, then run tunnel-client runtimes stop <alias> before starting the service. Copy the profile to the service location, preserving your custom settings:

service_profile="$(brew --prefix)/etc/tunnel-client.yaml"
if [ -e "$service_profile" ]; then
  cp -p "$service_profile" "$service_profile.backup.$(date +%Y%m%d%H%M%S)"
fi
install -m 600 /absolute/path/to/existing-profile.yaml "$service_profile"

Use absolute paths in this profile, including paths to MCP executables, working directories, and secret files. The service includes Homebrew's bin and sbin on PATH, but does not load your interactive shell configuration. Replace shell-only env: references with persistent references such as this existing profile field:

control_plane:
  api_key: file:/Users/YOU/.config/tunnel-client/runtime.key

Store the runtime API key in that file with permissions 0600; keep its directory private too. The service definition contains the profile path, not the key. Validate the profile, then start the service as your logged-in user, without sudo:

tunnel-client doctor --profile-file "$(brew --prefix)/etc/tunnel-client.yaml"
brew services start openai/tools/tunnel-client
brew services info openai/tools/tunnel-client
tunnel-client health --url http://127.0.0.1:8080 --json

The health command above uses the default listener. If your profile configures a different health address or a health.url_file, use that address or health --url-file /absolute/path/to/health-url instead. An active service alone does not mean the tunnel is ready. Inspect $(brew --prefix)/var/log/tunnel-client.log and any log.file destination in your profile if startup fails.

Use Homebrew to manage this runtime:

@openai
Ships withtunnel-client
6471 skill1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
647
Star history of openai/tunnel-client on GitHub, a chart by star-history.com

More MCP servers from other plugins.

gitnexus

gitnexus

MCP

Ships with gitnexus: GitNexus indexes a codebase into a knowledge graph of symbols, calls, dependencies and execution flows. Use…

gitnexustoday49k
@abhigyanpatwari@abhigyanpatwariInstall MCP
mcp-use-docs

mcp-use-docs

MCP

Ships with mcp-use: The fullstack MCP framework to develop MCP Apps for ChatGPT / Claude & MCP Servers for AI Agents.

mcp-use6d11k
@mcp-use@mcp-useInstall MCP
cloudwatch

cloudwatch

MCP

Amazon's monitoring service that collects metrics, logs and alarms across AWS infrastructure and apps.

mcp2d9.9k
@awslabs@awslabsInstall MCP
treg

treg

MCP

Ships with treg: OpenRouter, but for agent tools instead of models. Point an agent at one base URL with one token and it can do…

treg1d8.4k
@superdesigndev@superdesigndevInstall MCP

Questions about tunnelMcp.

Which coding agents can use tunnelMcp?
tunnelMcp works in any agent that reads an MCP config file: Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf. Each agent reads it from its own file; this page names the file for each one.
How do I add tunnelMcp to Claude Code?
Run this in your terminal: claude mcp add tunnelMcp -- node ./mcp/server.cjs --stdio