Let your AI agent see your tailnet, and change it only when you say so.
An MCP server for the Tailscale client on your machine. Your agent can list your devices, write SSH config for them, share a dev server with your tailnet, and check which links are direct or relayed. Anything that writes starts as a dry run, and nothing reaches the public internet unless you turn it on.
claude mcp add tailscale -- npx -y @tmhs/tailscale-mcp
That's the Claude Code command. Other clients are below.
ping_all result, drawn. The matrix tells your agent which devices answer and whether each link is a fast direct path or relayed.
Install
The server runs locally over stdio and talks to the tailscale CLI that's already on your machine. There's no account, API key, or daemon to set up.
Claude Code
Run once in your terminal.
claude mcp add tailscale -- npx -y @tmhs/tailscale-mcp
Claude Desktop
Download the extension and open it. The install dialog has switches for read-only mode and public sharing, and nothing else to configure.
Cursor
Add to Cursor, or add this to ~/.cursor/mcp.json (the same block works in Claude Desktop's claude_desktop_config.json).
{
"mcpServers": {
"tailscale": {
"command": "npx",
"args": ["-y", "@tmhs/tailscale-mcp"]
}
}
}
VS Code
Install in VS Code, or add this to .vscode/mcp.json in your workspace.
{
"servers": {
"tailscale": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@tmhs/tailscale-mcp"]
}
}
}
Turn on public sharing
Only if you want share_port to be able to expose a port to the open internet with Funnel. Add this to the server's entry in any of the configs above.
"env": { "TAILSCALE_MCP_ALLOW_FUNNEL": "1" }
Requires Node 22 or newer and a Tailscale client that's installed and logged in. On macOS the CLI is found inside Tailscale.app automatically. All settings are listed in the configuration reference. The server is also in the official MCP Registry as io.github.TMHSDigital/tailscale-mcp.
Tools
Six tools, each labeled with what it can change. MCP clients read the same labels, so they can run status checks without asking and confirm anything that changes your machine.
| Tool | What it does | Effect |
|---|---|---|
| The tool list is loaded from mcp-tools.json, the same definitions the server sends to your client. | ||
What it will and won't do
Your agent acts with your machine's Tailscale access, so the limits are enforced in code, not left to a warning in the prompt.
- Writes start as dry runs
generate_ssh_configreturns the config text and writes nothing until asked. Edits to~/.ssh/configstay between its own markers, keep a backup, and stop if the markers look damaged.- Funnel stays off until you turn it on
- Sharing a port defaults to your tailnet only. Exposing it to the open internet is refused unless you set
TAILSCALE_MCP_ALLOW_FUNNEL=1yourself, so a prompt-injected agent can't do it. - It only stops what you name
stop_shareneeds an explicit target and reports what it removed. It can stop just the shares it created. Wiping every share takesall: true.- No credentials, ever
- It never reads or stores auth keys or tokens. It only uses the access your logged-in Tailscale client already has.
- Every call has a deadline
- A hung daemon returns a timeout error instead of stalling your agent.
ping_allreturns partial results after 45 seconds. - Errors say how to fix them
- Not logged in, daemon stopped, CLI missing, Serve not enabled: each comes back with a code and the exact command or setting that fixes it.
Need an agent that can only look? TAILSCALE_MCP_READONLY=1 removes the share tools entirely.