# Tailscale MCP

> Tailscale MCP is an open-source MCP server for cloud and infrastructure. Let AI agents inspect your Tailscale network and share ports, with safe defaults. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Windows, Linux, self-hosted
- **Website:** https://tmhsdigital.github.io/tailscale-mcp/
- **Repository:** https://github.com/tmhsdigital/tailscale-mcp
- **MCP Registry name:** io.github.TMHSDigital/tailscale-mcp
- **Categories:** cloud and infrastructure, developer tools
- **Listing updated:** 2026-11-15

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

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

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

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

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

- `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

## 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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/tailscale-mcp
