gitnexus
MCPShips with gitnexus: GitNexus indexes a codebase into a knowledge graph of symbols, calls, dependencies and execution flows. Use…
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…
Claude Code
$ claude mcp add tunnelMcp -- node ./mcp/server.cjs --stdio
Codex
$ codex mcp add tunnelMcp -- node ./mcp/server.cjs --stdio
Cursor
{ "mcpServers": { "tunnelMcp": { "command": "node", "args": [ "./mcp/server.cjs", "--stdio" ] } } }
Add it to mcp.json.
Gemini CLI
{ "mcpServers": { "tunnelMcp": { "command": "node", "args": [ "./mcp/server.cjs", "--stdio" ] } } }
Add it to settings.json.
GitHub Copilot
$ copilot mcp add tunnelMcp -- node ./mcp/server.cjs --stdio
OpenCode
{ "mcp": { "tunnelMcp": { "type": "local", "command": [ "node", "./mcp/server.cjs", "--stdio" ] } } }
Add it to opencode.json.
Windsurf
{ "mcpServers": { "tunnelMcp": { "command": "node", "args": [ "./mcp/server.cjs", "--stdio" ] } } }
Add it to mcp_config.json.
Security report
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 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:
/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.
--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.docs/onboarding.md.docs/architecture.md.docs/permissions.md.docs/deployment/overview.md.docs/troubleshooting.md.docs/protocol.md and use
docs/openapi.json. Optional client features use the
common X-Tunnel-Client-Capabilities header.--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.--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.examples/go-sdk-inmemory.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.
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
developers.openai.com/api/docs/guides/secure-mcp-tunnelsdocs/end-user-guide.mddocs/onboarding.mddocs/permissions.mddocs/architecture.mddocs/connectors.mddocs/protocol.mddocs/openapi.jsondocs/enterprise-customer-onboarding.mddocs/configuration.mddocs/deployment/overview.mddocs/deployment/cloudflared.mddocs/troubleshooting.md, including
DNS diagnostic logs for Android / Termux.docs/development.mdexamples/go-sdk-inmemorydocs/roadmap.mdOn 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
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:
Ships with gitnexus: GitNexus indexes a codebase into a knowledge graph of symbols, calls, dependencies and execution flows. Use…
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…