Skip to main content
MCP server CX Codex

Tailscale — Claude Code MCP server: what it does, how to install

Controls local Tailscale nodes through the CLI and manages the tailnet via the control-plane API. Gives AI coding agents direct access to network state.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env TAILSCALE_API_KEY=<TAILSCALE_API_KEY> --env TAILSCALE_OAUTH_CLIENT_ID=<TAILSCALE_OAUTH_CLIENT_ID> --env TAILSCALE_OAUTH_CLIENT_SECRET=<TAILSCALE_OAUTH_CLIENT_SECRET> --env TAILSCALE_TAILNET=<TAILSCALE_TAILNET> --env TAILSCALE_MCP_PRESET=<TAILSCALE_MCP_PRESET> --transport stdio tailscale -- npx -y @tailscale-mcp/tailscale-mcp
Open on GitHub

What Tailscale does

This server connects an AI assistant to Tailscale infrastructure. It runs local node operations by calling the tailscale CLI directly and executes wider tailnet changes using the control-plane REST API. Each plane works independently. If no credentials are supplied, network-wide tools stay hidden while local node tools remain available.

Tools are grouped into minimal, core, and full presets. Dangerous actions stay restricted by default. Read operations are always enabled, but configuration edits and destructive actions demand explicit permission flags. Tailnet-wide destructive calls also mandate passing confirm: true.

On macOS, the server requires the shim installed at /usr/local/bin. Pointing directly to the binary inside the application bundle launches the GUI instead of answering CLI calls, causing all node tools to fail.

What it helps with

  • inspect node status and active devices across the tailnet
  • modify device routing and tailnet configuration through the REST API
  • restrict agent execution to read-only network inspection
  • verify environment tools and credentials using tailscale-mcp diagnose

Example prompts for the agent

  • List all reachable devices currently active in my tailnet
  • Check the connection status of this local Tailscale node
  • Run tailscale-mcp diagnose to see which tool sets are currently enabled

How to install Tailscale

Platform CLI

claude mcp add --env TAILSCALE_API_KEY=<TAILSCALE_API_KEY> --env TAILSCALE_OAUTH_CLIENT_ID=<TAILSCALE_OAUTH_CLIENT_ID> --env TAILSCALE_OAUTH_CLIENT_SECRET=<TAILSCALE_OAUTH_CLIENT_SECRET> --env TAILSCALE_TAILNET=<TAILSCALE_TAILNET> --env TAILSCALE_MCP_PRESET=<TAILSCALE_MCP_PRESET> --transport stdio tailscale -- npx -y @tailscale-mcp/tailscale-mcp

Replace <…> with your own values. 2 more environment variables are in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Tailscale

How to install Tailscale in Claude Code?

Run `claude mcp add --env TAILSCALE_API_KEY=<TAILSCALE_API_KEY> --env TAILSCALE_OAUTH_CLIENT_ID=<TAILSCALE_OAUTH_CLIENT_ID> --env TAILSCALE_OAUTH_CLIENT_SECRET=<TAILSCALE_OAUTH_CLIENT_SECRET> --env TAILSCALE_TAILNET=<TAILSCALE_TAILNET> --env TAILSCALE_MCP_PRESET=<TAILSCALE_MCP_PRESET> --transport stdio tailscale -- npx -y @tailscale-mcp/tailscale-mcp`.

What does the Tailscale MCP server do?

It exposes up to 186 tools for interacting with a local Tailscale node via its CLI and the broader tailnet via control-plane API calls.

Why use OAuth credentials instead of an API access token?

OAuth belongs to the tailnet rather than a person, limits permissions to assigned scopes, and issues short-lived tokens valid for one hour.

Similar MCP servers

All MCP servers for DevOps and infrastructure →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor