@rustrak/mcp 0.1.4 → 0.2.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 (2) hide show
  1. package/dist/index.js +196 -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
  };
@@ -370,8 +370,198 @@ function registerProjectTools(server2, client2) {
370
370
  );
371
371
  }
372
372
 
373
- // src/tools/tokens.ts
373
+ // src/tools/team.ts
374
374
  import { z as z5 } from "zod";
375
+ function registerTeamTools(server2, client2) {
376
+ server2.registerTool(
377
+ "list_team_members",
378
+ {
379
+ description: "List all users on this Rustrak instance with their global role (admin/member) and status. Requires an admin token.",
380
+ inputSchema: {}
381
+ },
382
+ async () => {
383
+ try {
384
+ const result = await client2.team.list();
385
+ return {
386
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
387
+ };
388
+ } catch (err) {
389
+ return toMcpError(err);
390
+ }
391
+ }
392
+ );
393
+ server2.registerTool(
394
+ "update_member_role",
395
+ {
396
+ 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.",
397
+ inputSchema: {
398
+ user_id: z5.number().int().describe("User ID to update"),
399
+ role: z5.enum(["admin", "member"]).describe("New global role for the user")
400
+ }
401
+ },
402
+ async ({ user_id, role }) => {
403
+ try {
404
+ await client2.team.updateRole(user_id, role);
405
+ return {
406
+ content: [{ type: "text", text: `User ${user_id} is now ${role}.` }]
407
+ };
408
+ } catch (err) {
409
+ return toMcpError(err);
410
+ }
411
+ }
412
+ );
413
+ server2.registerTool(
414
+ "remove_team_member",
415
+ {
416
+ 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.",
417
+ inputSchema: {
418
+ user_id: z5.number().int().describe("User ID to remove")
419
+ },
420
+ annotations: { destructiveHint: true }
421
+ },
422
+ async ({ user_id }) => {
423
+ try {
424
+ await client2.team.remove(user_id);
425
+ return {
426
+ content: [{ type: "text", text: `User ${user_id} removed.` }]
427
+ };
428
+ } catch (err) {
429
+ return toMcpError(err);
430
+ }
431
+ }
432
+ );
433
+ server2.registerTool(
434
+ "create_invitation",
435
+ {
436
+ 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.",
437
+ inputSchema: {
438
+ email: z5.string().email().describe("Email address of the invitee"),
439
+ role: z5.enum(["admin", "member"]).describe("Global role the invited user will receive")
440
+ }
441
+ },
442
+ async ({ email, role }) => {
443
+ try {
444
+ const result = await client2.invitations.create({ email, role });
445
+ return {
446
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
447
+ };
448
+ } catch (err) {
449
+ return toMcpError(err);
450
+ }
451
+ }
452
+ );
453
+ server2.registerTool(
454
+ "list_invitations",
455
+ {
456
+ description: "List invitations (pending, accepted, revoked) with their tokens, roles and expiry. Requires an admin token.",
457
+ inputSchema: {}
458
+ },
459
+ async () => {
460
+ try {
461
+ const result = await client2.invitations.list();
462
+ return {
463
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
464
+ };
465
+ } catch (err) {
466
+ return toMcpError(err);
467
+ }
468
+ }
469
+ );
470
+ server2.registerTool(
471
+ "revoke_invitation",
472
+ {
473
+ description: "Revoke a pending invitation by its token so it can no longer be accepted. Requires an admin token.",
474
+ inputSchema: {
475
+ token: z5.string().describe("Invitation token to revoke")
476
+ },
477
+ annotations: { destructiveHint: true }
478
+ },
479
+ async ({ token }) => {
480
+ try {
481
+ await client2.invitations.revoke(token);
482
+ return {
483
+ content: [{ type: "text", text: "Invitation revoked." }]
484
+ };
485
+ } catch (err) {
486
+ return toMcpError(err);
487
+ }
488
+ }
489
+ );
490
+ server2.registerTool(
491
+ "list_project_members",
492
+ {
493
+ description: "List the members of a project with their per-project role (viewer/editor/admin). Requires global admin or project-admin access.",
494
+ inputSchema: {
495
+ project_id: z5.number().int().describe("Project ID")
496
+ }
497
+ },
498
+ async ({ project_id }) => {
499
+ try {
500
+ const result = await client2.members.list(project_id);
501
+ return {
502
+ content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
503
+ };
504
+ } catch (err) {
505
+ return toMcpError(err);
506
+ }
507
+ }
508
+ );
509
+ server2.registerTool(
510
+ "set_project_member",
511
+ {
512
+ 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.",
513
+ inputSchema: {
514
+ project_id: z5.number().int().describe("Project ID"),
515
+ user_id: z5.number().int().describe("User ID to add or update"),
516
+ role: z5.enum(["viewer", "editor", "admin"]).describe("Per-project role to assign")
517
+ }
518
+ },
519
+ async ({ project_id, user_id, role }) => {
520
+ try {
521
+ await client2.members.upsert(project_id, { user_id, role });
522
+ return {
523
+ content: [
524
+ {
525
+ type: "text",
526
+ text: `User ${user_id} is now ${role} on project ${project_id}.`
527
+ }
528
+ ]
529
+ };
530
+ } catch (err) {
531
+ return toMcpError(err);
532
+ }
533
+ }
534
+ );
535
+ server2.registerTool(
536
+ "remove_project_member",
537
+ {
538
+ description: "Remove a user's access to a project. The last project admin cannot be removed. Requires global admin or project-admin access.",
539
+ inputSchema: {
540
+ project_id: z5.number().int().describe("Project ID"),
541
+ user_id: z5.number().int().describe("User ID to remove from the project")
542
+ },
543
+ annotations: { destructiveHint: true }
544
+ },
545
+ async ({ project_id, user_id }) => {
546
+ try {
547
+ await client2.members.remove(project_id, user_id);
548
+ return {
549
+ content: [
550
+ {
551
+ type: "text",
552
+ text: `User ${user_id} removed from project ${project_id}.`
553
+ }
554
+ ]
555
+ };
556
+ } catch (err) {
557
+ return toMcpError(err);
558
+ }
559
+ }
560
+ );
561
+ }
562
+
563
+ // src/tools/tokens.ts
564
+ import { z as z6 } from "zod";
375
565
  function registerTokenTools(server2, client2) {
376
566
  server2.registerTool(
377
567
  "list_tokens",
@@ -395,7 +585,7 @@ function registerTokenTools(server2, client2) {
395
585
  {
396
586
  description: "Create a new API token. The full token value is returned ONCE \u2014 save it immediately.",
397
587
  inputSchema: {
398
- description: z5.string().min(1).describe("Human-readable label for this token")
588
+ description: z6.string().min(1).describe("Human-readable label for this token")
399
589
  }
400
590
  },
401
591
  async ({ description }) => {
@@ -414,7 +604,7 @@ function registerTokenTools(server2, client2) {
414
604
  {
415
605
  description: "Permanently revoke an API token. This action cannot be undone.",
416
606
  inputSchema: {
417
- token_id: z5.number().int().describe("Token ID to revoke")
607
+ token_id: z6.number().int().describe("Token ID to revoke")
418
608
  },
419
609
  annotations: { destructiveHint: true }
420
610
  },
@@ -444,6 +634,7 @@ function createServer(client2) {
444
634
  registerEventTools(server2, client2);
445
635
  registerTokenTools(server2, client2);
446
636
  registerAlertTools(server2, client2);
637
+ registerTeamTools(server2, client2);
447
638
  return server2;
448
639
  }
449
640
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rustrak/mcp",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
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.1"
54
+ "@rustrak/client": "0.3.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "25.8.0",