Skip to main content
Glama
Tailscale MCP Server

Tailscale MCP Server

by HexSleeves

Tailscale MCP Server

Сервер Model Context Protocol (ориентированный на Bun) для управления Tailscale через частный интерфейс с минимальными привилегиями.

Транспорт по умолчанию — stdio для локальных MCP-клиентов. Опциональный HTTP-транспорт по умолчанию привязывается к 127.0.0.1 и предназначен для частного доступа через Tailscale Serve или другой прокси-сервер внутри tailnet.

Установка

bun install
bun run build

Related MCP server: Consul MCP Server

Локальное использование MCP

{
  "mcpServers": {
    "tailscale": {
      "command": "bunx",
      "args": ["@hexsleeves/tailscale-mcp-server"],
      "env": {
        "TAILSCALE_OAUTH_CLIENT_ID": "your-client-id",
        "TAILSCALE_OAUTH_CLIENT_SECRET": "your-client-secret",
        "TAILSCALE_TAILNET": "-"
      }
    }
  }
}

OAuth-клиенты предпочтительнее для автоматизации, так как они используют ограниченный доступ и краткосрочные токены. API-ключи по-прежнему поддерживаются для обеспечения совместимости:

TAILSCALE_API_KEY=tskey-... bun run src/index.ts

HTTP-режим

HTTP-режим требует токен носителя (bearer token) и по умолчанию принимает только заголовки localhost или хоста tailnet.

export MCP_TRANSPORT=http
export MCP_HTTP_BEARER_TOKEN="$(openssl rand -base64 32)"
export TAILSCALE_OAUTH_CLIENT_ID="your-client-id"
export TAILSCALE_OAUTH_CLIENT_SECRET="your-client-secret"

bun run src/index.ts --http --port 3000 --host 127.0.0.1

Откройте доступ в частном порядке через Tailscale Serve:

tailscale serve --bg 443 localhost:3000

Не используйте Funnel для обычной работы MCP. Funnel делает сервис общедоступным, что требует отдельной проверки безопасности.

Конфигурация

Переменная

По умолчанию

Описание

MCP_TRANSPORT

stdio

stdio или http

MCP_HTTP_BIND_HOST

127.0.0.1

Хост для привязки HTTP

MCP_HTTP_PORT

3000

Порт для привязки HTTP

MCP_HTTP_BEARER_TOKEN

Обязательно в HTTP-режиме

MCP_ALLOWED_HOSTS

Дополнительные разрешенные HTTP-хосты через запятую

TAILSCALE_TAILNET

-

Имя tailnet или сокращение -

TAILSCALE_API_BASE_URL

https://api.tailscale.com

Базовый URL API Tailscale

TAILSCALE_OAUTH_CLIENT_ID

Предпочтительный метод аутентификации

TAILSCALE_OAUTH_CLIENT_SECRET

Предпочтительный метод аутентификации

TAILSCALE_API_KEY

Метод аутентификации для совместимости

TAILSCALE_ALLOWED_TOOL_RISK

read

read, write или admin

TAILSCALE_CLI_PATH

tailscale

Путь к локальному CLI

LOG_LEVEL

info

debug, info, warn или error

MCP_SERVER_LOG_FILE

Опциональный путь к файлу логов

Уровни риска:

  • read: инструменты и ресурсы только для чтения.

  • write: операции записи, такие как обновление ACL/DNS/маршрутов.

  • admin: деструктивные или влияющие на хост действия, такие как удаление, отзыв авторизации, подключение, отключение и изменение ключей аутентификации.

Инструменты

Стабильные имена инструментов:

  • list_devices

  • device_action

  • manage_routes

  • get_network_status

  • connect_network

  • disconnect_network

  • ping_peer

  • get_version

  • get_tailnet_info

  • manage_acl

  • manage_dns

  • manage_keys

  • manage_policy_file

  • manage_file_sharing

  • manage_exit_nodes

  • manage_webhooks

  • manage_device_tags

Ресурсы

  • tailscale://tailnet/summary

  • tailscale://devices

  • tailscale://devices/{deviceId}

  • tailscale://acl/current

Промпты

  • diagnose_tailnet_connectivity

  • review_acl_change

Разработка

bun install
bun test
bun run typecheck
bun run lint
bun run build

Полный локальный шлюз:

bun run qa

Docker

docker build -t tailscale-mcp-server .
docker run --rm \
  -e MCP_HTTP_BEARER_TOKEN="$MCP_HTTP_BEARER_TOKEN" \
  -e TAILSCALE_OAUTH_CLIENT_ID="$TAILSCALE_OAUTH_CLIENT_ID" \
  -e TAILSCALE_OAUTH_CLIENT_SECRET="$TAILSCALE_OAUTH_CLIENT_SECRET" \
  -p 127.0.0.1:3000:3000 \
  tailscale-mcp-server

Держите опубликованный порт привязанным к localhost и открывайте его для других устройств с помощью Tailscale Serve.

Для развертывания в виде sidecar-контейнера, который запускает MCP-сервер за частной конечной точкой Tailscale Serve, см. deploy/README.md.

Available Tools

18 tools
connect_networkC

Connect to the Tailscale network

Inputs: acceptDNS (required), acceptRoutes (required), advertiseRoutes, authKey, +2 more.

device_actionC

Perform actions on a specific device

Inputs: action (required), deviceId (required).

disconnect_networkB

Disconnect from the Tailscale network

Inputs: no named parameters.

get_network_statusC

Get current network status from Tailscale CLI

Inputs: format (required).

get_tailnet_infoC

Get detailed Tailscale network information

Inputs: includeDetails (required).

get_versionB

Get Tailscale version information

Inputs: no named parameters.

list_devicesC

List all devices in the Tailscale network

Inputs: includeRoutes (required).

manage_aclC

Manage Tailscale Access Control Lists (ACLs)

Inputs: operation (required), aclConfig.

manage_device_tagsC

Manage device tags for organization and ACL targeting

Inputs: deviceId (required), operation (required), tags.

manage_dnsC

Manage Tailscale DNS configuration

Inputs: operation (required), magicDNS, nameservers, searchPaths.

manage_exit_nodesC

Manage Tailscale exit nodes and routing

Inputs: operation (required), routes (required), deviceId.

manage_file_sharingC

Manage Tailscale file sharing settings

Inputs: operation (required), deviceId.

manage_keysC

Manage Tailscale authentication keys

Inputs: operation (required), keyConfig, keyId.

manage_network_lockC

Manage Tailscale network lock (key authority) for enhanced security

Inputs: operation (required), keyId, publicKey.

manage_policy_fileC

Manage policy files and test ACL access rules

Inputs: operation (required), policy, testRequest.

manage_routesC

Enable or disable routes for a device

Inputs: action (required), deviceId (required), routes (required).

manage_webhooksC

Manage Tailscale webhooks for event notifications

Inputs: operation (required), config, webhookId.

ping_peerC

Ping a peer device

Inputs: count (required), target (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 18 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose targeting specific Tailscale functions like network connectivity, device management, ACLs, DNS, and security features. There is no overlap or ambiguity between tools, as each handles a unique aspect of the Tailscale ecosystem.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., connect_network, list_devices, manage_acl), with verbs like 'connect', 'get', 'list', 'manage', and 'ping' applied uniformly. This predictable naming makes it easy for agents to understand and select tools.

    Tool Count4/5

    With 18 tools, the count is slightly high but reasonable for a comprehensive Tailscale management server covering network status, devices, ACLs, DNS, security, and more. It feels well-scoped without being excessive, though it borders on the heavier side for typical MCP servers.

    Completeness5/5

    The tool set provides complete coverage for Tailscale management, including core operations like network connectivity, device listing and actions, ACL and policy management, DNS configuration, security features, and utilities like pinging. There are no obvious gaps, supporting full lifecycle management of the domain.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    Appeared in Searches