tailscale-mcp-server
Controls and manages Tailscale: connects/disconnects the local host and manages the local node via the Tailscale CLI (status, prefs, exit nodes, routes, ping, netcheck, whois, profiles), plus tailnet management via the Tailscale REST API (devices, DNS config, ACL policy file, auth keys, tailnet settings, webhooks, users, and audit logs), with tiered risk levels and human approval for destructive actions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tailscale-mcp-server connect this host to my Tailscale network"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tailscale-mcp-server
A Model Context Protocol (MCP) server for controlling and managing Tailscale from Claude.
It is not read-only. The headline capability is that Claude can connect and disconnect
the host machine from Tailscale — a local operation that goes through the tailscale CLI (the
REST API cannot start/stop a specific node). On top of that it exposes local host management and
comprehensive tailnet management via the Tailscale REST API.
Built for Windows first (verified against Tailscale CLI 1.102.4); also runs on macOS (the Tailscale
app's bundled CLI is found automatically) and Linux — anywhere the CLI runs.
Highlights
Connect / disconnect this host — reconnect is a silent, flag-free
tailscale up; login/expired keys return anauthURLinstead of hanging; success is confirmed by polling untilRunningandSelf.Online. No elevation needed on Windows.Two backends behind one facade — the local CLI (all host control) and the REST API (tailnet management). The server starts and stays useful even with no API credentials.
Security-first — every CLI call uses
execFile(no shell) through a per-subcommand flag allow-list with single--flag=valuetokens (no flag-smuggling, no generic passthrough); secrets are redacted from all output (tool text andstructuredContent) bar the one-time secret a create call exists to return; tools that can cut connectivity, remove access, mint credentials or can't be undone require client-enforced human approval (_meta["anthropic/requiresUserInteraction"]), not a model-supplied flag. An operator can exempt a few reversible host tools withTAILSCALE_APPROVAL_EXEMPT.48 tools across three risk tiers (24 read, 16 write, 8 admin), plus MCP resources and prompts, and a
tailscale_server_infocapability catalog that explains why any tool is withheld.
See PLAN.md for the original design, the adversarial-review changelog, and the
planned per-tool inventory. What actually ships is the Tools list below; the 🔒 set and
annotations there (enforced in src/meta/approval.ts and each tool's registration) supersede
PLAN.md's narrower gating.
Related MCP server: tailscale-blade-mcp
Install & build
Requires Node.js ≥ 18 (developed on 24) and the Tailscale CLI installed on the host.
npm install
npm run buildRegister with Claude
Windows
Claude Code:
claude mcp add tailscale -- node "C:\\Users\\Nic\\Documents\\Claude\\Code\\MCP-Tailscale\\dist\\index.js"Or add to your MCP client config (Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"tailscale": {
"command": "node",
"args": ["C:\\Users\\Nic\\Documents\\Claude\\Code\\MCP-Tailscale\\dist\\index.js"],
"env": {
"TAILSCALE_RISK_LEVEL": "write"
}
}
}
}On Windows, launch via
node dist/index.js(orcmd /c npx …) —execFilecannot spawn a barenpx.cmd. Put credentials in theenvblock above, not in a shell profile (a cmd-launched server won't see those).
macOS
Claude Code, registered for your user (every project):
claude mcp add --scope user tailscale \
--env TAILSCALE_RISK_LEVEL=write \
--env TAILSCALE_CLI_PATH=/Applications/Tailscale.app/Contents/MacOS/Tailscale \
-- /usr/local/bin/node /Users/nicpierce/Documents/Claude/Code/MCP-Tailscale/dist/index.js(The server name goes before the --env flags: --env takes several values and would swallow it.)
Or the equivalent JSON (the mcpServers block of ~/.claude.json for user scope, or Claude Desktop's
~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"tailscale": {
"command": "/usr/local/bin/node",
"args": ["/Users/nicpierce/Documents/Claude/Code/MCP-Tailscale/dist/index.js"],
"env": {
"TAILSCALE_RISK_LEVEL": "write",
"TAILSCALE_CLI_PATH": "/Applications/Tailscale.app/Contents/MacOS/Tailscale"
}
}
}
}
Use an absolute
nodepath (which node:/usr/local/bin/nodefor the nodejs.org installer,/opt/homebrew/bin/nodefor Homebrew) — apps launched from the Dock don't inherit your shellPATH.With the Tailscale app installed, use its bundled CLI: the app's network extension is this Mac's node, so that CLI always matches it. The server searches it first, so
TAILSCALE_CLI_PATHis optional — set it to pin the choice when a Homebrewtailscaleis also installed (that one warns about a client/daemon version mismatch whenever the two drift).Spawned without a terminal, the app's executable starts the GUI instead of acting as the CLI unless
TAILSCALE_BE_CLI=trueis set. The server sets that for the CLI process automatically (whatever the path's letter case, through a symlink, or when found onPATH), so you don't need it inenv— unlessTAILSCALE_CLI_PATHpoints at a wrapper script around the app binary.
Configuration (environment variables)
Variable | Default | Purpose |
|
|
|
| auto | Path to the CLI. Otherwise searched in order — Windows: |
| — | Path to a file holding a tailnet auth key for headless first-login (passed as |
| — | Comma-separated 🔒 tools that should run without the forced approval prompt, e.g. |
|
| Reserved for the optional LocalAPI fast path (Phase 3). |
| — | Preferred REST credentials (OAuth client-credentials). Both or neither. |
| — | Legacy static API access token (inherits the creator's full role). |
|
| Tailnet for REST calls; |
|
| Override (https or loopback only). |
|
|
|
REST tools appear only when credentials are configured. Recommended OAuth client scopes, by the
TAILSCALE_RISK_LEVEL you run:
Risk level | OAuth scopes |
|
|
|
|
| the |
Tailscale requires an OAuth client with the devices:core or auth_keys write scope to be assigned
tags, and it can only apply / mint keys for those tags. A legacy TAILSCALE_API_KEY carries its
creator's full role (no scoping). tailscale_server_info reports what's available and why.
Tools
Reads are always available; host and tailnet changes need TAILSCALE_RISK_LEVEL=write (several of
them destructive and 🔒); irreversible or tailnet-wide tools need admin. 🔒 = requires interactive
human approval in the host (anything that can cut connectivity, remove access, redirect traffic or
tailnet events, mint a credential or one-time secret, or can't be undone), unless the host tool is
exempted with TAILSCALE_APPROVAL_EXEMPT.
Risk level | Host (CLI) + | Tailnet (REST) | Total |
| 12 | 12 | 24 |
| 6 | 10 | 16 |
| 1 | 7 | 8 |
All | 19 | 29 | 48 |
All names carry the tailscale_ prefix.
Host (CLI):
status,get_prefs,connect,disconnect🔒,set_prefs🔒,set_exit_node🔒,set_routes🔒,list_exit_nodes,ping,netcheck,version,whois,whoami,dns_status,get_syspolicy,list_profiles,switch_profile🔒,logout🔒 (admin),server_info.Tailnet (REST): devices (
list_devices/get_device/authorize_device🔒/set_device_name/set_device_tags🔒/get_device_routes/set_device_routes🔒/set_device_key_expiry🔒/expire_device_key🔒 (admin)/delete_device🔒 (admin)), DNS (get_dns_config/set_dns_config🔒), policy (get_policy_file/validate_policy_file/update_policy_file🔒 (admin) with If-Match ETag), keys (list_auth_keys/create_auth_key🔒 (admin)/delete_auth_key🔒 (admin)), settings (get_tailnet_settings/update_tailnet_settings🔒 (admin)), webhooks (list_webhooks/create_webhook🔒/delete_webhook🔒 (admin)), users (list_users/get_user/approve_user/suspend_user🔒/restore_user), andget_audit_log.
Resources: tailscale://status, tailscale://prefs, tailscale://devices, tailscale://acl.
Prompts: diagnose_connectivity, review_acl_change.
Development
npm run typecheck # tsc --noEmit
npm test # node --test (argv allow-list, redaction, status parsing, policy/config,
# binary resolution + CLI env, tool layer via an in-memory MCP client)
npm run inspect # build + MCP InspectorSecurity notes
up/down/logoutaffect the whole machine's Tailscale connection (all users), and require the server to run as the user who owns the Tailscale session.Device names, ACL comments, and other tailnet free-text are treated as untrusted; devices are addressed by stable id, and impactful actions require the human-approval gate.
logoutexpires the node key (full re-auth needed);disconnectdoes not — they are distinct.One-time secrets are the deliberate exception to redaction:
create_auth_key(the new key) andcreate_webhook(its signing secret) show that one value in full in that single result, with a warning; every other secret in it (OAuth secret, API key, access tokens) stays redacted, and the value is scrubbed from all later output.The spawned
tailscaleCLI never receives the REST credentials:TAILSCALE_OAUTH_CLIENT_ID,TAILSCALE_OAUTH_CLIENT_SECRETandTAILSCALE_API_KEYare stripped from its environment.
License
MIT
Available Tools
18 toolstailscale_connectConnect this host to TailscaleAIdempotent
Bring this host online on its tailnet (tailscale up). Connectivity only — it does not change preferences (use tailscale_set_prefs).
If already Running, returns immediately; if Stopped with a valid key, runs a flag-free up (silent, no browser) then polls until reachable; if login/re-auth is needed it does NOT block — it returns a login authURL (or logs in headlessly if TAILSCALE_AUTH_KEY_FILE is set). action ∈ already_connected | reconnected | needs_login. Success means state=running. No elevation needed on Windows.
Inputs: no named parameters. Returns: os, state, action, health, +13 more
tailscale_disconnectDisconnect this host from TailscaleAIdempotent
Disconnect this host (tailscale down): brings WireGuard down but STAYS LOGGED IN — fully reversible with tailscale_connect and does NOT expire the node key (use tailscale_logout for that). Interrupts Tailscale connectivity for every user of this machine, so it requires user approval. action ∈ already_disconnected | disconnected. Success means state=stopped.
Inputs: reason. Returns: os, state, action, health, +13 more
tailscale_dns_statusMagicDNS / DNS statusARead-onlyIdempotent
Report the internal DNS forwarder (100.100.100.100) / MagicDNS configuration: resolvers, split-DNS, cert domains (tailscale dns status). Read-only.
Inputs: all.
tailscale_get_prefsTailscale preferences (this host)ARead-onlyIdempotent
Return this host's current effective Tailscale preferences via tailscale get --json (works even while Stopped). Read-only. Shows AcceptRoutes, AcceptDNS, ExitNode, Hostname, RunSSH, ShieldsUp, etc.
Inputs: no named parameters.
tailscale_get_syspolicyEffective system policy (local)ARead-onlyIdempotent
List the effective LOCAL system policy applied to Tailscale on this host (MDM/GPO/registry) via tailscale syspolicy list. Use it to explain a preference that a set/up change did not persist. NOTE: this is local device policy, NOT Tailscale device posture. Read-only.
Inputs: no named parameters.
tailscale_list_exit_nodesList exit nodesARead-onlyIdempotent
List tailnet nodes advertising as exit nodes (tailscale exit-node list), optionally filtered by country, or ask Tailscale to suggest the best one (exit-node suggest). Read-only. Select one with tailscale_set_exit_node.
Inputs: country, suggest.
tailscale_list_profilesList login profilesARead-onlyIdempotent
List the Tailscale account/login profiles on this machine (tailscale switch --list). Read-only.
Inputs: no named parameters.
tailscale_netcheckNetwork conditions checkARead-only
Analyze local network conditions (tailscale netcheck): DERP relay reachability & latency, NAT type, UDP, IPv6. Returns JSON. Read-only.
Inputs: no named parameters.
tailscale_pingTailscale pingBRead-onlyIdempotent
Ping a peer at the Tailscale layer (tailscale ping) and report the path (DERP relay vs direct). Read-only.
Inputs: target (required), count, untilDirect.
tailscale_server_infoServer info & capability catalogARead-onlyIdempotent
Report this MCP server's version, live backends (CLI path, whether REST credentials are configured), the effective tailnet, the risk level, and a catalog of every tool: whether each is available now or, if not, WHY (risk_gated — raise TAILSCALE_RISK_LEVEL; or needs_credentials — set TAILSCALE_OAUTH_* / TAILSCALE_API_KEY). Use this when a tool you expected is missing. Read-only.
Inputs: no named parameters.
tailscale_set_exit_nodeSet exit nodeAIdempotent
Route this host's internet traffic through a tailnet exit node (tailscale set --exit-node). Pass an empty string to CLEAR (stop using an exit node). ⚠ This redirects ALL of this host's traffic through the chosen node, so it requires user approval. Returns the resulting status.
Inputs: exitNode (required), allowLanAccess. Returns: os, state, health, authURL, +11 more
tailscale_set_prefsSet Tailscale preferencesAIdempotent
Incrementally change one or more preferences via tailscale set (no connect/disconnect, no complete-flag-set requirement). Only benign prefs — exit-node and routes have dedicated tools. Returns the resulting status.
Inputs: ssh, hostname, nickname, acceptDns, +7 more. Returns: os, state, health, authURL, +11 more
tailscale_set_routesSet advertised / accepted routesAIdempotent
Advertise subnet routes from this host and/or toggle accepting routes advertised by others (tailscale set --advertise-routes / --accept-routes). Advertised subnet routes still need approval in the admin console. ⚠ Route changes alter connectivity, so this requires user approval. Pass an empty advertiseRoutes array to withdraw all advertised routes. Returns the resulting status.
Inputs: acceptRoutes, advertiseRoutes. Returns: os, state, health, authURL, +11 more
tailscale_statusTailscale status (this host)ARead-onlyIdempotent
Report this host's Tailscale connection state, read from tailscale status --json.
Returns a normalized state and a connected boolean (true only when BackendState=Running AND Self.Online). Assigned Tailscale IPs persist even while Stopped, so an IP alone does not mean connected. The plain-status exit code is ignored (it is 1 when stopped); state comes from the JSON. Read-only.
Inputs: peers. Returns: os, state, health, authURL, +11 more
tailscale_switch_profileSwitch login profileA
Switch the active Tailscale account/login profile on this machine (tailscale switch <id>). ⚠ This changes which identity/tailnet controls this node, so it requires user approval. Use tailscale_list_profiles to see ids. Returns the resulting status.
Inputs: id (required). Returns: os, state, health, authURL, +11 more
tailscale_versionTailscale versionARead-onlyIdempotent
Report client and daemon versions (tailscale version --json), optionally checking for updates. Read-only.
Inputs: checkUpstream.
tailscale_whoamiIdentity of this hostBRead-onlyIdempotent
Show the machine + user identity of this node (tailscale whoami --json). Read-only.
Inputs: no named parameters.
tailscale_whoisWho-is a Tailscale IPARead-onlyIdempotent
Show the machine and user associated with a Tailscale IP (tailscale whois --json). Read-only.
Inputs: ip (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
Each tool has a clearly distinct purpose: get/set pairs are separated (get_prefs vs set_prefs), exit-node selection (set_exit_node) is split from listing (list_exit_nodes), and set_prefs explicitly excludes exit-node/routes which have dedicated tools. The only near-overlap is whoami (this node's identity) vs whois (identity for an IP), but the descriptions disambiguate them cleanly.
Every tool uses the tailscale_ prefix with a predictable verb_noun or command-name pattern (list_profiles, set_prefs, get_prefs, set_exit_node, list_exit_nodes, dns_status). The few noun-only names (status, ping, netcheck, version, whoami) mirror the underlying CLI commands, so the convention remains consistent and readable.
18 tools is within a reasonable range and each one maps to a distinct CLI capability (status, prefs, exit nodes, routes, DNS, netcheck, ping, profile switching). It is slightly on the heavy side, but the broad surface of Tailscale's CLI justifies the count.
Strong lifecycle coverage: connect/disconnect, prefs get/set, exit-node and route management, profiles, syspolicy, DNS, netcheck, ping, whois. Minor gaps include the absence of a logout tool (explicitly referenced in tailscale_disconnect's description) and no serve/funnel or file-transfer operations.
Maintenance
Related MCP Connectors
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Give your AI hands on every computer you own. Remote control of your Windows, Mac and Linux machines from one ChatGPT, Claude or Cursor chat — even from your phone. Ask it to find out why the office server is crawling, update every PC in the house, sort out your mom's laptop from another city, or ship the site from your work machine while you're on a train. It runs commands, reads files and takes a screenshot when it needs to see the screen. You decide what each computer allows, and you can cut any of them off in a second.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables interaction with the Tailscale API to manage devices, ACLs, keys, and DNS configurations directly from MCP clients like Claude Desktop or Raycast.-
- AlicenseAqualityDmaintenanceEnables AI agents to securely interact with Tailscale tailnets for device inventory, ACL review, key hygiene, and more, with token-efficient output and write-gated mutations.19MIT
- AlicenseBqualityBmaintenanceManage your Tailscale tailnet - devices, ACLs, DNS, keys, and more - through natural language queries.981,067 npm36MIT
- AlicenseNot gradedqualityDmaintenanceWraps the Tailscale CLI to enable MCP-capable AI agents to manage devices, serve configurations, and diagnose connectivity.3MIT