Learning resourcesReviewed · xAI

Custom MCP Server Tunneling

This guide helps developers connect a local MCP server to Grok through a public tunnel, but both the server and tunnel must remain running. It covers ngrok and Cloudflare Tunnel, including changing tunnel URLs, authentication and Cloudflare quick tunnels' lack of SSE support.

Researched 15 Nov 2026

In short.

Custom MCP Server Tunneling is a guide for developers connecting local MCP servers to Grok, with temporary public URLs that may require replacing the connector after a restart. It explains how ngrok and Cloudflare Tunnel forward requests to a local server without changing its code. The guide says Cloudflare quick tunnels work with Streamable HTTP but do not support Server-Sent Events (SSE), for which it recommends ngrok. Authentication remains separate from tunneling. End-to-end operation, security properties and production reliability are not assessed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete selected page at [https://docs.x.ai/grok/connectors/custom-mcp-tunneling.md], including both tunnel setup examples, the SSE caution, changing-URL warning, process availability requirement and authentication note. Linked pages are excluded. Provider terms, detailed pricing, server implementation and production suitability are not established. No commands, tunnels, authentication flows or tool calls were executed or tested.

The overview

identity

Custom MCP Server Tunneling is a documentation guide in Grok's Connectors documentation at [https://docs.x.ai/grok/connectors/custom-mcp-tunneling.md]. It explains how to make an existing local MCP server reachable by Grok through a public tunnel.

assessment

The guide is useful when Grok cannot reach an MCP server because it runs on localhost or a private network address. It provides concrete setup commands and explains several likely connection failures. Server implementation, end-to-end compatibility, performance and production reliability are not established.

users

The intended readers are developers who already have an MCP server and want to connect it to Grok. Beginners receive a simple explanation of public forwarding, while experienced developers get transport and authentication constraints. The page assumes familiarity with terminal commands and does not teach how to build an MCP server.

capabilities

The instructions cover starting a public tunnel, copying its generated address into Grok's custom connector dialog and retaining the server's existing authentication flow. The page also describes ngrok's stable URLs and traffic inspection dashboard, although it does not demonstrate those features.

Using it

requirements

You need a running MCP server, a tunnel client and access to Grok's custom connector dialog. The examples forward port 3001; your tunnel must target your server's actual port. ngrok requires a free account and authentication token, while Cloudflare quick tunnels require no account signup according to the page.

The server's transport affects the choice: the guide directs SSE users to ngrok and says Streamable HTTP works with Cloudflare quick tunnels. Required software versions and Grok plan eligibility are not specified.

mechanism

Grok sends requests to a public tunnel URL. The tunnel provider forwards them to a port on your machine, illustrated as localhost:3001. The guide says the MCP server code requires no changes; the URL supplied to Grok changes.

Tunneling provides network reachability. If the MCP server requires OAuth or API keys, that authentication flow still takes place in Grok after the tunnel URL is supplied.

setup

For ngrok, the page gives brew install ngrok on macOS and winget install ngrok -s msstore on Windows. Authenticate with ngrok config add-authtoken YOUR_AUTH_TOKEN, then start forwarding with ngrok http 3001. Copy the Forwarding URL into Grok's custom connector dialog.

For Cloudflare, the installation commands are brew install cloudflared on macOS and winget install --id Cloudflare.cloudflared on Windows. Start a quick tunnel with cloudflared tunnel --url http://localhost:3001, then use the generated public address in Grok. These commands are documented instructions; none were executed.

example

For the page's example server on localhost:3001, running ngrok http 3001 produces a public forwarding address. Supplying that address to Grok lets its requests travel through ngrok to the local process. Any configured authentication must still be completed, and both processes must remain running. This illustrates the documented flow; a successful connection or tool call was not demonstrated.

Assessment & evidence

limitations

Grok rejects localhost and private network URLs. Most free-tier tunnel URLs change when restarted, and the guide says an affected Grok connector must be removed and added again with the new address. Stopping either the tunnel or local server causes tool calls to fail.

Cloudflare quick tunnels do not support SSE according to the page. Although ngrok is described as offering stable URLs, the guide does not explain which plans or configurations retain an address. Traffic limits, provider data handling and availability guarantees are unspecified.

reasoning

The practical fit follows from the documented reachability problem: Grok needs a public endpoint, and a tunnel supplies one while forwarding to the existing local server. Transport compatibility is the first decision, followed by tolerance for changing URLs and keeping local processes available. This supports a local connection workflow; it does not establish production suitability.

alternatives

The page presents ngrok and Cloudflare Tunnel as alternatives for the same forwarding task. ngrok is described as offering stable URLs and traffic inspection, while Cloudflare quick tunnels avoid account signup. For SSE, the page recommends ngrok. No other providers or hosting approaches are explained, and comparative performance is unknown.

evidence

The evidence consists of the complete documentation page at [https://docs.x.ai/grok/connectors/custom-mcp-tunneling.md]. Its commands, cautions and authentication explanation support the described setup. Linked connector documentation and provider pages are outside the available evidence.

The page contains no measured performance results or demonstrated end-to-end tool call. Installation, connectivity, authentication and transport behavior remain untested.

Access & freshness

costs

The ngrok instructions require a free account, and the page describes Cloudflare quick tunnels as free without signup. It does not establish the total cost of using either option with Grok. Grok access costs, usage limits, paid tunnel features and charges for persistent addresses are unknown.

rights

The supplied page states no documentation licence or redistribution permission. It also does not include the service terms for Grok, ngrok or Cloudflare. Rights to redistribute the page and obligations associated with those services are therefore not established by this evidence.

freshness

The supplied page was captured at 2026-11-15T04:21:48.719Z. It includes no publication date, update date or version requirements. Compatibility statements reflect that captured text; current provider behavior and subsequent documentation changes are unknown.

actions

Identify whether your MCP server uses SSE or Streamable HTTP, then choose a compatible tunnel. Forward its actual port, enter the public URL in Grok and complete any configured authentication. Keep both the server and tunnel running, and replace the connector if its URL changes.

Before relying on the connection, verify that Grok can authenticate and complete an intended tool call. Those outcomes are not established by the documentation alone.

Evidence for this report

selected-page.txtselected · checked 2026-11-15