Tunnel Client
Customer-run client for Secure MCP Tunnel: connect private or localhost MCP servers to ChatGPT, Codex, the Responses API, and AgentKit without exposing them to…
- Transport
- Not stated
- Package
- —
- Registry id
- —
No install snippet on purpose. A working MCP config is a command, its arguments and an environment block — the last two are where API keys live, so this catalogue never stores them and cannot publish them. Follow the link above for the authors' own instructions.
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.
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/uibefore 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
- 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.mdand usedocs/openapi.json. Optional client features use the commonX-Tunnel-Client-Capabilitiesheader. - 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.
- 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"
)
From the project's README.