Tailnet MCP Server
Query devices, check connectivity, and get network status from your Tailscale tailnet directly via an AI assistant.
README
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
Setup & Test
-
Clone & enter the repo:
git clone https://github.com/AlexSKorn/TailscaleMCP.git cd TailscaleMCP -
Get 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_devices |
{} or {"online_only": true} |
List all devices on your tailnet |
get_device |
{"hostname": "your-device"} |
Detailed info for a specific device |
get_tailnet_status |
{} |
Network overview (MagicDNS, version, device count) |
check_connectivity |
{"hostname": "your-device"} |
Ping a device and report latency |
list_exit_nodes |
{} |
List available exit nodes |
Cleanup
make docker-down # stop containers (keeps state)
make docker-clean # stop and remove all data
Architecture
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 tests
Development
pip install -e ".[dev]" # install with dev dependencies
make test # run tests
make check-all # lint + format + type-check + tests
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.