Tailscale RMCP

ai.dinglebear由 dinglebear.ai 发布官方发布者v0.1.4更新于 Oct 24, 2026

Tailscale device, route, DNS, key, user, and ACL management over MCP and CLI.

已验证Streamable HTTP可网页运行云端与基础设施安全与监控

概览

AI 生成的概览

把 Tailscale 网络接入助手:列出设备、查看路由、DNS、ACL、密钥与用户,并可授权或删除设备。

可以做什么
  • 列出并查看设备,包括单台设备的子网路由
  • 读取 API 密钥、ACL 策略 JSON、DNS/MagicDNS 设置与网络用户
  • 为网络授权一台设备
  • 删除设备,仅在服务端开启开关且调用方显式确认时可用
  • 通过 CLI 执行相同操作,并提供 setup 与 doctor 自检命令
适用场景
适合让助手回答关于 Tailscale 网络的问题,或在不打开管理控制台的情况下完成日常设备管理,例如批准新节点。也适合希望同时通过 MCP 和 CLI 执行相同操作的脚本化或家庭实验室流程。
运行要求
需要 TAILSCALE_API_KEY 中的 Tailscale API 密钥,以及 TAILSCALE_TAILNET(默认为个人网络)。可作为远程端点运行,也可通过 npx(会从 GitHub Releases 下载二进制)、Docker 或 Rust 1.86+ 源码构建运行。非回环地址上的 HTTP 模式需要 TAILSCALE_MCP_TOKEN 的 bearer 认证、Google OAuth 配置或可信网关。需能访问 Tailscale API。
安装前请注意
该 API 密钥拥有网络管理权限,应放在环境变量或配置中,切勿写入工具参数。授权设备会改变网络状态;在设置 TAILSCALE_ALLOW_DESTRUCTIVE=true 并传入 confirm=true 后,delete_device 会永久移除设备。HTTP 服务默认绑定 0.0.0.0;TAILSCALE_MCP_NOAUTH 与 TAILSCALE_NOAUTH 会关闭认证,只应在回环或由网关强制认证时使用。npm 安装会从 GitHub Releases 下载二进制。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Tailscale RMCP,将其添加到工作区。
  2. 连接 Authorization token 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/ai.dinglebear%2Frtailscale/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "tailscale-rmcp": {
      "type": "http",
      "url": "https://ts.dinglebear.ai/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

tailscale-rmcp

Tailscale device, route, DNS, key, user, and ACL management over MCP and CLI.

It exposes one MCP tool, tailscale, plus the rtailscale CLI. Agents can list devices, inspect routes, read API keys, ACL policy, DNS settings, and users, authorize devices, and delete devices when the destructive gate is explicitly enabled.

30-second path: set TAILSCALE_API_KEY, then run npx -y @dinglebear/rtailscale devices --json -> start loopback HTTP with TAILSCALE_MCP_HOST=127.0.0.1 npx -y @dinglebear/rtailscale serve -> call tools/call with {"action":"devices"}.

Status: operational RMCP upstream-client server. Write-capable for device authorization; destructive device deletion requires both server opt-in and caller confirmation. HTTP MCP supports loopback dev mode, static bearer tokens, and Google OAuth through lab-auth.

Not for: replacing the Tailscale admin console, bypassing Tailscale account permissions, operating multiple unrelated tailnets from one trust boundary, storing API keys for callers, arbitrary WireGuard control, or passing Tailscale API keys through MCP tool arguments.

Contents

Naming

SurfaceThis repo
Repositorytailscale-rmcp
Rust cratetailscale-rmcp
Binary / CLIrtailscale
npm package@dinglebear/rtailscale
npm binary aliasestailscale-rmcp, rtailscale
MCP tooltailscale
Config home~/.tailscale-mcp on hosts, /data in containers
Env prefixesTAILSCALE_*, TAILSCALE_MCP_*, TAILSCALE_RMCP_* for npm launcher controls

The repo, crate, and npm package use the RMCP family name. The shipped binary is rtailscale to avoid shadowing the official tailscale CLI.

Capabilities And Boundaries

  • List devices and inspect a single device by node ID or legacy numeric device ID.
  • Read subnet routes, API keys, ACL policy, DNS/MagicDNS settings, and tailnet users.
  • Authorize a device for the tailnet.
  • Delete a device only when TAILSCALE_ALLOW_DESTRUCTIVE=true and the caller also passes explicit confirmation.
  • Provide setup and doctor commands for local plugin/runtime checks.
This repo ownsTailscale ownsExplicitly out of scope
MCP/CLI projection, request validation, HTTP MCP auth policy, response shaping, setup checks, and destructive gates.Tailnet state, device identities, ACL semantics, DNS behavior, API key issuance, user membership, and upstream authorization.Replacing the admin console, storing caller credentials, multi-tailnet tenancy, arbitrary WireGuard control, policy editing beyond exposed actions, and local Tailscale daemon management.

Install

PathCommandBest forNotes
npm / npxnpx -y @dinglebear/rtailscale --helpLocal MCP clients and quick trials.Downloads the matching rtailscale binary from GitHub Releases.
Release installercurl -fsSL https://raw.githubusercontent.com/dinglebear-ai/rtailscale/main/scripts/install.sh | bashHost installs without Node.Installs rtailscale for the current Linux host.
Docker / Composedocker compose up -dShared HTTP MCP deployments.Reads .env and exposes container port 40040.
Build from sourcecargo build --releaseDevelopment and audits.Produces target/release/rtailscale.
Pluginclaude plugin install plugins/tailscaleClaude Code local plugin setup from this checkout.Ships the skill, .mcp.json, and a bundled binary. No hooks — run rtailscale setup check yourself if you want the environment verified.

npm / npx

Run the stdio MCP server or CLI without a manual binary install:

bash
npx -y @dinglebear/rtailscale --helpnpx -y @dinglebear/rtailscale mcpnpx -y @dinglebear/rtailscale devices --json

The npm package downloads rtailscale during postinstall. Override download behavior only when testing packaging:

VariablePurpose
TAILSCALE_RMCP_SKIP_DOWNLOAD=1Skip postinstall binary download.
TAILSCALE_RMCP_VERSION or TAILSCALE_RMCP_BINARY_VERSIONSelect the GitHub Release tag.
TAILSCALE_RMCP_REPOSelect the GitHub repo used for release downloads.
TAILSCALE_RMCP_RELEASE_BASE_URLSelect a custom release base URL.

Build From Source

bash
git clone https://github.com/dinglebear-ai/rtailscalecd rtailscalecargo build --release./target/release/rtailscale --help

Minimum supported Rust version: 1.86.

Quickstart

1. Get A Tailscale API Key

Create an API key at https://login.tailscale.com/admin/settings/keys. Use the minimum capability needed for the actions you plan to expose.

2. Configure The Tailnet

bash
export TAILSCALE_API_KEY="tskey-api-..."export TAILSCALE_TAILNET="-"          # personal, or "example.com" for orgs

Every Tailscale account belongs to a tailnet. TAILSCALE_TAILNET=- targets the default personal tailnet; organization tailnets usually use the org domain.

3. Run A Safe CLI Call

bash
npx -y @dinglebear/rtailscale devices --json

4. Start Loopback HTTP MCP

bash
TAILSCALE_MCP_HOST=127.0.0.1 npx -y @dinglebear/rtailscale serve

In another shell:

bash
curl -sf http://127.0.0.1:40040/health

5. Make A First MCP Call

bash
curl -s -X POST http://127.0.0.1:40040/mcp \  -H "Content-Type: application/json" \  -H "Accept: application/json, text/event-stream" \  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"tailscale","arguments":{"action":"devices"}}}'

Client Configuration

Claude Code Stdio

json
{  "mcpServers": {    "tailscale": {      "command": "npx",      "args": ["-y", "tailscale-rmcp", "mcp"],      "env": {        "TAILSCALE_API_KEY": "tskey-api-...",        "TAILSCALE_TAILNET": "-"      }    }  }}

Claude Code HTTP

json
{  "mcpServers": {    "tailscale": {      "type": "http",      "url": "http://127.0.0.1:40040/mcp",      "headers": {        "Authorization": "Bearer ${TAILSCALE_MCP_TOKEN}"      }    }  }}

Codex / Labby Gateway

Register Tailscale through Labby as an HTTP upstream when sharing one long-running server, or run it directly as stdio for local-only use.

toml
[mcp_servers.tailscale]command = "npx"args = ["-y", "tailscale-rmcp", "mcp"]

Generic MCP JSON

json
{  "command": "rtailscale",  "args": ["mcp"],  "env": {    "TAILSCALE_API_KEY": "tskey-api-...",    "TAILSCALE_TAILNET": "-"  }}

Do not put TAILSCALE_API_KEY, OAuth secrets, passwords, SSH keys, or upstream bearer tokens in MCP tool arguments. Use env, config files, or the MCP client's secret storage. MCP callers never provide credentials, tokens, keys, or secrets as action arguments.

Runtime Surfaces

SurfaceStatusEntry pointPurpose
MCP stdioSupportedrtailscale mcp, npx -y @dinglebear/rtailscale mcpLocal child-process MCP clients.
MCP HTTPSupportedrtailscale serve, POST /mcpStreamable HTTP MCP for local or shared server deployments.
CLISupportedrtailscale <command>Scriptable parity and debugging.
REST APINot shippedN/ATailscale already owns the REST API.
Web UINot shippedN/ATailscale already owns the admin console.

MCP Tool Reference

One MCP tool is exposed: tailscale. Pass the required action argument to select the operation.

Read Actions

ActionDescriptionRequired paramsOptional params
devicesList all devices in the tailnet.nonenone
deviceReturn one device.idnone
device_routesReturn subnet routes for one device.idnone
keysList API keys in the tailnet.nonenone
aclReturn ACL policy JSON.nonenone
dnsReturn DNS nameservers, search paths, and MagicDNS preferences.nonenone
usersList tailnet users.nonenone
helpReturn built-in action documentation.nonenone

Write Actions

ActionDescriptionRequired paramsOptional params
authorize_deviceApprove a device for the tailnet.idnone

Destructive Actions

ActionDescriptionRequired paramsOptional params
delete_devicePermanently remove a device.id, confirm=truenone

Device IDs may be stable node IDs such as n1234abc or legacy numeric device IDs. Use action=devices first to discover IDs.

CLI Reference

The binary calls the same service layer as the MCP tool:

bash
rtailscale devices [--json]rtailscale device <id> [--json]rtailscale routes <device-id> [--json]rtailscale keys [--json]rtailscale acl [--json]rtailscale dns [--json]rtailscale users [--json]rtailscale authorize <device-id> [--json]rtailscale delete-device <device-id> --confirm [--json]rtailscale doctor [--json]rtailscale setup check [--json]rtailscale setup repair [--json]rtailscale setup plugin-hook [--no-repair] [--json]rtailscale serve            # HTTP MCP (also the no-argument default)rtailscale mcp              # stdio MCP

All commands currently print JSON. --json is accepted for parity with the rest of the RMCP family.

Configuration

Host installs read ~/.tailscale-mcp/.env before loading config. Containers read /data/.env. Process environment overrides both.

VariableDefaultPurpose
TAILSCALE_API_KEYunsetTailscale API key.
TAILSCALE_TAILNET-Tailnet: org domain or - for personal.
TAILSCALE_ALLOW_DESTRUCTIVEfalseEnable delete_device server-side.
TAILSCALE_MCP_HOST0.0.0.0HTTP bind host.
TAILSCALE_MCP_PORT40040HTTP bind port.
TAILSCALE_MCP_SERVER_NAMEtailscale-rmcpAdvertised MCP server name.
TAILSCALE_MCP_NO_AUTHfalseDisable auth only for loopback development.
TAILSCALE_MCP_TOKENunsetStatic bearer token for HTTP MCP.
TAILSCALE_NOAUTHfalseTrust an upstream gateway to enforce auth.
TAILSCALE_MCP_AUTH_MODEbearerbearer or oauth.
TAILSCALE_MCP_PUBLIC_URLunsetPublic URL for OAuth discovery.
TAILSCALE_MCP_GOOGLE_CLIENT_IDunsetGoogle OAuth client ID.
TAILSCALE_MCP_GOOGLE_CLIENT_SECRETunsetGoogle OAuth client secret.
TAILSCALE_MCP_AUTH_ADMIN_EMAILunsetAdmin email for OAuth bootstrap.
TAILSCALE_MCP_ALLOWED_HOSTSunsetExtra accepted Host header values.
TAILSCALE_MCP_ALLOWED_ORIGINSunsetExtra accepted CORS origins.
TAILSCALE_MCP_HOMEplatform appdataOverride the config/log home used by setup and file logging.

The Tailscale API base URL is not configurable; it is fixed at https://api.tailscale.com/api/v2 in src/tailscale.rs.

Authentication

Stdio MCP runs as a local trusted child process and does not use HTTP auth.

HTTP MCP auth policy:

StateConditionBehavior
Loopback devTAILSCALE_MCP_HOST starts with 127. or auth is explicitly disabled on loopbackLocal unauthenticated development is allowed.
Mounted bearerNon-loopback with TAILSCALE_MCP_TOKENRequires Authorization: Bearer <token> and action scopes.
Mounted OAuthTAILSCALE_MCP_AUTH_MODE=oauthUses Google OAuth/JWT through lab-auth.
Trusted gatewayTAILSCALE_NOAUTH=trueAssumes a reverse proxy or gateway already enforced auth.

Non-loopback HTTP startup is rejected unless bearer auth, OAuth, or TAILSCALE_NOAUTH=true is configured.

Safety And Trust Model

  • Tailscale API keys are loaded from config/env only.
  • MCP callers select actions and IDs, not upstream credentials.
  • delete_device has a two-key interlock: TAILSCALE_ALLOW_DESTRUCTIVE=true on the server and caller-provided confirm=true.
  • Missing IDs and unknown actions fail before upstream calls.
  • Non-loopback HTTP deployments must use bearer auth, OAuth, or a trusted authenticated gateway.
  • This bridge does not sandbox Tailscale itself. Tailscale remains responsible for API permissions and tailnet state changes.

Architecture

text
TailscaleClient  (src/tailscale.rs)  REST transport and API error handling       |TailscaleService (src/app.rs)        action behavior and destructive gates       |MCP shim         (src/mcp.rs)        JSON args -> service -> ValueCLI shim         (src/cli.rs)        argv -> service -> stdout

Distribution Contract

  • Cargo.toml, Cargo.lock, packages/tailscale-rmcp/package.json, .release-please-manifest.json, and server.json must agree on the released version.
  • GitHub Releases publish the rtailscale binary consumed by the npm launcher.
  • The npm package name is @dinglebear/rtailscale; binary aliases are tailscale-rmcp and rtailscale.
  • Docker/OCI metadata uses ghcr.io/dinglebear-ai/rtailscale:<version> (see docker-compose.prod.yml). The image path still uses the pre-transfer owner namespace even though the repo now lives at dinglebear-ai/rtailscale.
  • plugins/tailscale/.mcp.json must launch npx -y @dinglebear/rtailscale mcp so stdio clients start the MCP transport rather than the HTTP server.
  • plugins/tailscale/ ships no Claude Code hooks; scripts/validate-plugin-layout.sh fails if a hooks/ directory reappears.
  • The root README is curated. Source of truth for action behavior and config defaults is src/, plus the package, plugin, and registry manifests.

Development

bash
cargo fmt --checkcargo testcargo clippy -- -D warningscargo build --releasenpm --prefix packages/tailscale-rmcp run check

Verification

bash
just validate-pluginnpm --prefix packages/tailscale-rmcp run checkcargo checkcargo testgit diff --check

Runtime smoke:

bash
TAILSCALE_API_KEY=tskey-api-... \TAILSCALE_TAILNET=- \rtailscale devices --json

HTTP smoke:

bash
TAILSCALE_MCP_HOST=127.0.0.1 rtailscale servecurl -sf http://127.0.0.1:40040/health

Deployment

Use loopback for local development:

bash
TAILSCALE_MCP_HOST=127.0.0.1 rtailscale serve

Use Docker Compose for shared HTTP deployment:

bash
cp .env.example .envdocker compose up -d

When binding to a non-loopback address, configure TAILSCALE_MCP_TOKEN, TAILSCALE_MCP_AUTH_MODE=oauth, or TAILSCALE_NOAUTH=true behind an authenticated gateway.

Troubleshooting

SymptomCheck
TAILSCALE_API_KEY is missingSet it in env or ~/.tailscale-mcp/.env.
Device calls return unauthorizedRefresh the API key in Tailscale admin settings.
HTTP /mcp returns unauthorizedSet TAILSCALE_MCP_TOKEN and send Authorization: Bearer <token>.
Stdio client hangs or logs JSON errorsEnsure client config runs tailscale-rmcp mcp, not the default HTTP server mode.
delete_device is rejectedSet TAILSCALE_ALLOW_DESTRUCTIVE=true server-side and pass confirm=true after verifying the target.
Port conflictSet TAILSCALE_MCP_PORT or stop the process already using 40040.

Related Servers

  • soma - RMCP runtime and scaffold for provider-backed MCP servers.
  • unifi-rmcp - UniFi controller REST API bridge.
  • unraid - Unraid monorepo; unraid-rs/ is the GraphQL bridge for NAS and server management.
  • apprise-rmcp - Apprise notification fan-out bridge for many delivery backends.
  • gotify-rmcp - Gotify push notification bridge for sends, messages, apps, and clients.
  • arcane-rmcp - Arcane Docker management bridge for containers and related resources.
  • yarr - Media-stack bridge for Sonarr, Radarr, Prowlarr, Plex, and related services.
  • ytdl-rmcp - Media download and metadata workflow server.
  • synapse-rmcp - Local Synapse workflow server for scout and flux actions.
  • cortex - Syslog and homelab log aggregation MCP server.
  • axon - RAG, crawl, scrape, extract, and semantic search project.
  • labby - Homelab control plane and MCP gateway project.
  • lumen - Local semantic code search MCP server.

Documentation

  • CLAUDE.md is the curated local operating guide for contributors and agents.
  • docs/SETUP.md is curated plugin/setup guidance.
  • docs/OAUTH.md is curated OAuth setup guidance.
  • plugins/tailscale/skills/tailscale/SKILL.md is the agent usage guide.
  • src/ is the source of truth for current actions, config defaults, auth behavior, and CLI parsing.
  • Package, plugin, Docker, and registry manifests are curated distribution contracts and should be checked with the verification commands above.

License

Original Dinglebear-authored portions of this project are licensed under AGPL-3.0-only. Separate commercial licensing is available for organizations that need terms outside the AGPL. Third-party material remains under its original license. See LICENSING.md.

来源:README.md,提交 d10e4d5

工具

0
SourceWeft 尚未读取此服务器的工具。

版本历史

1
  1. v0.1.4最新Sep 16, 2026

评分

已满足适用检查项的 85%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Dinglebear 集成