Tailscale MCP Server B4c1b52a

MCP运维云端

提供方 pnocera

运维云端 stdio · 本地进程 OAuth 授权 官方维护 Claude
查看接入方式

一个基于Tailscale Go客户端库v2的MCP服务器,提供完整的Tailscale API覆盖,并通过OpenAPI文档增强自描述工具。适用于企业网络设备、用户和密钥的集中管理。

一句话选型结论

按资料字段整理

Tailscale MCP Server B4c1b52a 属于运维云端类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Claude,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类运维云端 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 2 仓库热度,无公开仓库时显示未标注
工具数 42 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 官方维护 核验等级 仅资料核对

工具与能力

运维云端
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量42暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

网络管理Go本地部署设备管理用户管理密钥管理DNS配置ACL策略

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
docker run -d \

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Docker,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 42 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
云资源查询

查实例、存储、账单等云上资源状态。

部署与发布

把部署、重启、回滚这类操作接进对话。

监控与告警

拉取监控指标,异常时让模型帮你判断。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 42 个工具,覆盖面较广,能满足多种调用。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 已经在用 Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Tailscale MCP Server B4c1b52a当前 42 stdio · 本地进程 本地部署 有 2026-05-17
lobehub 未标注 stdio · 本地进程 本地部署 有 2026-04-11
TrendRadar 未标注 stdio · 本地进程 本地部署 有 2026-04-13
Ui Tars Desktop 8a825770 未标注 stdio · 本地进程 本地部署 有 2026-05-17
ruflo 未标注 stdio · 本地进程 本地部署 有 2026-04-13
FastGPT 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

运维云端
字段来自项目仓库与公开索引,中文说明由本站标注
提供方pnocera上游标注的维护方 pnocera
分类运维云端本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方官方维护核验等级 仅资料核对
包名 / 运行时未标注 · Docker本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

18.3 KB
来自项目仓库与上游目录的原文,未做删改

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```bash

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)

1. Clone the repository:```bash
git clone <repository-url>
cd mcp
  1. Create environment file:```bash

Copy example environment file

cp .env.example .env

Edit with your credentials

vim .env


3. Start the server:```bash
# Build and start
docker-compose up -d

# View logs
docker-compose logs -f

# Stop the server
docker-compose down

Building Docker Image Locally```bash

Build the image

docker build -t tailscale-mcp-server:local .

Run with local image

docker run -d \
--name tailscale-mcp-server \
-e TAILSCALE_API_KEY="tskey-api-..." \
tailscale-mcp-server:local


### Build from Source

1. Clone the repository and navigate to the MCP directory:```bash
git clone <repository-url>
cd mcp
  1. Install dependencies:```bash
    go mod tidy

3. Build the server:```bash
go build -o tailscale-mcp-server ./cmd

Binary Installation```bash

Download and install directly

go install github.com/pnocera/tailscale-mcp-server/cmd@latest


## ⚙️ Configuration

The server supports both API key and OAuth authentication methods for maximum flexibility.

### Environment Variables

#### API Key Authentication (Recommended for personal use)```bash
export TAILSCALE_API_KEY="tskey-api-..."
export TAILSCALE_TAILNET="your-tailnet-name"  # Optional, defaults to "-"

OAuth Authentication (Recommended for applications)```bash

export TAILSCALE_CLIENT_ID="your-oauth-client-id"
export TAILSCALE_CLIENT_SECRET="your-oauth-client-secret"
export TAILSCALE_TAILNET="your-tailnet-name" # Optional, defaults to "-"


### Authentication Priority
1. If both `TAILSCALE_CLIENT_ID` and `TAILSCALE_CLIENT_SECRET` are set, OAuth is used
2. Otherwise, API key authentication is used with `TAILSCALE_API_KEY`

## 🚀 Usage

### Running the Server```bash
# Using API key authentication
TAILSCALE_API_KEY="tskey-api-..." ./tailscale-mcp-server

# Using OAuth authentication
TAILSCALE_CLIENT_ID="..." TAILSCALE_CLIENT_SECRET="..." ./tailscale-mcp-server

# With custom tailnet
TAILSCALE_API_KEY="tskey-api-..." TAILSCALE_TAILNET="mycompany.com" ./tailscale-mcp-server

MCP Client Integration

Claude Code Integration

With Docker:```bash

Add Docker container to Claude Code

claude mcp add tailscale docker run --rm -i \
-e TAILSCALE_API_KEY="tskey-api-..." \
tailscale-mcp-server:latest


**With Binary:**```bash
# Add binary to Claude Code
claude mcp add tailscale /path/to/tailscale-mcp-server

Generic MCP Client Configuration

With Docker:```json
{
"mcpServers": {
"tailscale": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-e", "TAILSCALE_API_KEY=tskey-api-...",
"-e", "TAILSCALE_TAILNET=your-tailnet",
"tailscale-mcp-server:latest"
]
}
}
}


**With Binary:**```json
{
  "mcpServers": {
    "tailscale": {
      "command": "/path/to/tailscale-mcp-server",
      "env": {
        "TAILSCALE_API_KEY": "tskey-api-...",
        "TAILSCALE_TAILNET": "your-tailnet"
      }
    }
  }
}

🚀 Quick Deployment Scripts

Instant Setup:```bash

Bash/Linux/macOS - Quick run with environment validation

./scripts/quick-run.sh

PowerShell/Windows - Quick run with environment validation

.\scripts\quick-run.ps1

Custom image

./scripts/quick-run.sh ghcr.io/myuser/tailscale-mcp-server:v1.0.0


**Registry Publishing:**```bash
# Bash - Build and push to registry
./scripts/build-and-push.sh
./scripts/build-and-push.sh ghcr.io/myuser v1.0.0
./scripts/build-and-push.sh docker.io/myuser latest linux/amd64

# PowerShell - Build and push to registry
.\scripts\build-and-push.ps1
.\scripts\build-and-push.ps1 -Registry "ghcr.io/myuser" -Tag "v1.0.0"
.\scripts\build-and-push.ps1 -Registry "docker.io/myuser" -Platform "linux/amd64"

Docker Container Management```bash

Check container status

docker ps | grep tailscale-mcp-server

View container logs

docker logs tailscale-mcp-server

Restart container

docker restart tailscale-mcp-server

Update to latest image

docker pull tailscale-mcp-server:latest
docker stop tailscale-mcp-server
docker rm tailscale-mcp-server

Then run with new image


## 📚 Tool Examples

### Device Management```json
// List all devices with detailed information
{
  "name": "tailscale_devices_list",
  "arguments": {
    "fields": "all"
  }
}

// Get specific device details
{
  "name": "tailscale_device_get",
  "arguments": {
    "device_id": "device-id-here",
    "fields": "all"
  }
}

// Authorize a device
{
  "name": "tailscale_device_authorize",
  "arguments": {
    "device_id": "device-id-here",
    "authorized": true
  }
}

// Set device tags for ACL-based access control
{
  "name": "tailscale_device_set_tags",
  "arguments": {
    "device_id": "device-id-here",
    "tags": ["tag:server", "tag:production"]
  }
}

Key Management```json

// Create a reusable, preauthorized key with tags
{
"name": "tailscale_key_create",
"arguments": {
"reusable": true,
"ephemeral": false,
"preauthorized": true,
"description": "CI/CD deployment key",
"tags": ["tag:ci", "tag:automated"],
"expiry_seconds": 86400
}
}

// List all authentication keys
{
"name": "tailscale_keys_list",
"arguments": {}
}


### DNS Configuration```json
// Set custom DNS nameservers
{
  "name": "tailscale_dns_nameservers_set",
  "arguments": {
    "nameservers": ["8.8.8.8", "8.8.4.4", "1.1.1.1"]
  }
}

// Enable MagicDNS for easy device connectivity
{
  "name": "tailscale_dns_preferences_set",
  "arguments": {
    "magic_dns": true
  }
}

// Set DNS search paths for short hostnames
{
  "name": "tailscale_dns_searchpaths_set",
  "arguments": {
    "search_paths": ["company.com", "internal.local"]
  }
}

Policy Management```json

// Get current ACL policy
{
"name": "tailscale_policy_get",
"arguments": {}
}

// Validate policy before applying
{
"name": "tailscale_policy_validate",
"arguments": {
"policy": "{\n \"acls\": [\n {\n \"action\": \"accept\",\n \"src\": [\"tag:server\"],\n \"dst\": [\"tag:database:5432\"]\n }\n ]\n}"
}
}

// Update ACL policy
{
"name": "tailscale_policy_set",
"arguments": {
"policy": "{\n \"acls\": [\n {\n \"action\": \"accept\",\n \"src\": [\"\"],\n \"dst\": [\":*\"]\n }\n ]\n}"
}
}


### Webhooks & Integrations```json
// Create webhook for device events
{
  "name": "tailscale_webhook_create",
  "arguments": {
    "endpoint_url": "https://your-app.com/webhook",
    "subscriptions": ["device.created", "device.deleted", "user.approved"]
  }
}

// Create device posture integration
{
  "name": "tailscale_device_posture_integration_create",
  "arguments": {
    "provider": "crowdstrike",
    "client_id": "your-client-id",
    "client_secret": "your-client-secret",
    "tenant_id": "your-tenant-id"
  }
}

🏗️ Architecture

The server follows a clean, modular architecture:```
├── cmd/
│ └── main.go # Entry point and server setup
├── internal/
│ ├── config/ # Configuration management
│ ├── client/ # Tailscale client wrapper
│ └── handlers/ # MCP request handlers
├── pkg/
│ └── tools/ # Tool implementations
│ ├── devices.go # Device management (9 tools)
│ ├── keys.go # Key management (4 tools)
│ ├── users.go # User & contact management (8 tools)
│ ├── dns.go # DNS & policy management (9 tools)
│ └── additional.go # Advanced features (12 tools)
├── tailscale_api_docs/ # OpenAPI documentation
├── .gitignore # Git ignore rules
├── LICENSE.md # MIT License
└── README.md # This file


### 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 management
- `keys:read` / `keys:write` - Authentication key management
- `users:read` / `users:write` - User management
- `dns:read` / `dns:write` - DNS configuration
- `acl:read` / `acl:write` - ACL policy management
- `webhooks:read` / `webhooks:write` - Webhook management
- `logging:read` - Log configuration access
- `posture:read` / `posture:write` - Device posture management
- `settings: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

1. **Identify the OpenAPI endpoint** in `tailscale_api_docs/tailscaleapi.yaml`
2. **Choose the appropriate file** in `pkg/tools/` based on functionality
3. **Add the tool definition** in the `RegisterTools` method:```go
tool := mcp.NewTool(
    "tailscale_new_tool",
    mcp.WithDescription("Detailed description with OAuth scope and use cases"),
    mcp.WithString("param", mcp.Description("Parameter description"), mcp.Required()),
)
mcpServer.AddTool(tool, dt.NewToolHandler)
  1. Implement the handler function following existing patterns
  2. 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```bash

Run all tests

go test ./...

Run tests with race detection

go test -race ./...

Run tests with coverage

go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out


### Building for Different Platforms

#### Using Go Build```bash
# Linux
GOOS=linux GOARCH=amd64 go build -o tailscale-mcp-server-linux ./cmd

# macOS
GOOS=darwin GOARCH=amd64 go build -o tailscale-mcp-server-macos ./cmd

# Windows
GOOS=windows GOARCH=amd64 go build -o tailscale-mcp-server.exe ./cmd

Using Docker Multi-Platform Build```bash

Build for multiple architectures

docker buildx create --use
docker buildx build --platform linux/amd64,linux/arm64 \
-t tailscale-mcp-server:latest --push .

Build for specific platform

docker build --platform linux/amd64 -t tailscale-mcp-server:amd64 .
docker build --platform linux/arm64 -t tailscale-mcp-server:arm64 .


## 📊 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```bash
# View real-time logs
docker logs -f tailscale-mcp-server

# Check health status
docker inspect --format='{{.State.Health.Status}}' tailscale-mcp-server

# Monitor resource usage
docker stats tailscale-mcp-server

🔗 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

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/new-tool
  3. Implement your changes with tests
  4. Run the test suite: go test ./...
  5. Update documentation as needed
  6. 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.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Tailscale MCP Server B4c1b52a 怎么安装?

在客户端按下面的安装命令接入:docker run -d \。装完在客户端配置里引用同一个包或端点。

Tailscale MCP Server B4c1b52a 怎么在 Claude 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Tailscale MCP Server B4c1b52a 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Tailscale MCP Server B4c1b52a 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

Tailscale MCP Server B4c1b52a 支持哪些客户端?

资料标注支持 Claude;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Tailscale MCP Server B4c1b52a 能提供哪些能力?

资料显示约 42 个工具;能力标签包括 网络管理、密钥管理、Go、Claude、设备管理。具体工具清单以官方文档为准。

Tailscale MCP Server B4c1b52a 需要什么运行环境?

运行时为 Docker;属于本地进程,需要在本机装好运行环境。

Tailscale MCP Server B4c1b52a 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。