@yawlabs/tailscale-mcp 0.5.0 → 0.5.1

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 (2) hide show
  1. package/dist/index.js +37 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21156,7 +21156,9 @@ async function deployAcl(filePath) {
21156
21156
  }
21157
21157
  const validateRes = await apiPost(`/tailnet/${getTailnet()}/acl/validate`, void 0, {
21158
21158
  rawBody: policy,
21159
- contentType: "application/hujson"
21159
+ contentType: "application/hujson",
21160
+ acceptRaw: true,
21161
+ accept: "application/hujson"
21160
21162
  });
21161
21163
  if (!validateRes.ok) {
21162
21164
  console.error(`ACL validation failed: ${validateRes.error}`);
@@ -21165,7 +21167,9 @@ async function deployAcl(filePath) {
21165
21167
  const deployRes = await apiPost(`/tailnet/${getTailnet()}/acl`, void 0, {
21166
21168
  rawBody: policy,
21167
21169
  contentType: "application/hujson",
21168
- ifMatch: getRes.etag
21170
+ ifMatch: getRes.etag,
21171
+ acceptRaw: true,
21172
+ accept: "application/hujson"
21169
21173
  });
21170
21174
  if (!deployRes.ok) {
21171
21175
  console.error(`ACL deploy failed: ${deployRes.error}`);
@@ -21225,7 +21229,9 @@ Pass this ETag to tailscale_update_acl when updating the policy.`
21225
21229
  return apiPost(`/tailnet/${getTailnet()}/acl`, void 0, {
21226
21230
  rawBody: input.policy,
21227
21231
  contentType: "application/hujson",
21228
- ifMatch: input.etag
21232
+ ifMatch: input.etag,
21233
+ acceptRaw: true,
21234
+ accept: "application/hujson"
21229
21235
  });
21230
21236
  }
21231
21237
  },
@@ -21245,10 +21251,12 @@ Pass this ETag to tailscale_update_acl when updating the policy.`
21245
21251
  handler: async (input) => {
21246
21252
  const res = await apiPost(`/tailnet/${getTailnet()}/acl/validate`, void 0, {
21247
21253
  rawBody: input.policy,
21248
- contentType: "application/hujson"
21254
+ contentType: "application/hujson",
21255
+ acceptRaw: true,
21256
+ accept: "application/hujson"
21249
21257
  });
21250
- if (res.ok && !res.data) {
21251
- return { ...res, data: { message: "ACL policy is valid." } };
21258
+ if (res.ok && !res.rawBody) {
21259
+ return { ...res, rawBody: "ACL policy is valid." };
21252
21260
  }
21253
21261
  return res;
21254
21262
  }
@@ -21272,7 +21280,9 @@ Pass this ETag to tailscale_update_acl when updating the policy.`
21272
21280
  const params = new URLSearchParams({ type: input.type, previewFor: input.previewFor });
21273
21281
  return apiPost(`/tailnet/${getTailnet()}/acl/preview?${params}`, void 0, {
21274
21282
  rawBody: input.policy,
21275
- contentType: "application/hujson"
21283
+ contentType: "application/hujson",
21284
+ acceptRaw: true,
21285
+ accept: "application/hujson"
21276
21286
  });
21277
21287
  }
21278
21288
  }
@@ -21350,7 +21360,7 @@ var deviceTools = [
21350
21360
  )
21351
21361
  }),
21352
21362
  handler: async (input) => {
21353
- const params = input.fields ? `?fields=${encodeURIComponent(input.fields)}` : "";
21363
+ const params = input.fields ? `?${new URLSearchParams({ fields: input.fields })}` : "";
21354
21364
  return apiGet(`/tailnet/${getTailnet()}/devices${params}`);
21355
21365
  }
21356
21366
  },
@@ -22071,6 +22081,12 @@ var keyTools = [
22071
22081
  description: external_exports.string().optional().describe("Description for this key")
22072
22082
  }),
22073
22083
  handler: async (input) => {
22084
+ if (input.tags && input.tags.length > 0) {
22085
+ const invalid = input.tags.filter((t) => !t.startsWith("tag:"));
22086
+ if (invalid.length > 0) {
22087
+ throw new Error(`All tags must start with 'tag:' prefix. Invalid tags: ${invalid.join(", ")}`);
22088
+ }
22089
+ }
22074
22090
  const body = {
22075
22091
  capabilities: {
22076
22092
  devices: {
@@ -22344,6 +22360,12 @@ var oauthClientTools = [
22344
22360
  description: external_exports.string().optional().describe("Description for this OAuth client")
22345
22361
  }),
22346
22362
  handler: async (input) => {
22363
+ if (input.tags && input.tags.length > 0) {
22364
+ const invalid = input.tags.filter((t) => !t.startsWith("tag:"));
22365
+ if (invalid.length > 0) {
22366
+ throw new Error(`All tags must start with 'tag:' prefix. Invalid tags: ${invalid.join(", ")}`);
22367
+ }
22368
+ }
22347
22369
  return apiPost(`/tailnet/${getTailnet()}/oauth-clients`, input);
22348
22370
  }
22349
22371
  },
@@ -22547,6 +22569,12 @@ var serviceTools = [
22547
22569
  autoApproveHosts: external_exports.boolean().optional().describe("Whether to auto-approve devices that want to host this service")
22548
22570
  }),
22549
22571
  handler: async (input) => {
22572
+ if (input.tags && input.tags.length > 0) {
22573
+ const invalid = input.tags.filter((t) => !t.startsWith("tag:"));
22574
+ if (invalid.length > 0) {
22575
+ throw new Error(`All tags must start with 'tag:' prefix. Invalid tags: ${invalid.join(", ")}`);
22576
+ }
22577
+ }
22550
22578
  const { serviceName, ...body } = input;
22551
22579
  const cleanBody = {};
22552
22580
  for (const [key, value] of Object.entries(body)) {
@@ -23135,7 +23163,7 @@ var workloadIdentityTools = [
23135
23163
  ];
23136
23164
 
23137
23165
  // src/index.ts
23138
- var version2 = true ? "0.5.0" : (await null).createRequire(import.meta.url)("../package.json").version;
23166
+ var version2 = true ? "0.5.1" : (await null).createRequire(import.meta.url)("../package.json").version;
23139
23167
  var subcommand = process.argv[2];
23140
23168
  if (subcommand === "deploy-acl") {
23141
23169
  const filePath = process.argv[3];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/tailscale-mcp",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Tailscale MCP server for managing your tailnet from AI assistants",
5
5
  "license": "MIT",
6
6
  "author": "YawLabs <contact@yaw.sh>",