Skip to main content
Glama
Tailscale MCP Server

Tailscale MCP Server

by HexSleeves

Tailscale MCPサーバー

プライベートかつ最小権限のインターフェースを通じてTailscaleを操作するための、BunベースのModel Context Protocolサーバーです。

デフォルトのトランスポートはローカルMCPクライアント用の stdio です。オプションのHTTPトランスポートはデフォルトで 127.0.0.1 にバインドされ、Tailscale Serveやその他のテールネット専用プロキシを使用してプライベートに公開するように設計されています。

インストール

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モードではベアラートークンが必要であり、デフォルトではlocalhostまたはテールネットのホストヘッダーのみを受け入れます。

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

通常のMCP操作にFunnelを使用しないでください。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

-

テールネット名または - の省略形

TAILSCALE_API_BASE_URL

https://api.tailscale.com

Tailscale APIベースURL

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を使用して他のデバイスに公開してください。

プライベートなTailscale Serveエンドポイントの背後でMCPサーバーを実行するサイドカーデプロイメントについては、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