Tailnet MCP Server
Provides tools for querying and managing a Tailscale tailnet, including listing devices, checking connectivity, and retrieving network status.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Tailnet MCP Serverlist all devices on my tailnet"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Tailnet MCP Server
Why I built this: I built this to learn Tailscale - this was my first time using it. From past experience debugging network issues, I thought having an MCP to feed network state directly into an LLM could make diagnosing connectivity problems much easier than context-switching between CLI output and chat windows.
A Model Context Protocol (MCP) server that exposes your Tailscale tailnet as a queryable resource for LLMs. Query devices, check connectivity, and get network status directly from your AI assistant.
Prerequisites
Docker
A Tailscale account with at least one device on your tailnet
Related MCP server: tailscale-blade-mcp
Setup & Test
Clone & enter the repo:
git clone https://github.com/AlexSKorn/TailscaleMCP.git cd TailscaleMCPGet an Auth Key: Go to your Tailscale Admin Console, click "Generate auth key", and copy the key (starts with
tskey-auth-).Configure & start:
make setup # creates .env from template # edit .env and paste your TS_AUTHKEY make docker-up # start containers make docker-test # should print "Connection test: OK"Try it interactively with the MCP Inspector:
npx @modelcontextprotocol/inspector docker compose exec -T tailnet-mcp python -m tailnet_mcp.serverOpen the URL shown in your terminal (usually
http://localhost:3000), click Connect and then "List Tools", then pick any tool and click "Run".
Available Tools
Tool | Input | What it does |
|
| List all devices on your tailnet |
|
| Detailed info for a specific device |
|
| Network overview (MagicDNS, version, device count) |
|
| Ping a device and report latency |
|
| List available exit nodes |
Cleanup
make docker-down # stop containers (keeps state)
make docker-clean # stop and remove all dataArchitecture
MCP Client (stdio) ←→ tailnet-mcp (FastMCP) ←→ tailscale (Unix socket)
↓
/localapi/v0/*MCP client sends tool calls via stdio
Server translates them to Tailscale Local API requests over a Unix socket
Tailscale daemon responds with network state
Server formats responses for human readability
Key design decisions:
Read-only — the server cannot modify Tailscale settings, add/remove devices, or change ACLs
Local API only — all calls stay on the local machine (no external network calls, no stored credentials)
Async throughout — httpx for socket I/O, subprocess for pings
Project Structure
src/tailnet_mcp/
├── server.py # MCP server & tool definitions
├── tailscale.py # Tailscale local API client (async httpx over Unix socket)
├── models.py # Pydantic data models
tests/
└── test_server.py # pytest + pytest-asyncio testsDevelopment
pip install -e ".[dev]" # install with dev dependencies
make test # run tests
make check-all # lint + format + type-check + testsLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
11Manage uptime monitors and incidents and search logs, metrics and traces from an AI assistant.
- mytesla.ioOAuthio.mytesla
Control your Tesla from your AI assistant - climate, charging, access, and security.
Inspect and control your Northflank projects, services, jobs, and builds from your AI assistant.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables interaction with the Tailscale API to manage devices, ACLs, keys, and DNS configurations directly from MCP clients like Claude Desktop or Raycast.-
- AlicenseAqualityCmaintenanceEnables AI agents to securely interact with Tailscale tailnets for device inventory, ACL review, key hygiene, and more, with token-efficient output and write-gated mutations.19MIT
- AlicenseAqualityAmaintenanceManage your Tailscale tailnet - devices, ACLs, DNS, keys, and more - through natural language queries.98219 npm34MIT
- AlicenseNot gradedqualityDmaintenanceWraps the Tailscale CLI to enable MCP-capable AI agents to manage devices, serve configurations, and diagnose connectivity.3MIT