Skip to content
MCP server

Tailscale MCP

Let AI agents inspect your Tailscale network and share ports, with safe defaults

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, macOS, Windows
Runs
Locally
Version
0.4.0
Listing updated
2 days ago

About Tailscale MCP

Tailscale MCP is an open-source MCP server for cloud and infrastructure. It runs locally on your machine and is started by your AI client.

The server shells out to the tailscale command-line tool on your own machine, so it needs no account, API key or extra daemon and never reads or stores auth keys. It uses whatever access your logged-in Tailscale client already has. Node 22 or newer is required, and on macOS it finds the CLI inside Tailscale.app by itself.

Safety limits are enforced in code. Config writes begin as dry runs, edits to ~/.ssh/config stay between marked sections and keep a backup, and exposing a port to the open internet with Funnel is refused unless you set TAILSCALE_MCP_ALLOW_FUNNEL=1 yourself. A read-only switch removes the sharing tools entirely and blocks SSH config writes.

Every call has a deadline (10 seconds by default, 45 for the full ping matrix), and failures come back with a code and the exact command that fixes them, such as logging in or starting the daemon. On Linux, changing Serve or Funnel needs root or a configured operator.

Install

Run in a terminal

claude mcp add tailscale-mcp -- npx -y @tmhs/tailscale-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "tailscale-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tmhs/tailscale-mcp"
      ]
    }
  }
}
Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "tailscale-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tmhs/tailscale-mcp"
      ]
    }
  }
}
Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to .vscode/mcp.json

{
  "servers": {
    "tailscale-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@tmhs/tailscale-mcp"
      ]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "tailscale-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tmhs/tailscale-mcp"
      ]
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "tailscale-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@tmhs/tailscale-mcp"
      ]
    }
  }
}

Configuration

  • TAILSCALE_MCP_ALLOW_FUNNELSet to 1 to let share_port expose a port to the open internet with Funnel (off by default)
  • TAILSCALE_MCP_READONLYSet to 1 for monitoring only: no share tools, and no SSH config writes
  • TAILSCALE_MCP_BINPath to the tailscale binary if it is not on PATH or in the default install location
  • TAILSCALE_MCP_TIMEOUT_MSPer-call timeout for tailscale commands in milliseconds (default 10000)

Tools this server provides (5)

Taken from the project documentation; the running server may differ.

share_port
Shares a local port with your tailnet, or publicly with Funnel when enabled
stop_share
Stops shares by explicit target; all: true removes every share
generate_ssh_config
Returns SSH config text and writes only when asked
ping_all
Returns a latency matrix across devices, capped at 45 seconds
ping
Pings a device with a configurable count and timeout

What it does

Tailnet discovery
Lists your devices and tailnet status for the agent.
SSH config generation
Produces config text for your devices and only writes when asked.
Port sharing
Shares a local port with your tailnet, or publicly via Funnel if enabled.
Latency matrix
Shows which device links are direct and which are relayed.
Read-only mode
One setting removes the share tools and blocks config writes.
Actionable errors
Errors include a code and the command that fixes them.

Good for

  • Ask an agent which devices on your tailnet are online
  • Generate SSH config entries for your machines
  • Share a local dev server with teammates on your tailnet
  • Check whether links between devices are direct or relayed
  • Give an agent monitoring-only access to a tailnet

Pricing

Open source

Free npm package

Prices change. Check tmhsdigital.github.io before you buy.

Tailscale MCP FAQ

Does it need a Tailscale API key?

No. It only uses your installed, logged-in Tailscale client and never reads or stores auth keys.

Can the agent expose a port to the internet?

Only if you set TAILSCALE_MCP_ALLOW_FUNNEL=1. Otherwise the call returns FUNNEL_DISABLED and nothing is shared.

How do I stop it making changes?

Set TAILSCALE_MCP_READONLY=1. The share tools are not registered and SSH config writes are refused.

What does it require?

Node 22 or newer and an installed, logged-in Tailscale client.

Is Tailscale MCP free?

Yes. Tailscale MCP is open source, so you can use and self-host it for free.

How do I add Tailscale MCP to Claude Code?

Run this command in your terminal: claude mcp add tailscale-mcp -- npx -y @tmhs/tailscale-mcp

What are the best alternatives to Tailscale MCP?

The closest alternatives to Tailscale MCP are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

Alternatives to Tailscale MCP

  1. REA

    MCP server

    CLI and MCP server that lets coding agents reverse engineer apps and binaries

    Runs locally
    • Open source
    • 464K GitHub stars
    • Developer tools
  2. Codebase Memory

    MCP server

    Local MCP server that builds a code knowledge graph for AI coding agents

    Runs locally
    • Open source
    • 48.7K GitHub stars
    • Knowledge and memory
  3. GitHub

    MCP server

    Official MCP server connecting AI assistants to GitHub repos, issues and workflows

    Not checked yet
    • Remote
    • Open source
    • 34.5K GitHub stars
    • Developer tools
  4. MCP toolkit giving coding agents symbol-level code retrieval and editing

    Runs locally
    • Open source
    • 31.5K GitHub stars
    • Developer tools
  5. XERJ

    MCP server

    Local search engine for AI agents with cited answers over your code and docs

    Runs locally
    • Open source
    • 19.2K GitHub stars
    • Knowledge and memory
  6. Ouroboros

    MCP server

    Spec-first layer that pins requirements and verifies results of AI coding agent work

    Runs locally
    • Open source
    • 6.4K GitHub stars
    • Developer tools