Connector guide12-minute read46 MCP tools7 languages

How to Connect Tailscale to Claude via MCP

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.

HCBy HelpCode teamUpdated 12 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

Tailscale

Tailscale

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview, replace), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client.

tools

46

Region

INTL

Category

Infrastructure

Authentication

OAuth 2.0

Required env vars

TAILSCALE_OAUTH_CLIENT_IDTAILSCALE_OAUTH_CLIENT_SECRET
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the Tailscale in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

AnythingMCP is listed in Claude's connector directory: add it to Claude in one click (opens in a new tab), then sign in and choose which MCP servers Claude may use.

Summary

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.

Try asking

Example prompts for Tailscale

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

Tailscale · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → Tailscale, paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

Tailscale + Claude

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.

Prerequisites

See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:

TAILSCALE_OAUTH_CLIENT_ID, TAILSCALE_OAUTH_CLIENT_SECRET

Step 1 — Get credentials

Setting up takes about 5 minutes and needs a tailnet user with the Owner, Admin, Network admin or IT admin role. The connector signs in with a Tailscale OAuth client (OAuth2 client credentials): there is no browser sign-in and no user account behind it.

  1. Open https://login.tailscale.com/admin/settings/trust-credentials (Settings, Trust credentials; older consoles: Settings, OAuth clients) and click Credential, then OAuth.
  2. Pick the scopes. For reading only, all:read is enough. For the write tools add the matching write scopes: devices:core (needs one or more tags, for example tag:server), devices:routes, users, auth_keys (also needs tags), policy_file, dns, feature_settings, webhooks. all grants everything.
  3. Copy the Client ID (for example kAbCdEf1CNTRL) into TAILSCALE_OAUTH_CLIENT_ID and the Client secret (tskey-client-..., shown once) into TAILSCALE_OAUTH_CLIENT_SECRET. An API access token (tskey-api-...) does not work here.
  4. Install the connector and run tailscale_list_devices: it lists the machines of the tailnet and confirms the client.

The connector exchanges the client for a one-hour access token at https://api.tailscale.com/api/v2/oauth/token and renews it by itself. Unlike API access tokens, which last at most 90 days, an OAuth client does not expire. Every call goes to the tailnet that owns the client (- in the path). A write the client has no scope for answers 403.

Secrets in answers: the AI sees whatever a tool returns. tailscale_create_auth_key returns a new auth key (tskey-auth-...) and tailscale_create_webhook a webhook signing secret, each shown only this once; both end up in the conversation and with the AI provider. The AI hands them only to the person who asked, never to other tools, files or messages. tailscale_list_user_invites shows invite links that let anyone who has them join. tailscale_list_keys and tailscale_get_key never return key values, and tailscale_list_webhooks, tailscale_get_webhook and tailscale_get_log_streaming_configuration have signing secrets, tokens and cloud credentials removed.

Devices: tailscale_list_devices with filter (for example hostname=web-1, tags=tag:prod, authorized=false) and fields=all for routes and connectivity; tailscale_get_device, tailscale_get_device_routes and tailscale_get_device_posture_attributes. Changes: tailscale_authorize_device (device approval, or taking it back), tailscale_set_device_routes (approve subnet routes and exit nodes), tailscale_set_device_tags, tailscale_set_device_name (the new name becomes the MagicDNS name at once) and tailscale_set_device_key_expiry (key expiry off, for servers rather than laptops).

Users: tailscale_list_users by role or type, tailscale_get_user, tailscale_list_user_invites; tailscale_update_user_role, tailscale_approve_user, and tailscale_suspend_user and tailscale_restore_user (a suspension is undone by restoring).

Keys: tailscale_list_keys (all=true adds auth keys and API access tokens), tailscale_get_key, and tailscale_create_auth_key to add servers, containers or CI runners: reusable or single-use, ephemeral, preauthorized, valid for at most 90 days. With this connector's OAuth client the key must carry tags, the client's own or tags owned by them.

Access rules: tailscale_get_policy_file reads the policy file (grants and acls, groups, hosts, tagOwners, autoApprovers, ssh, nodeAttrs, postures, tests) with its etag. tailscale_preview_policy_rules shows which rules hit a user or an IP:port, and tailscale_validate_policy_file checks a draft and runs its tests; both change nothing.

DNS and settings: tailscale_get_dns_configuration shows nameservers, split DNS, search paths and MagicDNS in one call. Changes go through tailscale_set_dns_nameservers, tailscale_set_dns_preferences (MagicDNS on or off; on needs a global nameserver), tailscale_set_dns_search_paths and tailscale_update_split_dns (only the domains you pass change). tailscale_get_tailnet_settings and tailscale_update_tailnet_settings cover device and user approval, key expiry, auto-updates, network flow logging, HTTPS certificates and more; tailscale_get_contacts shows the account, support and security contacts.

Logs and integrations: tailscale_list_configuration_audit_logs (who changed what, kept for 90 days, filtered by actor, target or event), tailscale_list_network_flow_logs (traffic between devices, on Premium and Enterprise plans with flow logging on; the AI asks for minutes, not days, because answers grow fast), tailscale_get_log_streaming_status and tailscale_get_log_streaming_configuration for SIEM streaming, webhooks (tailscale_list_webhooks, tailscale_get_webhook, tailscale_create_webhook), Tailscale Services (tailscale_list_services, tailscale_get_service, tailscale_list_service_hosts) and posture integrations (tailscale_list_posture_integrations).

Changes replace lists: routes, tags, nameservers and search paths are sent as the complete list. The AI reads the current value first and sends the old entries plus the new one; a route left out is disabled.

Switched off at install: tailscale_expire_device_key, tailscale_delete_device, tailscale_delete_user and tailscale_delete_key, because they cannot be undone, and tailscale_set_policy_file, because it replaces the whole access policy of the tailnet in one call and a wrong rule cuts users and devices off. A workspace admin turns them on deliberately when the team needs them.

Data formats: the device nodeId (for example nAbCdEf1CNTRL) is the preferred device id; the numeric id works too. name is the MagicDNS name (web-1.tailnet-name.ts.net), addresses are the Tailscale IPs (100.x.y.z and fd7a:115c:a1e0::/48). Times are RFC 3339 in UTC; lastSeen is empty while a device is connected (connectedToControl: true). An expires of 0001-01-01 means key expiry is off. Tags look like tag:name.

Paging: lists come in one answer, without paging. The log tools take a start and end time instead.

Common errors: 401 means the OAuth client was deleted or the secret is wrong. 403 means the client lacks the scope or the tags for this call, or the plan lacks the feature. 404 means the id does not exist in this tailnet. 400 comes with a message for invalid input, including policy files whose tests fail. 412 means the policy changed since your etag. 429 means rate limited: wait a minute and retry.

The connector does not create OAuth clients or API access tokens, does not advertise routes or sign devices in (that happens on the device), and with the tools switched on at install it does not delete devices, users or keys and does not replace the policy file.

Step 2 — Install the adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Step 3 — Add the connector in Claude

Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide shows YOUR_SERVER_ID.

Recommended path: works on claude.ai web without editing any config file.

  1. In Claude, open Customize → Connectors.
  2. Click +, then Add custom connector.
  3. Enter a name, e.g. Tailscale, and the remote MCP server URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID, then click Add.
  4. Click Connect and sign in to AnythingMCP (OAuth) to allow access.

All tools below appear in your chat: start typing prompts.

Available tools

ToolWhat it does
tailscale_list_devicesList the devices (machines) of the tailnet: nodeId, numeric id, name (MagicDNS name), hostname, user, OS, client version, Tailscale IP…
tailscale_get_deviceOne device with its details: name, hostname, user, OS, addresses, tags, authorized, key expiry, lastSeen, connectedToControl and, with…
tailscale_get_device_routesThe subnet routes a device advertises (advertisedRoutes) and the ones that are approved for it (enabledRoutes)
tailscale_set_device_routesReplace the list of approved (enabled) subnet routes of a device
tailscale_authorize_deviceApprove a device that waits for device approval (authorized=true), or take the approval back (authorized=false), which cuts it off from the…
tailscale_set_device_nameRename a device: the new name becomes its MagicDNS name at once, so links and scripts that use the old name stop working
tailscale_set_device_tagsReplace the tags of a device
tailscale_set_device_key_expirySwitch key expiry off (key_expiry_disabled=true) or back on for a device
tailscale_expire_device_keyExpire the node key of a device now
tailscale_delete_deviceRemove a device from the tailnet
tailscale_get_device_posture_attributesThe posture attributes of a device as key-value pairs: those Tailscale collects (node:os, node:tsVersion, ...), those from posture…
tailscale_list_usersList the users of the tailnet: id, displayName, loginName (e-mail), role, status (active, idle, suspended, needs-approval…
tailscale_get_userOne user: displayName, loginName, role, status, type, created, lastSeen, deviceCount
tailscale_update_user_roleChange the role of a user
tailscale_approve_userApprove a user whose status is needs-approval (when user approval is on in the tailnet settings)
tailscale_suspend_userSuspend a user: their devices lose access to the tailnet until the user is restored with tailscale_restore_user
tailscale_restore_userRestore a suspended user, giving their devices access to the tailnet again
tailscale_delete_userDelete a user from the tailnet, together with their devices
tailscale_list_user_invitesOpen (not yet accepted) invitations to join the tailnet: id, e-mail, role, inviter and when the e-mail was last sent. inviteUrl lets…
tailscale_list_keysList the keys of the tailnet: auth keys, API access tokens, OAuth clients and federated identities, with id, keyType, description, created…
tailscale_get_keyOne key by id: keyType, description, created, expires, revoked, invalid, capabilities (reusable, ephemeral, preauthorized, tags for auth…
tailscale_create_auth_keyCreate an auth key to add devices to the tailnet
tailscale_delete_keyRevoke a key by id: an auth key, an API access token or a trust credential
tailscale_get_policy_fileThe tailnet policy file (access rules) as JSON: grants and acls, groups, hosts, tagOwners, autoApprovers, ssh, nodeAttrs, postures and…
tailscale_validate_policy_fileCheck a policy file without saving it: Tailscale parses it and runs its tests (and sshTests)
tailscale_preview_policy_rulesWhich rules of a policy file would apply to one user or one IP:port, without saving it
tailscale_set_policy_fileReplace the whole tailnet policy file
tailscale_get_dns_configurationThe full DNS setup of the tailnet in one call: global nameservers, split DNS routes (domain to nameservers), search paths and preferences…
tailscale_set_dns_nameserversReplace the global DNS nameservers of the tailnet
tailscale_set_dns_preferencesSwitch MagicDNS on or off for the tailnet
tailscale_set_dns_search_pathsReplace the DNS search domains of the tailnet
tailscale_update_split_dnsChange split DNS for some domains: only the domains you pass are changed, the others stay
tailscale_get_tailnet_settingsThe tailnet settings: device approval, device auto-updates, key expiry in days, user approval, who may join external tailnets, network flow…
tailscale_update_tailnet_settingsChange one or more tailnet settings; fields you leave out keep their value
tailscale_get_contactsThe account, support and security contact e-mails of the tailnet, each with its fallback and whether it still needs verification
tailscale_list_configuration_audit_logsConfiguration audit log: who changed what in the tailnet (devices, users, keys, policy file, DNS, settings) between start and end, in time…
tailscale_list_network_flow_logsNetwork flow logs between start and end: which devices talked to which addresses and ports, with packet and byte counts per sample period…
tailscale_get_log_streaming_statusWhether streaming of a log type to a SIEM works: last activity, last error, bytes and entries sent, rate
tailscale_get_log_streaming_configurationWhere a log type is streamed: destination type (splunk, elastic, datadog, s3, ...), URL, upload period, compression, S3 bucket and region
tailscale_list_webhooksThe webhook endpoints of the tailnet: endpointId, URL, provider type, the events they receive and who created them
tailscale_get_webhookOne webhook endpoint by id: URL, provider type, subscribed events, creator, created and lastModified
tailscale_create_webhookCreate a webhook that sends tailnet events to a URL
tailscale_list_servicesTailscale Services of the tailnet (virtual services hosted by one or more devices): name (svc:...), addresses, ports, tags and comment
tailscale_get_serviceOne Tailscale Service by name: its addresses, ports, tags and comment
tailscale_list_service_hostsThe devices that host a Tailscale Service, with whether each one is approved to serve it
tailscale_list_posture_integrationsThe device posture integrations of the tailnet (CrowdStrike Falcon, Intune, Jamf Pro, Kandji, Kolide, SentinelOne): provider, cloud id…

Example prompts

  • "Which devices have not been seen for more than 30 days? Show name, user and last seen."
  • "Which subnet routes does router-1 advertise, and which of them are not approved yet?"
  • "Create a reusable, preauthorized auth key with the tag tag:ci that expires in 7 days."
  • "Who changed the policy file or the DNS settings during the last week?"
  • "Which rules of our policy file apply to [email protected]?"

FAQ

Does it work with Claude Code as well as Claude Desktop? Yes, point both at https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID.

Next steps

Was this guide helpful?

Your Tailscale agent is one click away.

Install the connector, paste the key, prompt Claude. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect Tailscale to ChatGPT via MCP

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.

Connectors

How to Connect Tailscale to Cursor via MCP

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.

Connectors

How to Connect Tailscale to Gemini via MCP

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.

Connectors

How to Connect Tailscale to Meta Muse via MCP

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.

Connectors

Tailscale to MCP: Devices, Users, Auth Keys, Access Policy, DNS and Audit Logs in any AI Agent

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.

Connectors

How to Connect Tailscale to Microsoft Copilot via MCP

Tailscale tailnet administration through the API v2: devices with routes, tags, approval and posture attributes, users and roles, auth keys, the policy file (read, validate, preview), DNS and MagicDNS, tailnet settings, configuration audit logs and network flow logs, log streaming, webhooks, Services and posture integrations. Signs in with an OAuth client, no browser sign-in.