Supports deployment and management of the MCP server through Docker containers, with features for multi-architecture builds, security configurations, and performance monitoring.
Enables repository cloning and source code management for deploying and working with the MCP server codebase.
Provides comprehensive tools for managing Tailscale networks, including device management, key management, DNS configuration, user management, ACL policy management, webhooks, and device posture integrations through the official Tailscale API.
Tailscale MCP Server
An MCP (Model Context Protocol) server for managing Tailscale resources using the official Tailscale Go client library v2. This server provides complete coverage of the Tailscale API with enhanced, self-descriptive tools powered by OpenAPI documentation.
🚀 Features
This MCP server provides 42 comprehensive tools organized into logical categories, each with detailed descriptions, OAuth scopes, use cases, and security considerations:
🖥️ Device Management (9 tools)
tailscale_devices_list - List all devices with optional detailed fields
tailscale_device_get - Get comprehensive device information
tailscale_device_delete - Permanently remove devices from tailnet
tailscale_device_authorize - Authorize/deauthorize devices for access control
tailscale_device_set_name - Set device names (affects Magic DNS)
tailscale_device_set_tags - Assign tags for ACL-based access control
tailscale_device_expire - Force device re-authentication
tailscale_device_routes_list - List subnet routes and exit node configuration
tailscale_device_routes_set - Configure subnet routing and exit nodes
🔐 Key Management (4 tools)
tailscale_keys_list - List all authentication keys with capabilities
tailscale_key_get - Get detailed key information and usage statistics
tailscale_key_create - Create reusable, ephemeral, or preauthorized keys
tailscale_key_delete - Revoke authentication keys
👥 User Management (8 tools)
tailscale_users_list - List all users with roles and status
tailscale_user_get - Get detailed user profile information
tailscale_user_approve - Approve users for tailnet access
tailscale_user_suspend - Temporarily suspend user access
tailscale_user_restore - Restore suspended users
tailscale_user_delete - Permanently remove users
tailscale_contacts_get - Get tailnet contact preferences
tailscale_contact_update - Update contact information for notifications
🌐 DNS Management (9 tools)
tailscale_dns_nameservers_get - Get configured DNS nameservers
tailscale_dns_nameservers_set - Set custom DNS nameservers
tailscale_dns_preferences_get - Get MagicDNS and DNS preferences
tailscale_dns_preferences_set - Configure MagicDNS and DNS behavior
tailscale_dns_searchpaths_get - Get DNS search domain suffixes
tailscale_dns_searchpaths_set - Set DNS search paths for short names
tailscale_policy_get - Get current ACL policy file (HuJSON)
tailscale_policy_set - Update ACL policy with security rules
tailscale_policy_validate - Validate policy files before deployment
🔗 Advanced Features (12 tools)
tailscale_webhooks_list - List webhook endpoints for event notifications
tailscale_webhook_create - Create webhooks for external integrations
tailscale_webhook_get - Get webhook configuration and statistics
tailscale_webhook_delete - Remove webhook endpoints
tailscale_logging_configuration_get - Get audit log streaming configuration
tailscale_logging_network_get - Get network flow log configuration
tailscale_device_posture_integrations_list - List security posture integrations
tailscale_device_posture_integration_create - Create posture provider integrations
tailscale_device_posture_integration_get - Get posture integration details
tailscale_device_posture_integration_delete - Remove posture integrations
tailscale_tailnet_settings_get - Get comprehensive tailnet settings
tailscale_tailnet_settings_update - Update tailnet configuration
📦 Installation
Prerequisites
Valid Tailscale account with API access
Tailscale API key or OAuth client credentials
Choose one deployment method:
Docker (recommended) - Docker and Docker Compose
Binary - Go 1.24 or later
Source - Go 1.24 or later + Git
🐳 Docker Deployment (Recommended)
The easiest way to run the Tailscale MCP server is using Docker:
Quick Start with Docker
Docker Compose (Recommended)
Clone the repository:
Create environment file:
Start the server:
Building Docker Image Locally
Build from Source
Clone the repository and navigate to the MCP directory:
Install dependencies:
Build the server:
Binary Installation
⚙️ Configuration
The server supports both API key and OAuth authentication methods for maximum flexibility.
Environment Variables
API Key Authentication (Recommended for personal use)
OAuth Authentication (Recommended for applications)
Authentication Priority
If both
TAILSCALE_CLIENT_ID
andTAILSCALE_CLIENT_SECRET
are set, OAuth is usedOtherwise, API key authentication is used with
TAILSCALE_API_KEY
🚀 Usage
Running the Server
MCP Client Integration
Claude Code Integration
With Docker:
With Binary:
Generic MCP Client Configuration
With Docker:
With Binary:
🚀 Quick Deployment Scripts
Instant Setup:
Registry Publishing:
Docker Container Management
📚 Tool Examples
Device Management
Key Management
DNS Configuration
Policy Management
Webhooks & Integrations
🏗️ Architecture
The server follows a clean, modular architecture:
Key Design Principles
Modular: Each tool category is organized in separate files
Self-descriptive: Tools include comprehensive descriptions from OpenAPI docs
Type-safe: Full Go type safety with structured request/response handling
Error-resilient: Comprehensive error handling with informative messages
OAuth-ready: Support for both API key and OAuth authentication
🔐 Authentication & Security
OAuth Scopes
Each tool specifies the required OAuth scope in its description:
devices:read
/devices:write
- Device managementkeys:read
/keys:write
- Authentication key managementusers:read
/users:write
- User managementdns:read
/dns:write
- DNS configurationacl:read
/acl:write
- ACL policy managementwebhooks:read
/webhooks:write
- Webhook managementlogging:read
- Log configuration accessposture:read
/posture:write
- Device posture managementsettings:read
/settings:write
- Tailnet settings
Security Best Practices
Store API keys and OAuth credentials securely
Use environment variables for sensitive configuration
Implement proper access controls in your MCP client
Regularly rotate API keys and OAuth credentials
Monitor API usage through Tailscale admin console
🛠️ Development
Adding New Tools
Identify the OpenAPI endpoint in
tailscale_api_docs/tailscaleapi.yaml
Choose the appropriate file in
pkg/tools/
based on functionalityAdd the tool definition in the
RegisterTools
method:
Implement the handler function following existing patterns
Test thoroughly and update documentation
Enhanced Tool Descriptions
All tools include:
Detailed functionality description
OAuth scope requirements
Use cases and examples
Security considerations
Links to Tailscale documentation
Testing
Building for Different Platforms
Using Go Build
Using Docker Multi-Platform Build
📊 Monitoring & Observability
Built-in Logging
The server provides structured logging for:
Authentication attempts
API requests and responses
Error conditions
Performance metrics
Integration with Tailscale
Monitor API usage in the Tailscale admin console
Track OAuth token usage and refresh cycles
Review audit logs for security compliance
🐳 Docker Features
Security
Multi-stage build for minimal attack surface
Scratch base image (< 20MB final image)
Non-root user execution (UID 65534)
Read-only filesystem support
No new privileges security option
Dropped capabilities for enhanced security
Performance
Optimized binary with static linking
Resource limits (128MB RAM, 0.5 CPU by default)
Health checks for container monitoring
Graceful shutdown handling
Production Ready
Automatic restarts on failure
Structured logging to stdout/stderr
Environment-based configuration
Multi-architecture support (AMD64, ARM64)
Monitoring
🔗 Dependencies
tailscale.com/client/tailscale/v2 - Official Tailscale Go client library
github.com/mark3labs/mcp-go - MCP protocol implementation for Go
golang.org/x/oauth2 - OAuth 2.0 client library
Standard Go libraries - JSON, HTTP, context, logging
📄 License
This project is licensed under the MIT License. See LICENSE.md for details.
🤝 Contributing
Contributions are welcome! Please ensure all new tools include:
Complete input validation with proper error messages
Comprehensive error handling for all failure scenarios
Detailed descriptions following the OpenAPI documentation pattern
JSON response formatting consistent with existing tools
OAuth scope specifications in tool descriptions
Unit tests for core functionality
Documentation updates in this README
Development Workflow
Fork the repository
Create a feature branch:
git checkout -b feature/new-tool
Implement your changes with tests
Run the test suite:
go test ./...
Update documentation as needed
Submit a pull request with a clear description
📚 Resources
Tailscale API Documentation - Official API reference
MCP Protocol Specification - MCP protocol details
Tailscale Knowledge Base - Comprehensive guides and tutorials
Go Client Library Documentation - Official Go client docs
🆘 Support
Issues: Report bugs and request features on GitHub
Documentation: Refer to the Tailscale Knowledge Base
Community: Join the Tailscale community forums
Made with ❤️ for the Tailscale and MCP communities. This server provides the most comprehensive Tailscale MCP integration available, with self-descriptive tools powered by official OpenAPI documentation.
This server cannot be installed
An MCP (Model Context Protocol) server for managing Tailscale resources using the official Tailscale Go client library v2. This server provides complete coverage of the Tailscale API with enhanced, self-descriptive tools powered by OpenAPI documentation.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.Last updated -328136MIT License
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface. Updated to use Coin Cap API v3Last updated -3431MIT License
- -securityAlicense-qualityThe Model Context Protocol (MCP) server provides a conversational interface for the exploration and analysis of RDF Turtle Knowledge Graph in Local File mode or SPARQL Endpoint.Last updated -31MIT License
- -securityAlicense-qualityThis is a Model Context Protocol (MCP) server implemented in Go, providing a tool to analyze Go pprof performance profiles.Last updated -33MIT License