@yawlabs/tailscale-mcp 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +3 -17
  2. package/dist/index.js +22922 -120
  3. package/package.json +10 -11
  4. package/dist/api.d.ts +0 -35
  5. package/dist/api.js +0 -134
  6. package/dist/api.js.map +0 -1
  7. package/dist/cli.d.ts +0 -5
  8. package/dist/cli.js +0 -43
  9. package/dist/cli.js.map +0 -1
  10. package/dist/index.d.ts +0 -2
  11. package/dist/index.js.map +0 -1
  12. package/dist/tools/acl.d.ts +0 -86
  13. package/dist/tools/acl.js +0 -105
  14. package/dist/tools/acl.js.map +0 -1
  15. package/dist/tools/audit.d.ts +0 -50
  16. package/dist/tools/audit.js +0 -60
  17. package/dist/tools/audit.js.map +0 -1
  18. package/dist/tools/devices.d.ts +0 -290
  19. package/dist/tools/devices.js +0 -254
  20. package/dist/tools/devices.js.map +0 -1
  21. package/dist/tools/dns.d.ts +0 -130
  22. package/dist/tools/dns.js +0 -139
  23. package/dist/tools/dns.js.map +0 -1
  24. package/dist/tools/invites.d.ts +0 -158
  25. package/dist/tools/invites.js +0 -160
  26. package/dist/tools/invites.js.map +0 -1
  27. package/dist/tools/keys.d.ts +0 -94
  28. package/dist/tools/keys.js +0 -92
  29. package/dist/tools/keys.js.map +0 -1
  30. package/dist/tools/log-streaming.d.ts +0 -90
  31. package/dist/tools/log-streaming.js +0 -89
  32. package/dist/tools/log-streaming.js.map +0 -1
  33. package/dist/tools/network-lock.d.ts +0 -14
  34. package/dist/tools/network-lock.js +0 -20
  35. package/dist/tools/network-lock.js.map +0 -1
  36. package/dist/tools/oauth-clients.d.ts +0 -118
  37. package/dist/tools/oauth-clients.js +0 -102
  38. package/dist/tools/oauth-clients.js.map +0 -1
  39. package/dist/tools/posture.d.ts +0 -126
  40. package/dist/tools/posture.js +0 -103
  41. package/dist/tools/posture.js.map +0 -1
  42. package/dist/tools/services.d.ts +0 -124
  43. package/dist/tools/services.js +0 -106
  44. package/dist/tools/services.js.map +0 -1
  45. package/dist/tools/status.d.ts +0 -26
  46. package/dist/tools/status.js +0 -38
  47. package/dist/tools/status.js.map +0 -1
  48. package/dist/tools/tailnet.d.ts +0 -142
  49. package/dist/tools/tailnet.js +0 -111
  50. package/dist/tools/tailnet.js.map +0 -1
  51. package/dist/tools/users.d.ts +0 -118
  52. package/dist/tools/users.js +0 -108
  53. package/dist/tools/users.js.map +0 -1
  54. package/dist/tools/webhooks.d.ts +0 -126
  55. package/dist/tools/webhooks.js +0 -121
  56. package/dist/tools/webhooks.js.map +0 -1
  57. package/dist/tools/workload-identity.d.ts +0 -118
  58. package/dist/tools/workload-identity.js +0 -105
  59. package/dist/tools/workload-identity.js.map +0 -1
@@ -1,103 +0,0 @@
1
- import { z } from "zod";
2
- import { apiDelete, apiGet, apiPatch, apiPost, encPath, getTailnet } from "../api.js";
3
- export const postureTools = [
4
- {
5
- name: "tailscale_list_posture_integrations",
6
- description: "List all device posture integrations configured for your tailnet.",
7
- annotations: {
8
- title: "List posture integrations",
9
- readOnlyHint: true,
10
- destructiveHint: false,
11
- idempotentHint: true,
12
- openWorldHint: true,
13
- },
14
- inputSchema: z.object({}),
15
- handler: async () => {
16
- return apiGet(`/tailnet/${getTailnet()}/posture/integrations`);
17
- },
18
- },
19
- {
20
- name: "tailscale_get_posture_integration",
21
- description: "Get details for a specific device posture integration.",
22
- annotations: {
23
- title: "Get posture integration",
24
- readOnlyHint: true,
25
- destructiveHint: false,
26
- idempotentHint: true,
27
- openWorldHint: true,
28
- },
29
- inputSchema: z.object({
30
- integrationId: z.string().describe("The posture integration ID"),
31
- }),
32
- handler: async (input) => {
33
- return apiGet(`/tailnet/${getTailnet()}/posture/integrations/${encPath(input.integrationId)}`);
34
- },
35
- },
36
- {
37
- name: "tailscale_create_posture_integration",
38
- description: "Create a new device posture integration.",
39
- annotations: {
40
- title: "Create posture integration",
41
- readOnlyHint: false,
42
- destructiveHint: false,
43
- idempotentHint: false,
44
- openWorldHint: true,
45
- },
46
- inputSchema: z.object({
47
- provider: z.string().describe("The posture provider (e.g. 'crowdstrike', 'sentinelone', 'intune')"),
48
- clientId: z.string().describe("The OAuth client ID for the provider"),
49
- clientSecret: z.string().describe("The OAuth client secret for the provider"),
50
- tenantId: z.string().optional().describe("The tenant ID (required for some providers)"),
51
- cloudEnvironment: z.string().optional().describe("Cloud environment (e.g. 'us-1', 'eu-1')"),
52
- }),
53
- handler: async (input) => {
54
- return apiPost(`/tailnet/${getTailnet()}/posture/integrations`, input);
55
- },
56
- },
57
- {
58
- name: "tailscale_update_posture_integration",
59
- description: "Update an existing posture integration's credentials or configuration.",
60
- annotations: {
61
- title: "Update posture integration",
62
- readOnlyHint: false,
63
- destructiveHint: false,
64
- idempotentHint: true,
65
- openWorldHint: true,
66
- },
67
- inputSchema: z.object({
68
- integrationId: z.string().describe("The posture integration ID to update"),
69
- clientId: z.string().optional().describe("Updated OAuth client ID for the provider"),
70
- clientSecret: z.string().optional().describe("Updated OAuth client secret for the provider"),
71
- tenantId: z.string().optional().describe("Updated tenant ID"),
72
- cloudEnvironment: z.string().optional().describe("Updated cloud environment (e.g. 'us-1', 'eu-1')"),
73
- }),
74
- handler: async (input) => {
75
- const { integrationId, ...body } = input;
76
- // Remove undefined values so we only send fields the user wants to update
77
- const cleanBody = {};
78
- for (const [key, value] of Object.entries(body)) {
79
- if (value !== undefined)
80
- cleanBody[key] = value;
81
- }
82
- return apiPatch(`/tailnet/${getTailnet()}/posture/integrations/${encPath(integrationId)}`, cleanBody);
83
- },
84
- },
85
- {
86
- name: "tailscale_delete_posture_integration",
87
- description: "Delete a posture integration. This is irreversible.",
88
- annotations: {
89
- title: "Delete posture integration",
90
- readOnlyHint: false,
91
- destructiveHint: true,
92
- idempotentHint: true,
93
- openWorldHint: true,
94
- },
95
- inputSchema: z.object({
96
- integrationId: z.string().describe("The posture integration ID to delete"),
97
- }),
98
- handler: async (input) => {
99
- return apiDelete(`/tailnet/${getTailnet()}/posture/integrations/${encPath(input.integrationId)}`);
100
- },
101
- },
102
- ];
103
- //# sourceMappingURL=posture.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"posture.js","sourceRoot":"","sources":["../../src/tools/posture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEtF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,IAAI,EAAE,qCAAqC;QAC3C,WAAW,EAAE,mEAAmE;QAChF,WAAW,EAAE;YACX,KAAK,EAAE,2BAA2B;YAClC,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;QACD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,OAAO,MAAM,CAAC,YAAY,UAAU,EAAE,uBAAuB,CAAC,CAAC;QACjE,CAAC;KACF;IACD;QACE,IAAI,EAAE,mCAAmC;QACzC,WAAW,EAAE,wDAAwD;QACrE,WAAW,EAAE;YACX,KAAK,EAAE,yBAAyB;YAChC,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;QACD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;SACjE,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,KAAgC,EAAE,EAAE;YAClD,OAAO,MAAM,CAAC,YAAY,UAAU,EAAE,yBAAyB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAA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,EAAE,yBAAyB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACpG,CAAC;KACF;CACO,CAAC"}
@@ -1,124 +0,0 @@
1
- import { z } from "zod";
2
- export declare const serviceTools: readonly [{
3
- readonly name: "tailscale_list_services";
4
- readonly description: "List all Tailscale Services in your tailnet. Services provide stable MagicDNS names and virtual IPs, decoupled from individual devices.";
5
- readonly annotations: {
6
- readonly title: "List services";
7
- readonly readOnlyHint: true;
8
- readonly destructiveHint: false;
9
- readonly idempotentHint: true;
10
- readonly openWorldHint: true;
11
- };
12
- readonly inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
13
- readonly handler: () => Promise<import("../api.js").ApiResponse<unknown>>;
14
- }, {
15
- readonly name: "tailscale_get_service";
16
- readonly description: "Get details for a specific Tailscale Service, including its MagicDNS name, virtual IP, and configuration.";
17
- readonly annotations: {
18
- readonly title: "Get service";
19
- readonly readOnlyHint: true;
20
- readonly destructiveHint: false;
21
- readonly idempotentHint: true;
22
- readonly openWorldHint: true;
23
- };
24
- readonly inputSchema: z.ZodObject<{
25
- serviceName: z.ZodString;
26
- }, "strip", z.ZodTypeAny, {
27
- serviceName: string;
28
- }, {
29
- serviceName: string;
30
- }>;
31
- readonly handler: (input: {
32
- serviceName: string;
33
- }) => Promise<import("../api.js").ApiResponse<unknown>>;
34
- }, {
35
- readonly name: "tailscale_update_service";
36
- readonly description: "Update a Tailscale Service's configuration.";
37
- readonly annotations: {
38
- readonly title: "Update service";
39
- readonly readOnlyHint: false;
40
- readonly destructiveHint: false;
41
- readonly idempotentHint: true;
42
- readonly openWorldHint: true;
43
- };
44
- readonly inputSchema: z.ZodObject<{
45
- serviceName: z.ZodString;
46
- ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
47
- protocol: z.ZodEnum<["tcp", "udp"]>;
48
- port: z.ZodNumber;
49
- }, "strip", z.ZodTypeAny, {
50
- protocol: "tcp" | "udp";
51
- port: number;
52
- }, {
53
- protocol: "tcp" | "udp";
54
- port: number;
55
- }>, "many">>;
56
- tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
57
- autoApproveHosts: z.ZodOptional<z.ZodBoolean>;
58
- }, "strip", z.ZodTypeAny, {
59
- serviceName: string;
60
- tags?: string[] | undefined;
61
- ports?: {
62
- protocol: "tcp" | "udp";
63
- port: number;
64
- }[] | undefined;
65
- autoApproveHosts?: boolean | undefined;
66
- }, {
67
- serviceName: string;
68
- tags?: string[] | undefined;
69
- ports?: {
70
- protocol: "tcp" | "udp";
71
- port: number;
72
- }[] | undefined;
73
- autoApproveHosts?: boolean | undefined;
74
- }>;
75
- readonly handler: (input: {
76
- serviceName: string;
77
- ports?: {
78
- protocol: string;
79
- port: number;
80
- }[];
81
- tags?: string[];
82
- autoApproveHosts?: boolean;
83
- }) => Promise<import("../api.js").ApiResponse<unknown>>;
84
- }, {
85
- readonly name: "tailscale_delete_service";
86
- readonly description: "Delete a Tailscale Service. This is irreversible — the service's MagicDNS name and virtual IP will be released.";
87
- readonly annotations: {
88
- readonly title: "Delete service";
89
- readonly readOnlyHint: false;
90
- readonly destructiveHint: true;
91
- readonly idempotentHint: false;
92
- readonly openWorldHint: true;
93
- };
94
- readonly inputSchema: z.ZodObject<{
95
- serviceName: z.ZodString;
96
- }, "strip", z.ZodTypeAny, {
97
- serviceName: string;
98
- }, {
99
- serviceName: string;
100
- }>;
101
- readonly handler: (input: {
102
- serviceName: string;
103
- }) => Promise<import("../api.js").ApiResponse<unknown>>;
104
- }, {
105
- readonly name: "tailscale_list_service_hosts";
106
- readonly description: "List devices hosting a specific Tailscale Service.";
107
- readonly annotations: {
108
- readonly title: "List service hosts";
109
- readonly readOnlyHint: true;
110
- readonly destructiveHint: false;
111
- readonly idempotentHint: true;
112
- readonly openWorldHint: true;
113
- };
114
- readonly inputSchema: z.ZodObject<{
115
- serviceName: z.ZodString;
116
- }, "strip", z.ZodTypeAny, {
117
- serviceName: string;
118
- }, {
119
- serviceName: string;
120
- }>;
121
- readonly handler: (input: {
122
- serviceName: string;
123
- }) => Promise<import("../api.js").ApiResponse<unknown>>;
124
- }];
@@ -1,106 +0,0 @@
1
- import { z } from "zod";
2
- import { apiDelete, apiGet, apiPatch, encPath, getTailnet } from "../api.js";
3
- export const serviceTools = [
4
- {
5
- name: "tailscale_list_services",
6
- description: "List all Tailscale Services in your tailnet. Services provide stable MagicDNS names and virtual IPs, decoupled from individual devices.",
7
- annotations: {
8
- title: "List services",
9
- readOnlyHint: true,
10
- destructiveHint: false,
11
- idempotentHint: true,
12
- openWorldHint: true,
13
- },
14
- inputSchema: z.object({}),
15
- handler: async () => {
16
- return apiGet(`/tailnet/${getTailnet()}/services`);
17
- },
18
- },
19
- {
20
- name: "tailscale_get_service",
21
- description: "Get details for a specific Tailscale Service, including its MagicDNS name, virtual IP, and configuration.",
22
- annotations: {
23
- title: "Get service",
24
- readOnlyHint: true,
25
- destructiveHint: false,
26
- idempotentHint: true,
27
- openWorldHint: true,
28
- },
29
- inputSchema: z.object({
30
- serviceName: z.string().describe("The service name"),
31
- }),
32
- handler: async (input) => {
33
- return apiGet(`/tailnet/${getTailnet()}/services/${encPath(input.serviceName)}`);
34
- },
35
- },
36
- {
37
- name: "tailscale_update_service",
38
- description: "Update a Tailscale Service's configuration.",
39
- annotations: {
40
- title: "Update service",
41
- readOnlyHint: false,
42
- destructiveHint: false,
43
- idempotentHint: true,
44
- openWorldHint: true,
45
- },
46
- inputSchema: z.object({
47
- serviceName: z.string().describe("The service name to update"),
48
- ports: z
49
- .array(z.object({
50
- protocol: z.enum(["tcp", "udp"]).describe("Protocol (tcp or udp)"),
51
- port: z.number().describe("Port number"),
52
- }))
53
- .optional()
54
- .describe("Ports the service listens on"),
55
- tags: z.array(z.string()).optional().describe("ACL tags for the service"),
56
- autoApproveHosts: z
57
- .boolean()
58
- .optional()
59
- .describe("Whether to auto-approve devices that want to host this service"),
60
- }),
61
- handler: async (input) => {
62
- const { serviceName, ...body } = input;
63
- const cleanBody = {};
64
- for (const [key, value] of Object.entries(body)) {
65
- if (value !== undefined)
66
- cleanBody[key] = value;
67
- }
68
- return apiPatch(`/tailnet/${getTailnet()}/services/${encPath(serviceName)}`, cleanBody);
69
- },
70
- },
71
- {
72
- name: "tailscale_delete_service",
73
- description: "Delete a Tailscale Service. This is irreversible — the service's MagicDNS name and virtual IP will be released.",
74
- annotations: {
75
- title: "Delete service",
76
- readOnlyHint: false,
77
- destructiveHint: true,
78
- idempotentHint: false,
79
- openWorldHint: true,
80
- },
81
- inputSchema: z.object({
82
- serviceName: z.string().describe("The service name to delete"),
83
- }),
84
- handler: async (input) => {
85
- return apiDelete(`/tailnet/${getTailnet()}/services/${encPath(input.serviceName)}`);
86
- },
87
- },
88
- {
89
- name: "tailscale_list_service_hosts",
90
- description: "List devices hosting a specific Tailscale Service.",
91
- annotations: {
92
- title: "List service hosts",
93
- readOnlyHint: true,
94
- destructiveHint: false,
95
- idempotentHint: true,
96
- openWorldHint: true,
97
- },
98
- inputSchema: z.object({
99
- serviceName: z.string().describe("The service name"),
100
- }),
101
- handler: async (input) => {
102
- return apiGet(`/tailnet/${getTailnet()}/services/${encPath(input.serviceName)}/hosts`);
103
- },
104
- },
105
- ];
106
- //# sourceMappingURL=services.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/tools/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE7E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EACT,yIAAyI;QAC3I,WAAW,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE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KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACtF,CAAC;KACF;IACD;QACE,IAAI,EAAE,8BAA8B;QACpC,WAAW,EAAE,oDAAoD;QACjE,WAAW,EAAE;YACX,KAAK,EAAE,oBAAoB;YAC3B,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;QACD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,CAAC;SACrD,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,KAA8B,EAAE,EAAE;YAChD,OAAO,MAAM,CAAC,YAAY,UAAU,EAAE,aAAa,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzF,CAAC;KACF;CACO,CAAC"}
@@ -1,26 +0,0 @@
1
- import { z } from "zod";
2
- export declare const statusTools: readonly [{
3
- readonly name: "tailscale_status";
4
- readonly description: "Check that the Tailscale API connection is working. Returns your tailnet name, device count, and confirms authentication is valid. Use this to verify setup.";
5
- readonly annotations: {
6
- readonly title: "Check API status";
7
- readonly readOnlyHint: true;
8
- readonly destructiveHint: false;
9
- readonly idempotentHint: true;
10
- readonly openWorldHint: true;
11
- };
12
- readonly inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
13
- readonly handler: () => Promise<import("../api.js").ApiResponse<{
14
- devices: unknown[];
15
- }> | {
16
- ok: boolean;
17
- status: number;
18
- data: {
19
- settingsError?: string | undefined;
20
- connected: boolean;
21
- tailnet: string;
22
- deviceCount: number;
23
- settings: Record<string, unknown> | undefined;
24
- };
25
- }>;
26
- }];
@@ -1,38 +0,0 @@
1
- import { z } from "zod";
2
- import { apiGet, getTailnet } from "../api.js";
3
- export const statusTools = [
4
- {
5
- name: "tailscale_status",
6
- description: "Check that the Tailscale API connection is working. Returns your tailnet name, device count, and confirms authentication is valid. Use this to verify setup.",
7
- annotations: {
8
- title: "Check API status",
9
- readOnlyHint: true,
10
- destructiveHint: false,
11
- idempotentHint: true,
12
- openWorldHint: true,
13
- },
14
- inputSchema: z.object({}),
15
- handler: async () => {
16
- const [devicesRes, settingsRes] = await Promise.all([
17
- apiGet(`/tailnet/${getTailnet()}/devices?fields=id`),
18
- apiGet(`/tailnet/${getTailnet()}/settings`),
19
- ]);
20
- if (!devicesRes.ok) {
21
- return devicesRes;
22
- }
23
- const deviceCount = devicesRes.data?.devices?.length ?? 0;
24
- return {
25
- ok: true,
26
- status: 200,
27
- data: {
28
- connected: true,
29
- tailnet: getTailnet(),
30
- deviceCount,
31
- settings: settingsRes.ok ? settingsRes.data : undefined,
32
- ...(settingsRes.ok ? {} : { settingsError: settingsRes.error || "Failed to fetch tailnet settings" }),
33
- },
34
- };
35
- },
36
- },
37
- ];
38
- //# sourceMappingURL=status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/tools/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,8JAA8J;QAChK,WAAW,EAAE;YACX,KAAK,EAAE,kBAAkB;YACzB,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,IAAI;YACpB,aAAa,EAAE,IAAI;SACpB;QACD,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAClD,MAAM,CAAyB,YAAY,UAAU,EAAE,oBAAoB,CAAC;gBAC5E,MAAM,CAA0B,YAAY,UAAU,EAAE,WAAW,CAAC;aACrE,CAAC,CAAC;YAEH,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;gBACnB,OAAO,UAAU,CAAC;YACpB,CAAC;YACD,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC;YAE1D,OAAO;gBACL,EAAE,EAAE,IAAI;gBACR,MAAM,EAAE,GAAG;gBACX,IAAI,EAAE;oBACJ,SAAS,EAAE,IAAI;oBACf,OAAO,EAAE,UAAU,EAAE;oBACrB,WAAW;oBACX,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;oBACvD,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,WAAW,CAAC,KAAK,IAAI,kCAAkC,EAAE,CAAC;iBACtG;aACF,CAAC;QACJ,CAAC;KACF;CACO,CAAC"}
@@ -1,142 +0,0 @@
1
- import { z } from "zod";
2
- export declare const tailnetTools: readonly [{
3
- readonly name: "tailscale_get_tailnet_settings";
4
- readonly description: "Get your tailnet settings (device approval, key expiry, HTTPS certificates, etc.).";
5
- readonly annotations: {
6
- readonly title: "Get tailnet settings";
7
- readonly readOnlyHint: true;
8
- readonly destructiveHint: false;
9
- readonly idempotentHint: true;
10
- readonly openWorldHint: true;
11
- };
12
- readonly inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
13
- readonly handler: () => Promise<import("../api.js").ApiResponse<unknown>>;
14
- }, {
15
- readonly name: "tailscale_update_tailnet_settings";
16
- readonly description: "Update tailnet settings (device approval, auto-updates, key expiry, HTTPS certificates, network flow logging, regional routing, posture identity collection).";
17
- readonly annotations: {
18
- readonly title: "Update tailnet settings";
19
- readonly readOnlyHint: false;
20
- readonly destructiveHint: false;
21
- readonly idempotentHint: true;
22
- readonly openWorldHint: true;
23
- };
24
- readonly inputSchema: z.ZodObject<{
25
- devicesApprovalOn: z.ZodOptional<z.ZodBoolean>;
26
- devicesAutoUpdatesOn: z.ZodOptional<z.ZodBoolean>;
27
- devicesKeyDurationDays: z.ZodOptional<z.ZodNumber>;
28
- usersApprovalOn: z.ZodOptional<z.ZodBoolean>;
29
- usersRoleAllowedToJoinExternalTailnets: z.ZodOptional<z.ZodEnum<["none", "admin", "member"]>>;
30
- networkFlowLoggingOn: z.ZodOptional<z.ZodBoolean>;
31
- regionalRoutingOn: z.ZodOptional<z.ZodBoolean>;
32
- postureIdentityCollectionOn: z.ZodOptional<z.ZodBoolean>;
33
- httpsEnabled: z.ZodOptional<z.ZodBoolean>;
34
- }, "strip", z.ZodTypeAny, {
35
- devicesApprovalOn?: boolean | undefined;
36
- devicesAutoUpdatesOn?: boolean | undefined;
37
- devicesKeyDurationDays?: number | undefined;
38
- usersApprovalOn?: boolean | undefined;
39
- usersRoleAllowedToJoinExternalTailnets?: "none" | "admin" | "member" | undefined;
40
- networkFlowLoggingOn?: boolean | undefined;
41
- regionalRoutingOn?: boolean | undefined;
42
- postureIdentityCollectionOn?: boolean | undefined;
43
- httpsEnabled?: boolean | undefined;
44
- }, {
45
- devicesApprovalOn?: boolean | undefined;
46
- devicesAutoUpdatesOn?: boolean | undefined;
47
- devicesKeyDurationDays?: number | undefined;
48
- usersApprovalOn?: boolean | undefined;
49
- usersRoleAllowedToJoinExternalTailnets?: "none" | "admin" | "member" | undefined;
50
- networkFlowLoggingOn?: boolean | undefined;
51
- regionalRoutingOn?: boolean | undefined;
52
- postureIdentityCollectionOn?: boolean | undefined;
53
- httpsEnabled?: boolean | undefined;
54
- }>;
55
- readonly handler: (input: {
56
- devicesApprovalOn?: boolean;
57
- devicesAutoUpdatesOn?: boolean;
58
- devicesKeyDurationDays?: number;
59
- usersApprovalOn?: boolean;
60
- usersRoleAllowedToJoinExternalTailnets?: string;
61
- networkFlowLoggingOn?: boolean;
62
- regionalRoutingOn?: boolean;
63
- postureIdentityCollectionOn?: boolean;
64
- httpsEnabled?: boolean;
65
- }) => Promise<import("../api.js").ApiResponse<unknown>>;
66
- }, {
67
- readonly name: "tailscale_get_contacts";
68
- readonly description: "Get the tailnet contact information (security, support, admin emails).";
69
- readonly annotations: {
70
- readonly title: "Get contacts";
71
- readonly readOnlyHint: true;
72
- readonly destructiveHint: false;
73
- readonly idempotentHint: true;
74
- readonly openWorldHint: true;
75
- };
76
- readonly inputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
77
- readonly handler: () => Promise<import("../api.js").ApiResponse<unknown>>;
78
- }, {
79
- readonly name: "tailscale_set_contacts";
80
- readonly description: "Update tailnet contact information.";
81
- readonly annotations: {
82
- readonly title: "Set contacts";
83
- readonly readOnlyHint: false;
84
- readonly destructiveHint: false;
85
- readonly idempotentHint: true;
86
- readonly openWorldHint: true;
87
- };
88
- readonly inputSchema: z.ZodObject<{
89
- account: z.ZodOptional<z.ZodObject<{
90
- email: z.ZodString;
91
- }, "strip", z.ZodTypeAny, {
92
- email: string;
93
- }, {
94
- email: string;
95
- }>>;
96
- support: z.ZodOptional<z.ZodObject<{
97
- email: z.ZodString;
98
- }, "strip", z.ZodTypeAny, {
99
- email: string;
100
- }, {
101
- email: string;
102
- }>>;
103
- security: z.ZodOptional<z.ZodObject<{
104
- email: z.ZodString;
105
- }, "strip", z.ZodTypeAny, {
106
- email: string;
107
- }, {
108
- email: string;
109
- }>>;
110
- }, "strip", z.ZodTypeAny, {
111
- account?: {
112
- email: string;
113
- } | undefined;
114
- support?: {
115
- email: string;
116
- } | undefined;
117
- security?: {
118
- email: string;
119
- } | undefined;
120
- }, {
121
- account?: {
122
- email: string;
123
- } | undefined;
124
- support?: {
125
- email: string;
126
- } | undefined;
127
- security?: {
128
- email: string;
129
- } | undefined;
130
- }>;
131
- readonly handler: (input: {
132
- account?: {
133
- email: string;
134
- };
135
- support?: {
136
- email: string;
137
- };
138
- security?: {
139
- email: string;
140
- };
141
- }) => Promise<import("../api.js").ApiResponse<unknown>>;
142
- }];
@@ -1,111 +0,0 @@
1
- import { z } from "zod";
2
- import { apiGet, apiPatch, getTailnet } from "../api.js";
3
- export const tailnetTools = [
4
- {
5
- name: "tailscale_get_tailnet_settings",
6
- description: "Get your tailnet settings (device approval, key expiry, HTTPS certificates, etc.).",
7
- annotations: {
8
- title: "Get tailnet settings",
9
- readOnlyHint: true,
10
- destructiveHint: false,
11
- idempotentHint: true,
12
- openWorldHint: true,
13
- },
14
- inputSchema: z.object({}),
15
- handler: async () => {
16
- return apiGet(`/tailnet/${getTailnet()}/settings`);
17
- },
18
- },
19
- {
20
- name: "tailscale_update_tailnet_settings",
21
- description: "Update tailnet settings (device approval, auto-updates, key expiry, HTTPS certificates, network flow logging, regional routing, posture identity collection).",
22
- annotations: {
23
- title: "Update tailnet settings",
24
- readOnlyHint: false,
25
- destructiveHint: false,
26
- idempotentHint: true,
27
- openWorldHint: true,
28
- },
29
- inputSchema: z.object({
30
- devicesApprovalOn: z.boolean().optional().describe("Whether device approval is required"),
31
- devicesAutoUpdatesOn: z.boolean().optional().describe("Whether auto-updates are enabled"),
32
- devicesKeyDurationDays: z.number().optional().describe("Key expiry duration in days"),
33
- usersApprovalOn: z.boolean().optional().describe("Whether user approval is required"),
34
- usersRoleAllowedToJoinExternalTailnets: z
35
- .enum(["none", "admin", "member"])
36
- .optional()
37
- .describe("Which user roles can join external tailnets"),
38
- networkFlowLoggingOn: z.boolean().optional().describe("Whether network flow logging is enabled"),
39
- regionalRoutingOn: z.boolean().optional().describe("Whether regional routing is enabled"),
40
- postureIdentityCollectionOn: z.boolean().optional().describe("Whether posture identity collection is enabled"),
41
- httpsEnabled: z
42
- .boolean()
43
- .optional()
44
- .describe("Whether HTTPS certificates are enabled (for tailscale serve/funnel)"),
45
- }),
46
- handler: async (input) => {
47
- const body = {};
48
- if (input.devicesApprovalOn !== undefined)
49
- body.devicesApprovalOn = input.devicesApprovalOn;
50
- if (input.devicesAutoUpdatesOn !== undefined)
51
- body.devicesAutoUpdatesOn = input.devicesAutoUpdatesOn;
52
- if (input.devicesKeyDurationDays !== undefined)
53
- body.devicesKeyDurationDays = input.devicesKeyDurationDays;
54
- if (input.usersApprovalOn !== undefined)
55
- body.usersApprovalOn = input.usersApprovalOn;
56
- if (input.usersRoleAllowedToJoinExternalTailnets !== undefined)
57
- body.usersRoleAllowedToJoinExternalTailnets = input.usersRoleAllowedToJoinExternalTailnets;
58
- if (input.networkFlowLoggingOn !== undefined)
59
- body.networkFlowLoggingOn = input.networkFlowLoggingOn;
60
- if (input.regionalRoutingOn !== undefined)
61
- body.regionalRoutingOn = input.regionalRoutingOn;
62
- if (input.postureIdentityCollectionOn !== undefined)
63
- body.postureIdentityCollectionOn = input.postureIdentityCollectionOn;
64
- if (input.httpsEnabled !== undefined)
65
- body.httpsEnabled = input.httpsEnabled;
66
- return apiPatch(`/tailnet/${getTailnet()}/settings`, body);
67
- },
68
- },
69
- {
70
- name: "tailscale_get_contacts",
71
- description: "Get the tailnet contact information (security, support, admin emails).",
72
- annotations: {
73
- title: "Get contacts",
74
- readOnlyHint: true,
75
- destructiveHint: false,
76
- idempotentHint: true,
77
- openWorldHint: true,
78
- },
79
- inputSchema: z.object({}),
80
- handler: async () => {
81
- return apiGet(`/tailnet/${getTailnet()}/contacts`);
82
- },
83
- },
84
- {
85
- name: "tailscale_set_contacts",
86
- description: "Update tailnet contact information.",
87
- annotations: {
88
- title: "Set contacts",
89
- readOnlyHint: false,
90
- destructiveHint: false,
91
- idempotentHint: true,
92
- openWorldHint: true,
93
- },
94
- inputSchema: z.object({
95
- account: z.object({ email: z.string() }).optional().describe("Account contact email"),
96
- support: z.object({ email: z.string() }).optional().describe("Support contact email"),
97
- security: z.object({ email: z.string() }).optional().describe("Security contact email"),
98
- }),
99
- handler: async (input) => {
100
- const body = {};
101
- if (input.account !== undefined)
102
- body.account = input.account;
103
- if (input.support !== undefined)
104
- body.support = input.support;
105
- if (input.security !== undefined)
106
- body.security = input.security;
107
- return apiPatch(`/tailnet/${getTailnet()}/contacts`, body);
108
- },
109
- },
110
- ];
111
- //# sourceMappingURL=tailnet.js.map