connect_network
Connect this host to Tailscale with optional CLI flags.
Run a tailnet from your client — devices, routes, ACLs, DNS, auth keys, exit nodes — with a risk ceiling that decides how much of it is writable.
LABSCO SUMMARY
TAILSCALE_ALLOWED_TOOL_RISK is a single dial with three positions — read, write, admin — and it maps onto the operations people actually worry about: read answers questions, write changes ACLs, DNS, routes and tags, admin can delete devices and mint auth keys. The dual backend is the other thing to plan around: tailnet administration goes over the API with your OAuth credentials, while network status, connect, disconnect, ping, version and exit-node changes run the local CLI, so those six need the Tailscale binary present on the machine hosting the server.
A Tailscale operations server that works two ways at once: the Tailscale REST API for tailnet-wide administration, and the local Tailscale CLI for anything about the machine it runs on. It starts read-only and localhost-bound.
A Tailscale account and credentials for the tailnet: TAILSCALE_OAUTH_CLIENT_ID with TAILSCALE_OAUTH_CLIENT_SECRET is the preferred pair, and TAILSCALE_API_KEY is the fallback; TAILSCALE_TAILNET defaults to -, meaning the authenticated user's default tailnet. TAILSCALE_ALLOWED_TOOL_RISK is the ceiling and defaults to read — write enables ACL, DNS, route and tag changes, admin additionally enables device deletion, connect and disconnect, and auth key management. The CLI-backed tools need a local Tailscale binary, found at TAILSCALE_CLI_PATH. Default transport is stdio; MCP_TRANSPORT=http requires MCP_HTTP_BEARER_TOKEN of at least 32 characters and binds to 127.0.0.1 on port 3000 unless MCP_HTTP_BIND_HOST and MCP_HTTP_PORT say otherwise. Published as @hexsleeves/tailscale-mcp-server, with a Docker image as well. MIT.
One command plus a key — npx -y @hexsleeves/tailscale-mcp-server, then supply credentials
USE CASES
Check local network status, ping the peer through the CLI, and look at the device list including offline devices to see whether it is even up.
Read the current ACL, validate the edited policy, and only then apply it.
Create an auth key, connect the host with the hostname and route flags it needs, and tag the device so the ACLs cover it.
Approve the routes it is advertising, and set which exit node the local machine should use.
List the tailnet including offline devices, then expire the keys or remove the ones that should not come back.
Read the DNS settings, adjust nameservers, search paths or MagicDNS, and confirm from a host that resolution now works.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
connect_networkConnect this host to Tailscale with optional CLI flags.
device_actionAuthorize, deauthorize, delete, or expire a device key.
disconnect_networkDisconnect this host from Tailscale.
get_network_statusGet current Tailscale network status.
get_tailnet_infoGet detailed information about the configured tailnet.
get_versionGet local Tailscale CLI version information.
get_version_infoCompatibility alias for server version details.
list_devicesList devices in the configured Tailscale tailnet.
manage_aclRead, validate, or update the tailnet ACL policy.
manage_device_tagsRead or update tags for a device.
manage_dnsRead or update Tailscale DNS settings.
manage_exit_nodesList exit nodes, set local exit node, or advertise routes.
manage_file_sharingRead or update tailnet file sharing settings.
manage_keysList, create, or delete Tailscale authentication keys.
manage_network_lockNetwork lock status and mutation operations.
manage_policy_fileRead or update the tailnet policy file.
manage_routesEnable or disable advertised routes for a device.
manage_webhooksList, create, test, or delete Tailscale webhooks.
ping_peerPing a Tailscale peer through the local Tailscale CLI.
BEFORE YOU INSTALL
19 tools when we connected. TAILSCALE_ALLOWED_TOOL_RISK defaults to read, so only read tools succeed; write unlocks ACL, DNS and route changes, and admin unlocks deletes and other destructive actions. Six tools also need a local Tailscale CLI.
CONTEXT COST
Rated by the size of the 19 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npx -y @hexsleeves/tailscale-mcp-server{
"mcpServers": {
"tailscale": {
"command": "npx",
"args": [
"-y",
"@hexsleeves/tailscale-mcp-server"
],
"env": {
"TAILSCALE_OAUTH_CLIENT_ID": "<YOUR_TAILSCALE_OAUTH_CLIENT_ID>",
"TAILSCALE_OAUTH_CLIENT_SECRET": "<YOUR_TAILSCALE_OAUTH_CLIENT_SECRET>",
"TAILSCALE_TAILNET": "-"
}
}
}
}{
"mcpServers": {
"tailscale": {
"command": "npx",
"args": [
"-y",
"@hexsleeves/tailscale-mcp-server"
],
"env": {
"TAILSCALE_API_KEY": "<YOUR_TAILSCALE_API_KEY>",
"TAILSCALE_TAILNET": "-"
}
}
}
}{
"mcpServers": {
"tailscale": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"TAILSCALE_API_KEY=<YOUR_TAILSCALE_API_KEY>",
"-e",
"TAILSCALE_TAILNET=<YOUR_TAILSCALE_TAILNET>",
"hexsleeves/tailscale-mcp-server:latest"
]
}
}
}claude mcp add tailscale \
-e TAILSCALE_API_KEY=<YOUR_TAILSCALE_API_KEY> \
-e TAILSCALE_TAILNET=- \
-- npx -y @hexsleeves/tailscale-mcp-server