Tailnet MCP bridge

io.github.zedong-peng由 GitHub 帳號 zedong-peng 發布v0.3.0更新於 Nov 3, 2026

通過 stdio,從代理沙箱存取 Tailscale tailnet 內的 MCP 伺服器。

AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。

原文描述

Reach an MCP server inside your Tailscale tailnet from an agent's sandbox, over stdio.

已驗證STDIO僅桌面

概覽

Tailnet MCP bridge 的本機 MCP 服務;無需登入;STDIO。

暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Tailnet MCP bridge,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

tailnet-mcp

A stdio MCP server that forwards everything to a Streamable HTTP MCP server inside your tailnet.

Hosted agents (Grok, cloud coding agents, sandboxed assistants) usually take MCP servers two ways. By URL: the vendor's servers connect, so your server has to be on the public internet. By command: the agent starts a process on its own computer, but that computer is not in your tailnet and you can't run tailscaled there (no root, no TUN). tailnet-mcp is the command: it embeds a Tailscale node (tsnet), joins your tailnet as a tagged device and bridges stdio to the server. Your server stays behind tailscale serve, never on the internet.

agent ──stdio──▶ tailnet-mcp (tag:agent) ══tailnet══▶ tailscale serve ──▶ MCP server on 127.0.0.1

Install

Download a static binary for linux or darwin, amd64 or arm64, from Releases and check it against SHA256SUMS. Or build it yourself:

bash
CGO_ENABLED=0 go install github.com/zedong-peng/tailnet-mcp@latest

Or run the image ghcr.io/zedong-peng/tailnet-mcp with a volume on /home/nonroot/.local/state/tailnet-mcp. It is also listed in the MCP Registry as io.github.zedong-peng/tailnet-mcp.

Use

  1. Publish the server to the tailnet only, on a path nobody can guess:

    bash
    tailscale serve --bg --https=8443 --set-path=/$(openssl rand -hex 16) http://127.0.0.1:8080/mcp
  2. Mint a one-time, pre-authorized auth key with a tag for the agent (admin console, or the API), and log in once from the agent's computer:

    bash
    TS_AUTHKEY=tskey-auth-... tailnet-mcp -hostname my-agent -url https://server.tailnet.ts.net:8443/<path> -check

    -check connects, prints the server's tools on stderr and exits. The node key is kept in -state (default ~/.local/state/tailnet-mcp/<hostname>); keep it on persistent storage. Tagged nodes don't expire, so the key is not needed again.

  3. Register the same command, without the key, as the agent's MCP server:

    bash
    tailnet-mcp -hostname my-agent -url https://server.tailnet.ts.net:8443/<path>

Each process is its own tailnet node. For a second server, run a second process with a different -hostname.

Lock it down

The agent reads untrusted input (web pages, mail), so assume it can be talked into anything its tools allow. Three layers, none of which rely on the agent behaving:

  • Network. Give the tag one grant to the ports it needs and nothing else:

    jsonc
    "grants": [  {"src": ["tag:my-agent"], "dst": ["server"], "ip": ["tcp:8443"]},],"tests": [  {"src": "tag:my-agent", "accept": ["server:8443"], "deny": ["server:22", "server:443"]},],

    Grants that allow everything ("src": ["autogroup:member"], "dst": ["*"]) don't cover tagged devices, so that one grant is all the tag gets.

  • Path. tailscale serve --set-path answers only on the secret path; any other path on the port is a 404. Other devices in the tailnet can't use the server by guessing the port.

  • Server. Enforce permissions where the data lives, not in the agent: a mail server that can only save drafts, a password vault account that is a view-only member of one shared collection. examples/private-tools sets up both.

Behaviour

  • Before the first request it pings the server's node until it answers. Right after a restart the server may still hold a stale path to the node, and the first dial would time out.
  • Only requests that never reached the server are retried, so a tool call is never sent twice.
  • When the server restarts and forgets the session (404, or a 400 about the session), the bridge replays initialize and resends the request. The client doesn't notice.
  • A failed request comes back as a JSON-RPC error with the reason, so the client never waits for an answer that won't come.
  • On EOF it ends the session with DELETE. Logs go to stderr; stdout carries only MCP frames. -v adds tsnet's own logs.

Not supported: the optional GET stream that lets a server send messages outside a response. Servers answer each request in its own response, as almost all tool servers do.

Compared with

  • mcp-remote and other stdio-to-HTTP bridges need a network path to the server. In an agent's sandbox that means a public URL.
  • tailscale up in the sandbox needs root and a TUN device. If someone logs in as a user instead of with a tagged key, the sandbox gets that user's access to the whole tailnet.
  • Tailscale Aperture is a gateway on the server side: it aggregates HTTP MCP servers and grants tools per user. It doesn't get a sandboxed agent into the tailnet, so the two fit together.

Build and test

bash
go test -race ./...CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" .

Tagging v* publishes the four binaries, the image and the registry entry.

來源:README.md,提交 479d4e0

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:該軟體包類型無法在沙箱中執行。

版本歷史

1
  1. v0.3.0最新Nov 3, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分