跳到正文
数字商店
原文
Alex Volkov· @altryne · X·· 16 天前精选AI 评分75
AI 导读

开发者 Alex Volkov 分享了通过安全隧道将本地 MCP 服务器接入 ChatGPT 的配置方法,无需将工具暴露给公网或自建鉴权。用户可通过 Homebrew 安装 openai/tools/tunnel-client 并生成具备对应权限的 API key,再将本地 MCP 端口映射至该隧道。

推荐理由

原文给出了借助隧道客户端连接本地 MCP 服务器的具体步骤,为本地开发工具接入 ChatGPT 提供了免公网暴露的安全配置参考。

正文 · 原文

TIL that there's a way to build secure tools for your ChatGPT and never expose them to the public internet!

Build a server with MCP on your local network (say a mac mini), expose it via a secure tunnel, and ChatGPT can access it without the need to build auth, without risking exposure to the web, without the need to deploy to server, much simpler!

ChatGPT requires either a public URL for MCP or a Tunnel.

Here's how to set that Tunnel up:

1) Install the tunnel client with brew: brew install openai/tools/tunnel-client

2) Create a tunnel name at https://t.co/JWUHItenf1

3) Copy it's ID and then create an API key with access to "tunnels" - select read/use. Then store this key somewhere the Tunnel tool can use to connect.

4) Ask your agent to point your server at that tunnel:

tunnel-client init --profile myapp --sample sample_mcp_remote_no_auth --tunnel-id tunnel_XXXX --mcp-server-url http://127.0.0.1:8420/mcp --control-plane-api-key-ref file:$HOME/.config/tunnel-client/myapp.key

Now that the Tunnel is up and your MCP is serving it, all you have to do is to create a new MCP connector in ChatGPT

Select "tunnel" in the Options, and paste your tunnel identifier in there (it's the one starting with tunnel_)

And voila, ChatGPT can now access tools you built for yourself locally!

来源:Alex Volkov · x.com