Tailnet MCP Server

Tailnet MCP Server

Query devices, check connectivity, and get network status from your Tailscale tailnet directly via an AI assistant.

Category
Visit Server

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

  1. Clone & enter the repo:

    git clone https://github.com/AlexSKorn/TailscaleMCP.git
    cd TailscaleMCP
    
  2. Get an Auth Key: Go to your Tailscale Admin Console, click "Generate auth key", and copy the key (starts with tskey-auth-).

  3. 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"
    
  4. Try it interactively with the MCP Inspector:

    npx @modelcontextprotocol/inspector docker compose exec -T tailnet-mcp python -m tailnet_mcp.server
    

    Open 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/*
  1. MCP client sends tool calls via stdio
  2. Server translates them to Tailscale Local API requests over a Unix socket
  3. Tailscale daemon responds with network state
  4. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured