Secure MCP access for private infrastructure over Tailscale
mcp-tailscale
Secure MCP access for private infrastructure over Tailscale
The Problem
AI agents need access to internal tools, services, and infrastructure — but exposing private systems to the internet creates unacceptable security risks. VPNs are complex, SSH tunnels are fragile, and API gateways add latency and maintenance overhead.
mcp-tailscale bridges this gap: a lightweight MCP server that gives AI agents secure, authenticated access to your Tailscale-connected infrastructure — without exposing anything to the public internet.
What It Does
mcp-tailscale is an MCP Gateway Runtime that connects AI agents (Claude, GPT, custom) to your private infrastructure through Tailscale's zero-trust network. It provides 48 tools across 9 domains for managing devices, DNS, ACL policies, auth keys, users, webhooks, posture integrations, and tailnet settings — all through the Tailscale API v2.
No SSH. No shell execution. API-only. 4 runtime dependencies.
Use Cases
- DevOps Automation — Let AI agents manage device authorization, subnet routes, and ACL policies across your tailnet
- DNS Management — Configure split DNS, global nameservers, and MagicDNS through natural language
- Security Auditing — Automated ACL policy validation, posture compliance checks, and key rotation
- Fleet Management — Monitor device status, manage tags, and onboard new devices at scale
- Infrastructure as Conversation — Query and modify your private network configuration through AI-driven workflows
Quick Start
Install from npm
npm install -g tailscale-mcp
Or clone and build from source
git clone https://github.com/itunified-io/mcp-tailscale.git
cd mcp-tailscale
npm install
cp .env.example .env # Edit with your Tailscale API key and tailnet name
npm run build
node dist/index.js # stdio transport for MCP
Claude Code Integration
Add to .mcp.json in your project root:
{
"mcpServers": {
"tailscale": {
"command": "node",
"args": ["/path/to/mcp-tailscale/dist/index.js"],
"env": {
"TAILSCALE_API_KEY": "your-api-key-here",
"TAILSCALE_TAILNET": "your-tailnet-name"
},
"comment": "Or use OAuth: TAILSCALE_OAUTH_CLIENT_ID + TAILSCALE_OAUTH_CLIENT_SECRET instead of TAILSCALE_API_KEY"
}
}
}
Features
48 tools across 9 domains:
- Devices — List, get, delete, authorize, expire, rename devices; manage routes, tags, and posture attributes
- DNS — Global nameservers, search paths, split DNS configuration, MagicDNS preferences
- ACL — Get, set, preview, validate, and test ACL policies
- Keys — List, get, create, and revoke auth keys
- Tailnet — Settings (read/write), contacts, Tailnet Lock status
- Users — List and get tailnet users with role/type filtering
- Webhooks — Create, list, get, and delete webhook endpoints
- Posture Integrations — List, get, create, and delete third-party posture provider integrations
- Diagnostics — Tailnet status summary, API connectivity check, log streaming, DERP map
Authentication: API key or OAuth client credentials (auto-refresh)
Skills
Claude Code skills compose MCP tools into higher-level workflows. See `.claude/skills/README.md` for detailed documentation.
| Skill | Slash Command | Description |
|---|---|---|
| tailscale-health | /ts-health |
Tailnet health dashboard — devices, DNS, ACL, keys, connectivity |
| tailscale-live-test | /ts-test |
Live integration test — read + safe writes with cleanup |
| tailscale-acl-management | — | ACL policy management — view, edit, validate, test, drift detection |
| tailscale-device-management | — | Device management — list, authorize, routes, tags, posture |
| tailscale-dns-management | — | DNS management — split DNS, nameservers, search paths, MagicDNS |
| tailscale-key-management | — | Auth key management — create, list, rotate, revoke |
| tailscale-onboarding | — | New device onboarding — auth key, authorize, tags, routes, verify |
SSE
Tools (4)
device_managementManage devices including listing, authorizing, renaming, and managing routes or tags.dns_managementConfigure global nameservers, search paths, split DNS, and MagicDNS settings.acl_managementGet, set, preview, validate, and test ACL policies.key_managementList, create, and revoke authentication keys.Environment Variables
TAILSCALE_API_KEYTailscale API key for authenticationTAILSCALE_TAILNETrequiredThe name of your tailnetTAILSCALE_OAUTH_CLIENT_IDOAuth client ID for authenticationTAILSCALE_OAUTH_CLIENT_SECRETOAuth client secret for authenticationConfiguration
{"mcpServers": {"tailscale": {"command": "node", "args": ["/path/to/mcp-tailscale/dist/index.js"], "env": {"TAILSCALE_API_KEY": "your-api-key-here", "TAILSCALE_TAILNET": "your-tailnet-name"}}}}