tailscale-blade-mcp
Enables 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.
README
tailscale-blade-mcp
An MCP server that gives AI agents structured access to Tailscale tailnets. Built for the Model Context Protocol with security visibility and token efficiency as first-class design goals.
Why this exists
Tailscale exposes a clean REST API (v2) for managing devices, ACL policies, DNS, auth keys, users, and audit logs. This MCP wraps it with the guardrails that automated agents need:
- Security-first tool set — 17 tools focused on what network security agents actually need: device inventory, key expiry auditing, ACL review, route approval, DNS hygiene. Not a thin wrapper around every endpoint.
- Token-efficient output — compact pipe-delimited format. A 20-device tailnet in ~40 tokens per device. Devices flagged with
KEY_EXPIRY_OFF,KEY_EXPIRED,UPDATE_AVAILABLE,UNAUTHORIZED,OFFLINEat a glance. - Write-gated mutations — device authorization, tagging, key management, and route approval require explicit opt-in via
TAILSCALE_WRITE_ENABLED=true. Destructive operations (delete device, revoke key) additionally require per-callconfirm=true. - SecOps visibility — ACL policy summary shows groups, rules, SSH rules, and tag owners. Audit log shows who changed what. Key listing flags reusable keys and expiry status.
How this differs from other Tailscale MCPs
| tailscale-blade-mcp | HexSleeves/tailscale-mcp | jaxxstorm/tailscale-mcp | |
|---|---|---|---|
| Focus | Monitoring + security (17 tools) | Management (~15 tools) | Read-only (~5 tools) |
| Design for | LLM agents (token-efficient) | Claude Code | General MCP |
| Output | Pipe-delimited, compact | Full JSON | Full JSON |
| Write safety | Dual-gated (env + confirm) | Direct writes | Read-only |
| Audit log | Yes | No | No |
| ACL summary | Parsed groups/rules/SSH/tags | Raw JSON | Raw JSON |
| Key hygiene | Flags reusable, expiry status | Basic listing | No |
| Marketplace | Sidereal certified | Standalone | Standalone |
Quick start
# Install
uv pip install -e .
# Configure
export TAILSCALE_API_KEY="tskey-api-..."
# Run
tailscale-blade-mcp
17 tools, 5 categories
Info (1 tool)
| Tool | Purpose | Token cost |
|---|---|---|
ts_info |
Health check — device counts, online/offline, key expiry warnings, settings, write gate | ~100 |
Devices (3 tools)
| Tool | Purpose | Token cost |
|---|---|---|
ts_devices |
All devices — hostname, OS, IP, online/offline, key expiry, tags, updates | ~40/device |
ts_device |
Full detail — addresses, client version, key status, tags, user | ~120 |
ts_device_routes |
Routes — advertised subnets, approved/unapproved status | ~30/route |
Network (3 tools)
| Tool | Purpose | Token cost |
|---|---|---|
ts_dns |
DNS — nameservers, MagicDNS, search paths, split DNS | ~50 |
ts_acl |
ACL policy — groups, rules, SSH rules, tag owners | ~30/rule |
ts_acl_validate |
Validate a policy without applying it | ~20 |
Users & Keys (3 tools)
| Tool | Purpose | Token cost |
|---|---|---|
ts_keys |
Auth keys — ID, reusable/ephemeral/preauth flags, tags, expiry | ~25/key |
ts_users |
Users — name, role, status, device count, online/last seen | ~25/user |
ts_webhooks |
Webhooks — endpoint URL, event subscriptions | ~25/webhook |
Audit (1 tool)
| Tool | Purpose | Token cost |
|---|---|---|
ts_audit_log |
Configuration changes — who, what, when | ~25/entry |
Write Operations (6 tools, gated)
| Tool | Gate | Purpose |
|---|---|---|
ts_authorize_device |
write | Authorize or deauthorize a device |
ts_set_tags |
write | Set ACL tags on a device |
ts_expire_device |
write | Force key expiry — device must re-authenticate |
ts_approve_routes |
write | Approve advertised subnet routes |
ts_create_key |
write | Create an auth key (reusable/ephemeral/preauth) |
ts_delete_key |
write + confirm | Revoke an auth key permanently |
ts_delete_device |
write + confirm | Remove a device from the tailnet |
Output format
macbook | os=mac | ip=100.100.1.1 | online | expires=2026-07-11 | id=n1234567890
nas | os=linux | ip=100.100.1.2 | online | KEY_EXPIRY_OFF | UPDATE_AVAILABLE | tags=server,infra | id=n9876543210
phone | os=iOS | ip=100.100.1.3 | OFFLINE | last=2d ago | expires=2026-05-01 | id=n5555555555
Authentication
Tailscale supports two auth methods:
| Method | Token prefix | Best for |
|---|---|---|
| API access token | tskey-api- |
Personal use, quick setup |
| OAuth client | Bearer token from client_credentials flow | Automation, scoped permissions |
Both are passed via TAILSCALE_API_KEY. For OAuth, obtain a Bearer token first and pass that.
Security model
| Layer | Mechanism |
|---|---|
| Write gate | TAILSCALE_WRITE_ENABLED=true required for any mutation |
| Destructive confirm | ts_delete_key and ts_delete_device require confirm=true |
| Credential scrubbing | API keys, Bearer tokens, Authorization headers stripped from errors |
| Bearer auth | Optional TAILSCALE_MCP_API_TOKEN for HTTP transport |
| Tailnet auto-detect | Uses - shorthand by default — no tailnet name in config |
Sidereal integration
{
"mcpServers": {
"tailscale": {
"type": "stdio",
"command": "uv",
"args": ["--directory", "~/src/tailscale-blade-mcp", "run", "tailscale-blade-mcp"],
"env": {
"TAILSCALE_API_KEY": "tskey-api-...",
"TAILSCALE_WRITE_ENABLED": "false"
}
}
}
}
Webhook trigger patterns
- Key expiry approaching —
ts_devicesflagsKEY_EXPIRY_OFFand expired keys for proactive rotation - Unauthorized devices —
ts_devicesflagsUNAUTHORIZEDfor approval workflows - Route approval —
ts_device_routesshows unapproved subnets for security review - ACL changes —
ts_audit_logtracks policy updates for compliance auditing - Stale devices —
ts_devicesshowsOFFLINEwith last-seen time for cleanup workflows
Development
make install-dev # Install with dev + test dependencies
make test # Unit tests (mocked, no API access needed)
make check # Lint + format + type-check
make run # Start MCP server (stdio)
Architecture
src/tailscale_blade_mcp/
├── server.py — FastMCP server, 17 @mcp.tool decorators
├── client.py — TailscaleClient wrapping httpx async, credential scrubbing
├── formatters.py — Token-efficient output (pipe-delimited, null omission, human units)
├── models.py — TailscaleConfig, write gate, constants
└── auth.py — Bearer token middleware for HTTP transport
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。