openai/tunnel-client
Go tunnel client for private MCP access from OpenAI apps without public ingress
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
The repository delivers the customer-run part of Secure MCP Tunnel: a Go CLI and an embeddable SDK, not a general-purpose MCP server or the hosted control plane. ChatGPT, Codex, the Responses API, and AgentKit use the hosted /v1/mcp/{tunnel_id} MCP endpoint. The local runtime polls for queued requests, dispatches them to the private MCP server, and sends responses back through the runtime protocol. The two interfaces serve different callers; /v1/tunnels is the default runtime base path, not the application’s MCP endpoint.
The root package exposes tunnelclient.New and supports an in-memory MCP transport pair for colocated Go servers that should not bind a port or use stdio. The stack includes the MCP Go SDK, Cobra for the CLI, and OpenTelemetry and Prometheus dependencies for observability. The wire protocol, OpenAPI contract, and X-Tunnel-Client-Capabilities header give compatible runtime implementations a defined reference for the queue interface and optional features.
Key Capabilities & Differentiators
The runtime connects to private Streamable HTTP and stdio targets, while the Go SDK can avoid both with an in-process transport. The embedded server_info, echo, and uppercase tools let operators validate the route without deploying another MCP server. --embedded-stateless-mcp-stub issues no MCP session ID even when a caller initializes; the compatibility stub retains stateful handling for legacy initialization and session requests. Neither demo mode establishes that an existing tool backend or OAuth flow is stateless.
Operators get /healthz, /readyz, /metrics, and /ui. W3C trace-context forwarding is off by default; --mcp.forward-trace-context enables it via params._meta on stdio and Streamable HTTP. Local span export is configured separately with --tracing.enabled and --tracing.file. The client can also preserve an MCP server’s request ID separately from the connector’s own identifier, which helps correlate forwarding failures with upstream logs.
Trade-offs & Limitations
Compared with direct remote MCP, this design removes the need to publish the MCP server or create a new inbound firewall rule, but adds an OpenAI-hosted endpoint and queue to the request path. If callers already have approved access to a secured MCP endpoint, direct MCP has fewer moving parts. If both ends can join the same private network, a private link may be simpler. Neither comparison makes the hosted tunnel a fully self-hosted or offline option; Apache-2.0 applies to the client code, not to the hosted service.
Availability depends on the local MCP server, the runtime, and its control-plane connection. A running daemon does not prove polling or readiness is healthy. On macOS, a login-session service will not keep serving after logout, and sleep suspends its work. An HTTP backend needs its own supervision; after it restarts, MCP sessions may need reinitialization. Do not assume interrupted calls replay or that a stateless demo justifies running multiple instances against a sessionful target.
Hardware & Deployment Guide
Start with tunnel-client help quickstart, obtain a tunnel ID and runtime API key, and run doctor with the intended profile. The supported macOS install path is brew install openai/tools/tunnel-client; use brew services for login-session supervision or choose the CLI’s managed runtime, not both for the same tunnel. Docker, Kubernetes, and VM deployment paths are covered, and the tree contains Dockerfile and Dockerfile.runtime. The source manifests specify Go 1.27 with toolchain go1.27.4 and Node 22.23.3 for the container’s UI build stage.
Before shifting connector traffic, verify readiness rather than just process status, and keep runtime credentials separate from admin credentials. v0.0.21 adds regional control-plane endpoint selection through --control-plane.residency, CONTROL_PLANE_RESIDENCY, or YAML control_plane.residency, with support in the Go SDK, native runtime commands, and Tunnel MCP plugin. v0.0.20 adds the separate HTTPS OAuth-origin allowlist; v0.0.19 adds MCP request-ID propagation.
/v1/mcp/{tunnel_id}; the customer-run client polls for work and returns responses through the runtime protocol./healthz and /readyz to distinguish process health from readiness, with /metrics and /ui for inspection.--mcp.forward-trace-context opts in to forwarding W3C context in MCP params._meta; local JSONL span export is configured separately.X-Request-Id as X-Tunnel-Mcp-Request-Id, distinct from the connector’s request ID.Teams connecting localhost or private MCP tools to supported OpenAI products when inbound exposure is not approved and operators need readiness checks and diagnostics.
The entire request path must remain offline or self-hosted, or a secure direct MCP connection already meets the access requirements.
Quick Start & Installation
brew install openai/tools/tunnel-client
Comparison vs. Top Coding, Skills & MCP Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| tunnel-client ★ | 671 | +15 | Go | Apache-2.0 | Go tunnel client for private MCP access from OpenAI apps without public ingress |
| rea | 488.8k | +7.6k | TypeScript | MIT | A local CLI and MCP server for evidence-backed app and binary analysis |
| chrome-devtools-mcp | 60.4k | +760 | TypeScript | Apache-2.0 | Chrome DevTools via MCP and CLI for live browser debugging and performance analy |
| context7 | 65.8k | +333 | TypeScript | MIT | A hosted documentation index with MCP and CLI access for coding agents |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/openai/tunnel-client.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about tunnel-client
Which endpoint do applications call, and how does an embedded Go server connect?
/v1/mcp/{tunnel_id} endpoint. The customer-run client polls for requests and returns responses over a separate runtime protocol. For an in-process Go integration, pass one side of an in-memory MCP transport pair to tunnelclient.New and give the other side to the MCP server.Does it need a GPU, and how should I size the runtime?
Can we use it commercially or deploy the entire system in our own environment?
When is this a better fit than direct remote MCP or a private network link?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy