tailnet-agent-mcp
Provides tools for working with devices on Tailscale tailnets: listing devices and status, pinging, checking TCP ports, probing HTTP/TLS services, viewing health and access settings, and, when explicitly enabled, running SSH commands or copying files. Also supports managing multiple userspace tailscaled nodes across tailnets.
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-agent-mcp list the devices on my tailnet with their IPs and online status"
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-agent-mcp
MCP servers that let an AI assistant work with devices on Tailscale tailnets: list them, ping them, probe their ports and web services, and (only where a human has allowed it) run a command or copy a file. Two servers share one safety model:
Server | Entry point | Scope |
|
| The machine's one active Tailscale profile |
|
| Several tailnets at once, one userspace |
Why it exists
I use one workstation against more than one tailnet (personal, a lab, and at one point an employer's), and Tailscale lets only one profile be active on a machine's daemon. Two problems came out of that:
Switching the active profile silently broke things. A health-check job that reached hosts over the active tailnet went blind the moment the profile was switched for something unrelated. So the first server checks the active profile before every call and refuses, printing the exact switch command for a human to run. It never switches by itself.
I wanted the assistant to reach several tailnets without any switching. The second server runs one userspace tailscaled per tailnet as a systemd user unit (own socket, own state directory, local SOCKS5 port). It needs no root and never touches the system daemon or its active profile.
Related MCP server: @yawlabs/tailscale-mcp
Tools
Tool | What it does | Access |
| (multi) which tailnets are configured and running; start or stop a node |
|
| all devices: IP, OS, tags, online, direct vs relay | read-only |
| one device in detail: OS, versions, key expiry, routes, traffic | read-only |
| path (direct or relay) and latency | read-only |
| TCP connect check of a port list | read-only |
| GET a service: status, headers, title, TLS certificate summary | read-only |
| local profile, health warnings, netcheck | read-only |
| show per-device access settings | read-only |
| ssh / scp to a device | needs |
Safety model
All of this is covered by offline tests in tests/test_config_and_gate.py.
Remote execution is off by default and gated per device, by a human. A device needs both
exec = trueand an explicitssh_userin the config file.ssh_useralone is not enough (tested). The assistant is instructed never to edit that file or guess usernames; when access is missing, the error tells it exactly what to ask the user for.One choke point.
run_command,push_fileandpull_fileall go through a single_access()function, so the gate cannot be bypassed by one tool forgetting to check.ssh runs in
BatchMode(never prompts), with its ownknown_hostsfile, and through a ProxyCommand that uses that tailnet's own daemon socket. No credentials are stored: auth is the Tailscale SSH identity or your normal keys.Wrong-tailnet guard. Each tailnet's expected name is configured; a node that logged in somewhere else is refused.
Offline devices are refused even when enabled, with when they were last seen.
Config is re-read on every call, so the human can open or close the gate without restarting the server.
Tailscale SSH "check" mode is handled: the tool returns the approval URL immediately instead of hanging.
Run it
cp config.example.toml ~/.config/tailnet-agent-mcp/config.toml # single-profile server
cp config.multi.example.toml ~/.config/multi-tailnet/config.toml # multi-tailnet server
uv run python tests/smoke.py my-laptop # exercise the read-only tools
# register with your MCP client: command = `uv --directory <repo> run tailnet-agent-mcp` (or `multi-tailnet`)Python >= 3.12, the mcp SDK, and the tailscale CLI. The multi-tailnet server needs tailscaled
available for userspace nodes.
Tests
PYTHONPATH=src python -m unittest discover -s tests -p 'test_*.py' # 10 offline teststests/smoke*.py are live checks against a real tailnet and are not run by the unit-test command.
Available Tools
10 toolsaccess_configARead-only
Show the config file path and per-device access settings (no secrets are stored there - auth is Tailscale SSH identity or your SSH keys).
Inputs: no named parameters. Returns: result
check_portsBRead-only
TCP-connect check for ports on a device (default: a common set - ssh, http(s), smb, rdp, vnc, winrm, databases...). Reports open / closed / filtered.
Inputs: device (required), ports, timeout_s. Returns: result
device_infoARead-only
Full details for one device (hostname, MagicDNS name or tailnet IP): addresses, OS, owner/tags, online state, endpoints, key expiry, traffic, Tailscale SSH, and this server's configured access for it.
Inputs: device (required). Returns: result
http_probeBRead-only
HTTP GET a web service on a device; returns status, key headers, page , TLS certificate subject/issuer/expiry (for https) and the start of the body. Read-only.
Inputs: device (required), path, port, scheme, +2 more. Returns: result
ping_deviceARead-only
Tailscale-level ping (works even if the device firewalls ICMP). Shows whether the path is direct or via a DERP relay and the latency.
Inputs: device (required), count. Returns: result
pull_fileBDestructive
Copy a file or directory from a device to this machine (scp -r). Requires exec=true.
Inputs: device (required), local_path (required), remote_path (required), timeout_s. Returns: result
push_fileBDestructive
Copy a local file or directory to a device (scp -r). Requires exec=true.
Inputs: device (required), local_path (required), remote_path (required), timeout_s. Returns: result
run_commandBDestructive
Run a shell command on a device over SSH as its configured ssh_user. Requires exec=true for the device in the config. Windows devices need OpenSSH server enabled.
Inputs: device (required), command (required), timeout_s. Returns: result
tailnet_statusBRead-only
List devices on the tailnet: name, IP, OS, owner, online/last seen, connection path, Tailscale SSH availability and whether this server has exec access configured.
Inputs: include_offline. Returns: result
tailscale_healthARead-only
This machine's Tailscale state: active profile/tailnet, own IPs, health warnings, and a netcheck (NAT type, UDP, nearest DERP relays).
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools target a distinct action+resource (ping vs port check vs HTTP probe vs file transfer) and descriptions clarify the boundaries. Minor overlap: tailnet_status (tailnet-wide listing) vs tailscale_health (local node state) vs device_info (single device) could be momentarily confused, and access info appears in both device_info and access_config.
All names are snake_case, which helps, but the conventions are mixed: verb_noun forms (ping_device, check_ports, run_command, push_file, pull_file) sit alongside noun phrases (tailnet_status, device_info, tailscale_health, access_config) and an ambiguous 'http_probe'.
Ten tools is well within the sweet spot and each one maps to a clear, non-redundant capability: discovery, inspection, connectivity, port/web probing, health, exec, and file transfer. Nothing feels padded or missing from a count perspective.
Covers the practical lifecycle for a tailnet agent: enumerate devices, inspect one, test reachability at ICMP/TCP/HTTP layers, check local health/netcheck, and perform remote exec and file copy with a config introspection tool. Gaps are minor — no tailnet administration (key expiry reauth, node removal, ACL/DNS inspection) and no traceroute or DNS resolution check, but agents can work around these.
Maintenance
Related MCP Connectors
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Connect AI assistants to explicitly paired computers, servers, and VMs for permitted remote actions.
Give your AI hands on every computer you own. Remote control of your Windows, Mac and Linux machines from one ChatGPT, Claude or Cursor chat — even from your phone. Ask it to find out why the office server is crawling, update every PC in the house, sort out your mom's laptop from another city, or ship the site from your work machine while you're on a train. It runs commands and reads and writes files; screenshots are a beta you can request. You decide what each computer allows, and you can cut any of them off in a second.
Connect AI assistants to your approved computer for files, commands, browser and desktop tasks.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables 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
- AlicenseBqualityBmaintenanceManage your Tailscale tailnet - devices, ACLs, DNS, keys, and more - through natural language queries.981,067 npm36MIT
- AlicenseNot gradedqualityDmaintenanceQuery devices, check connectivity, and get network status from your Tailscale tailnet directly via an AI assistant.1MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to access and manage your Mac's Calendar, Reminders, Contacts, Notes, Messages, Voice Memos, and Shortcuts over a private Tailscale network without exposing anything to the internet.MIT