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.
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.
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 + Gemini
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.
- Open https://login.tailscale.com/admin/settings/trust-credentials (Settings, Trust credentials; older consoles: Settings, OAuth clients) and click Credential, then OAuth.
- Pick the scopes. For reading only,
all:readis enough. For the write tools add the matching write scopes:devices:core(needs one or more tags, for exampletag:server),devices:routes,users,auth_keys(also needs tags),policy_file,dns,feature_settings,webhooks.allgrants everything. - Copy the Client ID (for example
kAbCdEf1CNTRL) intoTAILSCALE_OAUTH_CLIENT_IDand the Client secret (tskey-client-..., shown once) intoTAILSCALE_OAUTH_CLIENT_SECRET. An API access token (tskey-api-...) does not work here. - 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 Gemini
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 showsYOUR_SERVER_ID.
Gemini CLI reads MCP servers from ~/.gemini/settings.json (on Windows %USERPROFILE%\.gemini\settings.json). Add:
{
"mcpServers": {
"anythingmcp": {
"httpUrl": "https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID",
"headers": { "X-API-Key": "YOUR_MCP_API_KEY" }
}
}
}
- Create an MCP API key in AnythingMCP under MCP Servers → your server → API keys, and paste it in place of
YOUR_MCP_API_KEY. - Save the file and restart
gemini. - Run
/mcpinside Gemini CLI (orgemini mcp listin your shell):anythingmcpshould show as connected. - Start prompting: Gemini CLI can now call the
Tailscaletools.
Available tools
| Tool | What it does |
|---|---|
tailscale_list_devices | List the devices (machines) of the tailnet: nodeId, numeric id, name (MagicDNS name), hostname, user, OS, client version, Tailscale IP… |
tailscale_get_device | One device with its details: name, hostname, user, OS, addresses, tags, authorized, key expiry, lastSeen, connectedToControl and, with… |
tailscale_get_device_routes | The subnet routes a device advertises (advertisedRoutes) and the ones that are approved for it (enabledRoutes) |
tailscale_set_device_routes | Replace the list of approved (enabled) subnet routes of a device |
tailscale_authorize_device | Approve 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_name | Rename 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_tags | Replace the tags of a device |
tailscale_set_device_key_expiry | Switch key expiry off (key_expiry_disabled=true) or back on for a device |
tailscale_expire_device_key | Expire the node key of a device now |
tailscale_delete_device | Remove a device from the tailnet |
tailscale_get_device_posture_attributes | The posture attributes of a device as key-value pairs: those Tailscale collects (node:os, node:tsVersion, ...), those from posture… |
tailscale_list_users | List the users of the tailnet: id, displayName, loginName (e-mail), role, status (active, idle, suspended, needs-approval… |
tailscale_get_user | One user: displayName, loginName, role, status, type, created, lastSeen, deviceCount |
tailscale_update_user_role | Change the role of a user |
tailscale_approve_user | Approve a user whose status is needs-approval (when user approval is on in the tailnet settings) |
tailscale_suspend_user | Suspend a user: their devices lose access to the tailnet until the user is restored with tailscale_restore_user |
tailscale_restore_user | Restore a suspended user, giving their devices access to the tailnet again |
tailscale_delete_user | Delete a user from the tailnet, together with their devices |
tailscale_list_user_invites | Open (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_keys | List the keys of the tailnet: auth keys, API access tokens, OAuth clients and federated identities, with id, keyType, description, created… |
tailscale_get_key | One key by id: keyType, description, created, expires, revoked, invalid, capabilities (reusable, ephemeral, preauthorized, tags for auth… |
tailscale_create_auth_key | Create an auth key to add devices to the tailnet |
tailscale_delete_key | Revoke a key by id: an auth key, an API access token or a trust credential |
tailscale_get_policy_file | The tailnet policy file (access rules) as JSON: grants and acls, groups, hosts, tagOwners, autoApprovers, ssh, nodeAttrs, postures and… |
tailscale_validate_policy_file | Check a policy file without saving it: Tailscale parses it and runs its tests (and sshTests) |
tailscale_preview_policy_rules | Which rules of a policy file would apply to one user or one IP:port, without saving it |
tailscale_set_policy_file | Replace the whole tailnet policy file |
tailscale_get_dns_configuration | The full DNS setup of the tailnet in one call: global nameservers, split DNS routes (domain to nameservers), search paths and preferences… |
tailscale_set_dns_nameservers | Replace the global DNS nameservers of the tailnet |
tailscale_set_dns_preferences | Switch MagicDNS on or off for the tailnet |
tailscale_set_dns_search_paths | Replace the DNS search domains of the tailnet |
tailscale_update_split_dns | Change split DNS for some domains: only the domains you pass are changed, the others stay |
tailscale_get_tailnet_settings | The tailnet settings: device approval, device auto-updates, key expiry in days, user approval, who may join external tailnets, network flow… |
tailscale_update_tailnet_settings | Change one or more tailnet settings; fields you leave out keep their value |
tailscale_get_contacts | The account, support and security contact e-mails of the tailnet, each with its fallback and whether it still needs verification |
tailscale_list_configuration_audit_logs | Configuration 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_logs | Network 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_status | Whether streaming of a log type to a SIEM works: last activity, last error, bytes and entries sent, rate |
tailscale_get_log_streaming_configuration | Where a log type is streamed: destination type (splunk, elastic, datadog, s3, ...), URL, upload period, compression, S3 bucket and region |
tailscale_list_webhooks | The webhook endpoints of the tailnet: endpointId, URL, provider type, the events they receive and who created them |
tailscale_get_webhook | One webhook endpoint by id: URL, provider type, subscribed events, creator, created and lastModified |
tailscale_create_webhook | Create a webhook that sends tailnet events to a URL |
tailscale_list_services | Tailscale Services of the tailnet (virtual services hosted by one or more devices): name (svc:...), addresses, ports, tags and comment |
tailscale_get_service | One Tailscale Service by name: its addresses, ports, tags and comment |
tailscale_list_service_hosts | The devices that host a Tailscale Service, with whether each one is approved to serve it |
tailscale_list_posture_integrations | The 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
Where does Gemini CLI look for MCP servers? In ~/.gemini/settings.json for your user, or in .gemini/settings.json inside a project. gemini mcp list shows each server and whether it connects.
Next steps
- Connector landing page
- Connect to Claude
- Connect to ChatGPT
- Connect to Cursor
- Connect to Meta Muse
- Connect to Microsoft Copilot
Was this guide helpful?