@rustrak/mcp 0.1.5 → 0.2.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 +218 -5
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -66,7 +66,7 @@ function registerAlertTools(server2, client2) {
66
66
  },
67
67
  async () => {
68
68
  try {
69
- const result = await client2.alertChannels.list();
69
+ const result = await client2.alertIntegrations.list();
70
70
  return {
71
71
  content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
72
72
  };
@@ -85,7 +85,7 @@ function registerAlertTools(server2, client2) {
85
85
  },
86
86
  async ({ channel_id }) => {
87
87
  try {
88
- const result = await client2.alertChannels.test(channel_id);
88
+ const result = await client2.alertIntegrations.test(channel_id);
89
89
  return {
90
90
  content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
91
91
  };
@@ -166,6 +166,27 @@ function registerEventTools(server2, client2) {
166
166
  );
167
167
  }
168
168
 
169
+ // src/tools/health.ts
170
+ function registerHealthTools(server2, client2) {
171
+ server2.registerTool(
172
+ "get_server_version",
173
+ {
174
+ description: "Get the Rustrak server version.",
175
+ inputSchema: {}
176
+ },
177
+ async () => {
178
+ try {
179
+ const result = await client2.health.getVersion();
180
+ return {
181
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
182
+ };
183
+ } catch (err) {
184
+ return toMcpError(err);
185
+ }
186
+ }
187
+ );
188
+ }
189
+
169
190
  // src/tools/issues.ts
170
191
  import { z as z3 } from "zod";
171
192
  function registerIssueTools(server2, client2) {
@@ -370,8 +391,198 @@ function registerProjectTools(server2, client2) {
370
391
  );
371
392
  }
372
393
 
373
- // src/tools/tokens.ts
394
+ // src/tools/team.ts
374
395
  import { z as z5 } from "zod";
396
+ function registerTeamTools(server2, client2) {
397
+ server2.registerTool(
398
+ "list_team_members",
399
+ {
400
+ description: "List all users on this Rustrak instance with their global role (admin/member) and status. Requires an admin token.",
401
+ inputSchema: {}
402
+ },
403
+ async () => {
404
+ try {
405
+ const result = await client2.team.list();
406
+ return {
407
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
408
+ };
409
+ } catch (err) {
410
+ return toMcpError(err);
411
+ }
412
+ }
413
+ );
414
+ server2.registerTool(
415
+ "update_member_role",
416
+ {
417
+ description: "Change a user's global role. Admins manage the team and all projects; members only see projects they belong to. The primary user and the last admin cannot be demoted. Requires an admin token.",
418
+ inputSchema: {
419
+ user_id: z5.number().int().describe("User ID to update"),
420
+ role: z5.enum(["admin", "member"]).describe("New global role for the user")
421
+ }
422
+ },
423
+ async ({ user_id, role }) => {
424
+ try {
425
+ await client2.team.updateRole(user_id, role);
426
+ return {
427
+ content: [{ type: "text", text: `User ${user_id} is now ${role}.` }]
428
+ };
429
+ } catch (err) {
430
+ return toMcpError(err);
431
+ }
432
+ }
433
+ );
434
+ server2.registerTool(
435
+ "remove_team_member",
436
+ {
437
+ description: "Permanently remove a user from the instance, revoking their access and tokens. The primary user, yourself, and the last admin cannot be removed. Requires an admin token.",
438
+ inputSchema: {
439
+ user_id: z5.number().int().describe("User ID to remove")
440
+ },
441
+ annotations: { destructiveHint: true }
442
+ },
443
+ async ({ user_id }) => {
444
+ try {
445
+ await client2.team.remove(user_id);
446
+ return {
447
+ content: [{ type: "text", text: `User ${user_id} removed.` }]
448
+ };
449
+ } catch (err) {
450
+ return toMcpError(err);
451
+ }
452
+ }
453
+ );
454
+ server2.registerTool(
455
+ "create_invitation",
456
+ {
457
+ description: "Invite a person by email with a global role. Returns a single-use, expiring invite token; share the link `<app-url>/invite/<token>` manually (no email is sent). Requires an admin token.",
458
+ inputSchema: {
459
+ email: z5.string().email().describe("Email address of the invitee"),
460
+ role: z5.enum(["admin", "member"]).describe("Global role the invited user will receive")
461
+ }
462
+ },
463
+ async ({ email, role }) => {
464
+ try {
465
+ const result = await client2.invitations.create({ email, role });
466
+ return {
467
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
468
+ };
469
+ } catch (err) {
470
+ return toMcpError(err);
471
+ }
472
+ }
473
+ );
474
+ server2.registerTool(
475
+ "list_invitations",
476
+ {
477
+ description: "List invitations (pending, accepted, revoked) with their tokens, roles and expiry. Requires an admin token.",
478
+ inputSchema: {}
479
+ },
480
+ async () => {
481
+ try {
482
+ const result = await client2.invitations.list();
483
+ return {
484
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
485
+ };
486
+ } catch (err) {
487
+ return toMcpError(err);
488
+ }
489
+ }
490
+ );
491
+ server2.registerTool(
492
+ "revoke_invitation",
493
+ {
494
+ description: "Revoke a pending invitation by its token so it can no longer be accepted. Requires an admin token.",
495
+ inputSchema: {
496
+ token: z5.string().describe("Invitation token to revoke")
497
+ },
498
+ annotations: { destructiveHint: true }
499
+ },
500
+ async ({ token }) => {
501
+ try {
502
+ await client2.invitations.revoke(token);
503
+ return {
504
+ content: [{ type: "text", text: "Invitation revoked." }]
505
+ };
506
+ } catch (err) {
507
+ return toMcpError(err);
508
+ }
509
+ }
510
+ );
511
+ server2.registerTool(
512
+ "list_project_members",
513
+ {
514
+ description: "List the members of a project with their per-project role (viewer/editor/admin). Requires global admin or project-admin access.",
515
+ inputSchema: {
516
+ project_id: z5.number().int().describe("Project ID")
517
+ }
518
+ },
519
+ async ({ project_id }) => {
520
+ try {
521
+ const result = await client2.members.list(project_id);
522
+ return {
523
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
524
+ };
525
+ } catch (err) {
526
+ return toMcpError(err);
527
+ }
528
+ }
529
+ );
530
+ server2.registerTool(
531
+ "set_project_member",
532
+ {
533
+ description: "Add a user to a project or change their per-project role. viewer = read issues/events; editor = also resolve/delete issues and update the project; admin = also delete the project and manage its members. Requires global admin or project-admin access.",
534
+ inputSchema: {
535
+ project_id: z5.number().int().describe("Project ID"),
536
+ user_id: z5.number().int().describe("User ID to add or update"),
537
+ role: z5.enum(["viewer", "editor", "admin"]).describe("Per-project role to assign")
538
+ }
539
+ },
540
+ async ({ project_id, user_id, role }) => {
541
+ try {
542
+ await client2.members.upsert(project_id, { user_id, role });
543
+ return {
544
+ content: [
545
+ {
546
+ type: "text",
547
+ text: `User ${user_id} is now ${role} on project ${project_id}.`
548
+ }
549
+ ]
550
+ };
551
+ } catch (err) {
552
+ return toMcpError(err);
553
+ }
554
+ }
555
+ );
556
+ server2.registerTool(
557
+ "remove_project_member",
558
+ {
559
+ description: "Remove a user's access to a project. The last project admin cannot be removed. Requires global admin or project-admin access.",
560
+ inputSchema: {
561
+ project_id: z5.number().int().describe("Project ID"),
562
+ user_id: z5.number().int().describe("User ID to remove from the project")
563
+ },
564
+ annotations: { destructiveHint: true }
565
+ },
566
+ async ({ project_id, user_id }) => {
567
+ try {
568
+ await client2.members.remove(project_id, user_id);
569
+ return {
570
+ content: [
571
+ {
572
+ type: "text",
573
+ text: `User ${user_id} removed from project ${project_id}.`
574
+ }
575
+ ]
576
+ };
577
+ } catch (err) {
578
+ return toMcpError(err);
579
+ }
580
+ }
581
+ );
582
+ }
583
+
584
+ // src/tools/tokens.ts
585
+ import { z as z6 } from "zod";
375
586
  function registerTokenTools(server2, client2) {
376
587
  server2.registerTool(
377
588
  "list_tokens",
@@ -395,7 +606,7 @@ function registerTokenTools(server2, client2) {
395
606
  {
396
607
  description: "Create a new API token. The full token value is returned ONCE \u2014 save it immediately.",
397
608
  inputSchema: {
398
- description: z5.string().min(1).describe("Human-readable label for this token")
609
+ description: z6.string().min(1).describe("Human-readable label for this token")
399
610
  }
400
611
  },
401
612
  async ({ description }) => {
@@ -414,7 +625,7 @@ function registerTokenTools(server2, client2) {
414
625
  {
415
626
  description: "Permanently revoke an API token. This action cannot be undone.",
416
627
  inputSchema: {
417
- token_id: z5.number().int().describe("Token ID to revoke")
628
+ token_id: z6.number().int().describe("Token ID to revoke")
418
629
  },
419
630
  annotations: { destructiveHint: true }
420
631
  },
@@ -444,6 +655,8 @@ function createServer(client2) {
444
655
  registerEventTools(server2, client2);
445
656
  registerTokenTools(server2, client2);
446
657
  registerAlertTools(server2, client2);
658
+ registerTeamTools(server2, client2);
659
+ registerHealthTools(server2, client2);
447
660
  return server2;
448
661
  }
449
662
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rustrak/mcp",
3
- "version": "0.1.5",
3
+ "version": "0.2.1",
4
4
  "description": "MCP server that gives AI assistants (Claude, Cursor, Continue) full control of your Rustrak error tracking",
5
5
  "homepage": "https://rustrak.github.io/rustrak/sdks/mcp",
6
6
  "repository": {
@@ -51,7 +51,7 @@
51
51
  "dependencies": {
52
52
  "@modelcontextprotocol/sdk": "1.29.0",
53
53
  "zod": "4.4.3",
54
- "@rustrak/client": "0.2.2"
54
+ "@rustrak/client": "0.3.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "25.8.0",