Tailscale MCP
What it does
Let AI agents see and use your tailnet: status, SSH config, Serve/Funnel sharing, ping matrix
- Connects 在你的电脑上运行
- Account or key No key needed
- Category 开发者工具
安装
选择你使用的 AI 应用,然后复制设置。
通过 2/3 项检查 · 在你的电脑上运行
第一步:你用哪个 AI?
选择你用的应用,步骤会显示在下方。
打开电脑版 Claude 应用的设置文件
SettingsDeveloperEdit Config
粘贴这些设置并保存文件
正在检查命令 · 通过后才会显示复制按钮
只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人
退出 Claude 再重新打开
试一试
用 Tailscale MCP 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Claude 说正在使用 Tailscale MCP,或回答中出现 Tailscale MCP 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同
ChatGPT 暂时无法连接 Tailscale MCP
Tailscale MCP 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器
你可以改用这些方式
A · 使用能连接 Tailscale MCP 的应用
- 需要 Tailscale MCP 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
- 需要 Tailscale MCP 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)
- 需要 Tailscale MCP 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)
- 需要 Tailscale MCP 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)
B · 开发者工具 类中能连接 ChatGPT 的其他服务器
从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的
- Sentry✓ ChatGPT
- Compiler Explorer✓ ChatGPT
- GitDiagram✓ ChatGPT
可连接 Claude Code,但需要先准备
需要 Tailscale MCP 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)
打开终端
Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell
粘贴这条命令并按 Enter
正在检查命令 · 通过后才会显示复制按钮
按 Enter 前,把“your-value”改成你的密钥
只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人
在 Claude Code 中输入 /mcp
应能看到 Tailscale MCP 在列表中并显示已连接
试一试
用 Tailscale MCP 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Claude Code 说正在使用 Tailscale MCP,或回答中出现 Tailscale MCP 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同
可连接 Cursor,但需要先准备
需要 Tailscale MCP 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)
点击这个按钮打开 Cursor
正在检查命令 · 通过后才会显示复制按钮
填写你的密钥
在 Tailscale MCP 的设置中,TAILSCALE_MCP_ALLOW_FUNNEL, TAILSCALE_MCP_READONLY, TAILSCALE_MCP_BIN, TAILSCALE_MCP_TIMEOUT_MS 还是空的,填入你的密钥并保存
只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人
在 Cursor 中以 Agent 模式打开 AI 聊天
试一试
用 Tailscale MCP 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Cursor 说正在使用 Tailscale MCP,或回答中出现 Tailscale MCP 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同
可连接 VS Code,但需要先准备
需要 Tailscale MCP 的密钥(在开发者网站创建) · 需要先在电脑上安装 Node.js(只需一次)
点击这个按钮打开 VS Code
正在检查命令 · 通过后才会显示复制按钮
填写你的密钥
在 Tailscale MCP 的设置中,TAILSCALE_MCP_ALLOW_FUNNEL, TAILSCALE_MCP_READONLY, TAILSCALE_MCP_BIN, TAILSCALE_MCP_TIMEOUT_MS 还是空的,填入你的密钥并保存
只把密钥粘贴到应用的输入框里,不要粘贴到聊天中或发给任何人
在 VS Code 中以 Agent 模式打开 AI 聊天
试一试
用 Tailscale MCP 告诉我你能帮我做什么,然后做一件给我看✓ 如果 VS Code 说正在使用 Tailscale MCP,或回答中出现 Tailscale MCP 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同
开发者专用:终端命令和 JSON 设置
安装在电脑上
Claude Code
正在检查命令 · 通过后才会显示复制按钮
Claude Desktop (claude_desktop_config.json)
正在检查命令 · 通过后才会显示复制按钮
Cursor (~/.cursor/mcp.json)
正在检查命令 · 通过后才会显示复制按钮
VS Code (mcp.json)
正在检查命令 · 通过后才会显示复制按钮
需要你填写的值
TAILSCALE_MCP_ALLOW_FUNNELenvSet to 1 to let share_port expose a port to the open internet with Funnel (off by default)TAILSCALE_MCP_READONLYenvSet to 1 for monitoring only: no share tools, and no SSH config writesTAILSCALE_MCP_BINenvPath to the tailscale binary if it is not on PATH or in the default install locationTAILSCALE_MCP_TIMEOUT_MSenvPer-call timeout for tailscale commands in milliseconds (default 10000)
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
一览
哪些应用可以使用它
依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。
在你的电脑上运行,适用于
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月13日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 TMHSDigital 验证,该账户拥有此仓库
- ✓ 通过
仍在维护
代码最后更新于前天
- ! 注意
有许可证
GitHub 无法识别许可证类型;请打开文件自行查看
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
讨论
提问、分享技巧或报告无法使用。按“有帮助”数量排序。
用户评价
还没有评价
与“开发者工具”中的其他服务器比较i
- 星标数多于此分类中其他 5821 个服务器的 69%
- 发布到注册中心的时间比此分类中其他 5821 个服务器的 60% 更新
- 基础检查结果等于或优于此分类中其他 5821 个服务器的 44%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Tailscale MCP 安全吗?
它在 3 项适用的基础检查中通过了 2 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于前天,最新版本(0.4.0)于18天前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:REA, GitHub, Serena MCP: the IDE for your agent
同类别的其他选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Serena MCP: the IDE for your agent
A powerful toolkit for coding, providing semantic retrieval and editing capabilities.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Tailscale MCP
MCP server for safe programmatic access to the local Tailscale daemon: tailnet discovery, SSH config generation, port sharing via Serve/Funnel, and latency matrices.
Gives agents and developer tools a safe, structured window into the local Tailscale daemon over stdio. It shells out to the tailscale CLI (resolved from PATH, with fallbacks to the default install locations on Windows and macOS) and never handles auth keys or tailnet credentials: the CLI talks to the already-authenticated local daemon.
When the binary is missing, the daemon is stopped, or the device needs login, every tool returns a structured error with a code and the exact remedy command instead of throwing.
Installation
- Claude Code:
claude mcp add tailscale -- npx -y @tmhs/tailscale-mcp - Claude Desktop: download
tailscale-mcp.mcpbfrom the latest release and open it. The install dialog has switches for read-only mode and Funnel. - Cursor / VS Code: use the buttons above.
- MCP Registry: listed in the official MCP Registry as
io.github.TMHSDigital/tailscale-mcp, so registry-aware clients and catalogs can find it.
Or add it to any MCP client's configuration by hand:
{
"mcpServers": { "tailscale": { "command": "npx", "args": ["-y", "@tmhs/tailscale-mcp"] } } }
Requires Node 22+ (an active LTS) and an installed, logged-in Tailscale client.
Finding the tailscale CLI
The server looks for tailscale on PATH, then in the platform's default install locations: C:\Program Files\Tailscale\tailscale.exe on Windows, and /Applications/Tailscale.app/Contents/MacOS/Tailscale, /opt/homebrew/bin/tailscale, and /usr/local/bin/tailscale on macOS. Mac App Store installs therefore work without extra setup. To use a different binary, set TAILSCALE_MCP_BIN:
{
"mcpServers": { "tailscale": { "command": "npx", "args": ["-y", "@tmhs/tailscale-mcp"], "env": { "TAILSCALE_MCP_BIN": "/path/to/tailscale" } } } }
Timeouts
Every tailscale invocation is bounded, by default to 10 seconds. A hung daemon returns a structured TIMEOUT error instead of stalling the agent. Set TAILSCALE_MCP_TIMEOUT_MS to raise the limit for slow machines or very large tailnets. share_port waits up to 15 seconds and ping scales with count and timeoutMs; ping_all as a whole is capped at 45 seconds.
Configuration reference
All settings are environment variables in the server's env block. Boolean flags accept 1/true/yes/on or 0/false/no/off. Any other value stops the server at startup, so a typo can never silently loosen a safety setting.
| Variable | Default | Effect |
|---|---|---|
TAILSCALE_MCP_ALLOW_FUNNEL | off | Allows share_port {"public": true}, which exposes a port to the open internet via Funnel. While off, the call returns FUNNEL_DISABLED and nothing is shared. |
TAILSCALE_MCP_READONLY | off | Monitoring-only mode: share_port and stop_share are not registered, and generate_ssh_config refuses write: true (READ_ONLY). |
TAILSCALE_MCP_BIN | (search) | Path to the tailscale binary. |
TAILSCALE_MCP_TIMEOUT_MS | 10000 | Per-call CLI timeout. |
Linux: Serve/Funnel permissions
On Linux only root or the configured operator can change Serve/Funnel settings. If share_port or stop_share returns PERMISSION_DENIED, allow your user once:
sudo tailscale set --operator=$USER
Tools
Every tool declares MCP annotations, so clients can auto-approve the read-only ones and confirm the rest. Results come back as structuredContent, typed by each tool's outputSchema, with the same JSON repeated in a text block for older clients. The full definitions are in mcp-tools.json, which is generated from the server.
| Tool | Read-only | Destructive | Idempotent | Open world |
|---|---|---|---|---|
tailnet_status | yes | no | yes | no |
share_status | yes | no | yes | no |
ping_all | yes | no | yes | no |
generate_ssh_config | no (writes only with write: true) | no | yes | no |
share_port | no | no | yes | only when Funnel is allowed |
stop_share | no | yes | yes | no |
tailnet_status
Trimmed view of tailscale status --json: self node plus peers with hostname, MagicDNS name, Tailscale IPv4/IPv6, OS, online flag, last seen, exit-node flags, and tags. Input: optional onlineOnly.
{
"backendState": "Running", "tailnet": "user@example.com", "magicDNSSuffix": "tail1234.ts.net", "self": {"hostname": "DEVPC", "dnsName": "devpc.tail1234.ts.net", "ipv4": "100.101.1.10"}, "peerCount": 3, "peers": [ {"hostname": "raspi", "dnsName": "raspi.tail1234.ts.net", "ipv4": "100.101.1.20", "os": "linux", "online": true, "exitNodeOption": true, "tags": []} ] }
generate_ssh_config
Emits ssh-config Host blocks for tailnet nodes (MagicDNS name preferred, Tailscale IP fallback). Dry-run by default: returns the generated text only. Inputs: write, target, onlineOnly, includeShared, user.
- Each
Hostalias is the node's first MagicDNS label (raspi.tail1234.ts.net→raspi), falling back to a sanitized OS hostname ([a-z0-9-]only). Colliding aliases get a numeric suffix and are listed underrenamed. Mullvad exit nodes, and nodes of users you share with (unlessincludeShared: true), are left out and listed underskipped. write: truewrites the dedicated file~/.ssh/tailscale_dev_configand returns theInclude tailscale_dev_configinstruction for~/.ssh/config(never applied automatically).target: "user_ssh_config"(withwrite: true) edits~/.ssh/configdirectly, idempotently, between# BEGIN tailscale-mcpand# END tailscale-mcpmarkers. Content outside the markers is never touched. If the markers are malformed (orphaned, reversed, or duplicated) the tool returnsSSH_CONFIG_MARKERS_CORRUPTand writes nothing.- Writes are atomic (temp file + rename), the previous
~/.ssh/configis kept asconfig.tailscale-mcp.bak, new files are created0600(existing modes are kept), and a symlinked config is written through rather than replaced.
{
"dryRun": true, "hostCount": 2, "configText": "# BEGIN tailscale-mcp\nHost raspi\n HostName raspi.tail1234.ts.net\n\nHost devbox\n HostName devbox.tail1234.ts.net\n# END tailscale-mcp" }
share_port
Shares a local port via Tailscale Serve. Tailnet-only by default. Inputs: port (required), public, path.
{"port": 3000, "public": false, "scope": "tailnet-only (Serve)", "urls": ["https://devpc.tail1234.ts.net/"]}
public: true switches to Funnel and exposes the port to the open internet. It's refused unless TAILSCALE_MCP_ALLOW_FUNNEL=1 is set; see the security notes below.
share_status
Reports active Serve/Funnel sessions as structured endpoints, parsed from tailscale serve status --json. Each endpoint has its own public flag, which is true when Funnel exposes it to the internet, and publicExposure is true when anything is public:
{
"active": true, "publicExposure": true, "endpoints": [ {"url": "https://devpc.tail1234.ts.net/", "host": "devpc.tail1234.ts.net", "httpsPort": 443, "scheme": "https", "path": "/", "target": "http://127.0.0.1:3000", "targetType": "proxy", "public": true, "foreground": false} ] }
Raw TCP forwards appear under tcpForwards. On CLIs too old for --json, the text status comes back under status and publicExposure is null.
stop_share
Stops shares. Name exactly one target:
httpsPortand/orpathturns off one mount.httpsPortis the serve port shown inshare_status(default 443, not the proxied local port), andpathis the mount path given toshare_port(default/). For example,{"path": "/api"}undoesshare_port {"port": 3000, "path": "/api"}.mine: truestops only the sharesshare_portcreated during this server session.all: trueclears the entire serve/funnel configuration, including shares you set up outside this server.
With no arguments nothing is stopped: the tool returns TARGET_REQUIRED and lists the active endpoints. Every successful call returns removed (the endpoints that went away) and remaining (the share_status view afterwards).
Mount paths must start with / and use only letters, digits, and . _ ~ - /, with no . or .. segments. A trailing slash is dropped.
ping_all
Concurrent tailscale ping against peers (bounded to 5 in flight, with a per-ping timeout). Inputs: count, timeoutMs, onlineOnly (default true).
{
"pinged": 2, "reachable": 1, "timedOut": false, "matrix": [ {"hostname": "raspi", "target": "100.101.1.20", "reachable": true, "latencyMs": 3, "path": "direct", "via": "192.168.1.20:41641", "attempts": 3, "replies": 3}, {"hostname": "exitbox", "target": "100.101.1.40", "reachable": false, "latencyMs": null, "path": null, "via": null, "attempts": 1, "replies": 0} ] }
path is direct (peer-to-peer), derp (relayed through a Tailscale DERP server), peer-relay (relayed through one of your nodes), or unknown, so an agent can tell "works but relayed" from "fast direct path". tailscale ping keeps pinging until a direct path comes up, so path and latencyMs describe the last reply, i.e. the settled path. The whole call is capped at 45 seconds: peers that haven't answered by then come back with an error and timedOut: true.
Agentic workflow example
An agent asked to "deploy this to my dev VPS and show me the result" can do the whole discovery leg through this server:
tailnet_status {"onlineOnly": true}finds the VPS node and its MagicDNS name (devbox.tail1234.ts.net), with no hardcoded IPs.generate_ssh_config {"write": true, "user": "deploy"}writes~/.ssh/tailscale_dev_config; the agent shows the returned one-lineIncludeinstruction, and after the user adds it,ssh devboxresolves through the tailnet.ping_allconfirms the node is reachable and whether the path is direct or relayed before starting a large transfer.- After deploying,
share_port {"port": 8080}returns a tailnet-only URL teammates on the tailnet can open. Nothing touches the public internet unless you have enabled Funnel withTAILSCALE_MCP_ALLOW_FUNNEL=1and the agent is explicitly told to passpublic: true.
Security notes on Funnel
share_portdefaults to tailnet-only Serve. Nothing is reachable from outside your tailnet.- Funnel is off unless you turn it on.
public: trueuses Tailscale Funnel, which makes the URL reachable by anyone on the internet, not just your tailnet. A default install refuses it withFUNNEL_DISABLED, so a prompt-injected agent can't expose a port by itself. To allow it, s