tailscale
An MCP (Model Context Protocol) server for managing Tailscale resources
claude mcp add --transport stdio pnocera-tailscale-mcp-server docker run --rm -i -e TAILSCALE_API_KEY=tskey-api-... -e TAILSCALE_TAILNET=your-tailnet tailscale-mcp-server:latest \ --env TAILSCALE_API_KEY="API key for authenticating with Tailscale API (required if using API key auth)." \ --env TAILSCALE_TAILNET="Tailnet name (optional if defaults apply)."
How to use
This MCP server provides a comprehensive interface for managing Tailscale resources through the MCP protocol. It exposes 42 tools organized into logical categories: Device Management, Key Management, User Management, DNS Management, and Advanced Features. Each tool corresponds to a specific Tailscale API operation, such as listing devices, creating authentication keys, updating ACL policies, configuring DNS settings, and managing webhooks and posture integrations. You can invoke these tools via an MCP client by selecting the desired tool under the tailscale server and passing the required parameters. The server supports both API key and OAuth-based authentication, so choose the method that best fits your environment and security requirements. When integrating with clients (such as Claude Code or generic MCP clients), you can point the client to the tailscale MCP server and provide environment credentials through either Docker environment variables or a local binary deployment as demonstrated in the configuration examples.
How to install
Prerequisites: a valid Tailscale account with API access, and either an API key or OAuth client credentials. Choose a deployment method: Docker (recommended), Binary (Go 1.24+), or Source.
Docker (Recommended):
- Ensure Docker is installed.
- Pull and run the image with your credentials:
# Using API key authentication
docker run -d \
--name tailscale-mcp-server \
--restart unless-stopped \
-e TAILSCALE_API_KEY="tskey-api-..." \
-e TAILSCALE_TAILNET="your-tailnet" \
tailscale-mcp-server:latest
# Using OAuth authentication
docker run -d \
--name tailscale-mcp-server \
--restart unless-stopped \
-e TAILSCALE_CLIENT_ID="your-client-id" \
-e TAILSCALE_CLIENT_SECRET="your-client-secret" \
-e TAILSCALE_TAILNET="your-tailnet" \
tailscale-mcp-server:latest
Docker Compose (Recommended):
- Clone the repository and navigate to the mcp directory.
git clone <repository-url>
cd mcp
- Create and configure a .env file with your credentials (refer to .env.example).
- Start the server with Docker Compose:
docker-compose up -d
docker-compose logs -f
Building locally from source:
# Build the binary
go mod tidy
go build -o tailscale-mcp-server ./cmd
Binary installation (Go install):
go install github.com/pnocera/tailscale-mcp-server/cmd@latest
Note: Ensure you expose the appropriate environment variables and maintain secure handling of API keys or OAuth credentials.
Additional notes
Environment variables can be provided either via Docker envs or a local .env file. If both API key and OAuth credentials are present, OAuth will be used. The server supports both API key and OAuth authentication methods for flexibility. When using Docker, you may want to opt for docker-compose to manage environment files and startup/shutdown. If you encounter connectivity issues, verify that the Tailscale tailnet name matches between your credentials and the server configuration, and ensure the API key or OAuth scope includes the required permissions for device, user, DNS, and policy operations. For debugging, consult the MCP client logs (e.g., docker-compose logs or container logs) to inspect tool invocations and any API errors returned by Tailscale.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go