@mtaap/mcp 0.2.2 → 0.2.4

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.
package/dist/cli.js CHANGED
@@ -28,7 +28,7 @@ var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
28
28
  var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
29
29
 
30
30
  // src/version.ts
31
- var VERSION = "0.2.2";
31
+ var VERSION = "0.2.4";
32
32
 
33
33
  // src/index.ts
34
34
  var import_zod3 = require("zod");
@@ -402,7 +402,8 @@ var ListProjectsInputSchema = import_zod2.z.object({
402
402
  var ListTasksInputSchema = import_zod2.z.object({
403
403
  projectId: import_zod2.z.string().optional(),
404
404
  state: import_zod2.z.nativeEnum(TaskState).optional(),
405
- assigneeId: import_zod2.z.string().optional()
405
+ assigneeId: import_zod2.z.string().optional(),
406
+ includeArchived: import_zod2.z.boolean().optional()
406
407
  });
407
408
  var cuidOrPrefixedId = import_zod2.z.string().regex(/^([a-z0-9]+|[a-z]+_[a-zA-Z0-9]+)$/);
408
409
  var GetTaskInputSchema = import_zod2.z.object({
@@ -443,12 +444,41 @@ var AbandonTaskInputSchema = import_zod2.z.object({
443
444
  taskId: cuidOrPrefixedId,
444
445
  deleteBranch: import_zod2.z.boolean().optional()
445
446
  });
447
+ var RequestChangesInputSchema = import_zod2.z.object({
448
+ projectId: cuidOrPrefixedId,
449
+ taskId: cuidOrPrefixedId,
450
+ reviewComments: import_zod2.z.string().min(1).max(5e3),
451
+ requestedChanges: import_zod2.z.array(import_zod2.z.string().min(1).max(500)).optional()
452
+ });
453
+ var ApproveTaskInputSchema = import_zod2.z.object({
454
+ projectId: cuidOrPrefixedId,
455
+ taskId: cuidOrPrefixedId,
456
+ reviewComments: import_zod2.z.string().max(2e3).optional()
457
+ });
458
+ var ArchiveTaskInputSchema = import_zod2.z.object({
459
+ projectId: cuidOrPrefixedId,
460
+ taskId: cuidOrPrefixedId
461
+ });
462
+ var UnarchiveTaskInputSchema = import_zod2.z.object({
463
+ projectId: cuidOrPrefixedId,
464
+ taskId: cuidOrPrefixedId
465
+ });
446
466
  var CreatePersonalProjectInputSchema = import_zod2.z.object({
447
467
  name: import_zod2.z.string().min(1).max(100),
448
468
  description: import_zod2.z.string().max(500).optional(),
449
469
  repositoryUrl: import_zod2.z.string().url()
450
470
  });
451
471
  var CheckActiveTaskInputSchema = import_zod2.z.object({});
472
+ var CreateTaskMCPInputSchema = import_zod2.z.object({
473
+ projectId: cuidOrPrefixedId,
474
+ epicId: cuidOrPrefixedId.nullable().optional(),
475
+ title: import_zod2.z.string().min(1).max(200),
476
+ description: import_zod2.z.string().max(5e3),
477
+ priority: import_zod2.z.nativeEnum(TaskPriority).default(TaskPriority.MEDIUM),
478
+ acceptanceCriteria: import_zod2.z.array(import_zod2.z.object({
479
+ description: import_zod2.z.string().min(1).max(500)
480
+ })).min(1)
481
+ });
452
482
  var CreateOrganizationInputSchema = import_zod2.z.object({
453
483
  name: import_zod2.z.string().min(1).max(255),
454
484
  slug: import_zod2.z.string().min(1).max(100).regex(/^[a-z0-9-]+$/).optional()
@@ -986,6 +1016,12 @@ var MCPApiClient = class {
986
1016
  { name, description, repositoryUrl }
987
1017
  );
988
1018
  }
1019
+ /**
1020
+ * Create a task in a project
1021
+ */
1022
+ async createTask(input) {
1023
+ return this.request("POST", "/api/mcp/tasks", input);
1024
+ }
989
1025
  /**
990
1026
  * List tasks with optional filters
991
1027
  */
@@ -994,6 +1030,7 @@ var MCPApiClient = class {
994
1030
  if (filters.projectId) params.set("projectId", filters.projectId);
995
1031
  if (filters.state) params.set("state", filters.state);
996
1032
  if (filters.assigneeId) params.set("assigneeId", filters.assigneeId);
1033
+ if (filters.includeArchived) params.set("includeArchived", "true");
997
1034
  const queryString = params.toString();
998
1035
  const path = queryString ? `/api/mcp/tasks?${queryString}` : "/api/mcp/tasks";
999
1036
  return this.request("GET", path);
@@ -1038,6 +1075,22 @@ var MCPApiClient = class {
1038
1075
  deleteBranch
1039
1076
  });
1040
1077
  }
1078
+ /**
1079
+ * Archive a task (soft delete)
1080
+ */
1081
+ async archiveTask(taskId, projectId) {
1082
+ return this.request("POST", `/api/mcp/tasks/${taskId}/archive`, {
1083
+ projectId
1084
+ });
1085
+ }
1086
+ /**
1087
+ * Unarchive a task (restore)
1088
+ */
1089
+ async unarchiveTask(taskId, projectId) {
1090
+ return this.request("DELETE", `/api/mcp/tasks/${taskId}/archive`, {
1091
+ projectId
1092
+ });
1093
+ }
1041
1094
  /**
1042
1095
  * Report task error
1043
1096
  */
@@ -1054,6 +1107,25 @@ var MCPApiClient = class {
1054
1107
  async addNote(taskId, content) {
1055
1108
  return this.request("POST", `/api/mcp/tasks/${taskId}/notes`, { content });
1056
1109
  }
1110
+ /**
1111
+ * Request changes on a task in review
1112
+ */
1113
+ async requestChanges(taskId, projectId, reviewComments, requestedChanges) {
1114
+ return this.request("POST", `/api/mcp/tasks/${taskId}/request-changes`, {
1115
+ projectId,
1116
+ reviewComments,
1117
+ requestedChanges
1118
+ });
1119
+ }
1120
+ /**
1121
+ * Approve a task in review and mark as DONE
1122
+ */
1123
+ async approveTask(taskId, projectId, reviewComments) {
1124
+ return this.request("POST", `/api/mcp/tasks/${taskId}/approve`, {
1125
+ projectId,
1126
+ reviewComments
1127
+ });
1128
+ }
1057
1129
  /**
1058
1130
  * Get GitHub token
1059
1131
  */
@@ -1159,7 +1231,8 @@ async function createMCPServer() {
1159
1231
  inputSchema: {
1160
1232
  projectId: import_zod3.z.string().optional().describe("Filter by project ID"),
1161
1233
  state: import_zod3.z.nativeEnum(TaskState).optional().describe("Filter by task state"),
1162
- assigneeId: import_zod3.z.string().optional().describe("Filter by assignee ID")
1234
+ assigneeId: import_zod3.z.string().optional().describe("Filter by assignee ID"),
1235
+ includeArchived: import_zod3.z.boolean().optional().describe("Include archived tasks (default: false)")
1163
1236
  }
1164
1237
  },
1165
1238
  async (args) => {
@@ -1169,7 +1242,8 @@ async function createMCPServer() {
1169
1242
  const tasks = await apiClient.listTasks({
1170
1243
  projectId: validated.projectId,
1171
1244
  state: validated.state,
1172
- assigneeId: validated.assigneeId
1245
+ assigneeId: validated.assigneeId,
1246
+ includeArchived: validated.includeArchived
1173
1247
  });
1174
1248
  return {
1175
1249
  content: [
@@ -1477,6 +1551,74 @@ async function createMCPServer() {
1477
1551
  }
1478
1552
  }
1479
1553
  );
1554
+ server.registerTool(
1555
+ "archive_task",
1556
+ {
1557
+ description: "Archive a task (soft delete). Task can be restored later.",
1558
+ inputSchema: {
1559
+ projectId: import_zod3.z.string().describe("The project ID"),
1560
+ taskId: import_zod3.z.string().describe("The task ID to archive")
1561
+ }
1562
+ },
1563
+ async (args) => {
1564
+ assertApiKeyPermission(
1565
+ mockApiKey,
1566
+ ApiKeyPermission.WRITE,
1567
+ "archive_task"
1568
+ );
1569
+ const validated = ArchiveTaskInputSchema.parse(args);
1570
+ try {
1571
+ const result = await apiClient.archiveTask(
1572
+ validated.taskId,
1573
+ validated.projectId
1574
+ );
1575
+ return {
1576
+ content: [
1577
+ {
1578
+ type: "text",
1579
+ text: JSON.stringify(result, null, 2)
1580
+ }
1581
+ ]
1582
+ };
1583
+ } catch (error) {
1584
+ return handleApiError(error);
1585
+ }
1586
+ }
1587
+ );
1588
+ server.registerTool(
1589
+ "unarchive_task",
1590
+ {
1591
+ description: "Restore an archived task",
1592
+ inputSchema: {
1593
+ projectId: import_zod3.z.string().describe("The project ID"),
1594
+ taskId: import_zod3.z.string().describe("The task ID to restore")
1595
+ }
1596
+ },
1597
+ async (args) => {
1598
+ assertApiKeyPermission(
1599
+ mockApiKey,
1600
+ ApiKeyPermission.WRITE,
1601
+ "unarchive_task"
1602
+ );
1603
+ const validated = UnarchiveTaskInputSchema.parse(args);
1604
+ try {
1605
+ const result = await apiClient.unarchiveTask(
1606
+ validated.taskId,
1607
+ validated.projectId
1608
+ );
1609
+ return {
1610
+ content: [
1611
+ {
1612
+ type: "text",
1613
+ text: JSON.stringify(result, null, 2)
1614
+ }
1615
+ ]
1616
+ };
1617
+ } catch (error) {
1618
+ return handleApiError(error);
1619
+ }
1620
+ }
1621
+ );
1480
1622
  server.registerTool(
1481
1623
  "create_personal_project",
1482
1624
  {
@@ -1513,6 +1655,126 @@ async function createMCPServer() {
1513
1655
  }
1514
1656
  }
1515
1657
  );
1658
+ server.registerTool(
1659
+ "create_task",
1660
+ {
1661
+ description: "Create a new task in a project. Requires WRITE permission and project access.",
1662
+ inputSchema: {
1663
+ projectId: import_zod3.z.string().describe("The project ID to create the task in"),
1664
+ epicId: import_zod3.z.string().nullable().optional().describe("Optional epic ID to associate the task with"),
1665
+ title: import_zod3.z.string().describe("Task title (max 200 chars)"),
1666
+ description: import_zod3.z.string().describe("Task description (max 5000 chars)"),
1667
+ priority: import_zod3.z.nativeEnum(TaskPriority).optional().describe("Task priority: LOW, MEDIUM, HIGH, CRITICAL (default: MEDIUM)"),
1668
+ acceptanceCriteria: import_zod3.z.array(
1669
+ import_zod3.z.object({
1670
+ description: import_zod3.z.string().describe("Acceptance criterion description (max 500 chars)")
1671
+ })
1672
+ ).describe("Array of acceptance criteria (at least 1 required)")
1673
+ }
1674
+ },
1675
+ async (args) => {
1676
+ assertApiKeyPermission(
1677
+ mockApiKey,
1678
+ ApiKeyPermission.WRITE,
1679
+ "create_task"
1680
+ );
1681
+ const validated = CreateTaskMCPInputSchema.parse(args);
1682
+ try {
1683
+ const result = await apiClient.createTask({
1684
+ projectId: validated.projectId,
1685
+ epicId: validated.epicId,
1686
+ title: validated.title,
1687
+ description: validated.description,
1688
+ priority: validated.priority,
1689
+ acceptanceCriteria: validated.acceptanceCriteria
1690
+ });
1691
+ return {
1692
+ content: [
1693
+ {
1694
+ type: "text",
1695
+ text: JSON.stringify(result, null, 2)
1696
+ }
1697
+ ]
1698
+ };
1699
+ } catch (error) {
1700
+ return handleApiError(error);
1701
+ }
1702
+ }
1703
+ );
1704
+ server.registerTool(
1705
+ "request_changes",
1706
+ {
1707
+ description: "Submit review comments requesting changes on a task in REVIEW state",
1708
+ inputSchema: {
1709
+ projectId: import_zod3.z.string().describe("The project ID"),
1710
+ taskId: import_zod3.z.string().describe("The task ID to review"),
1711
+ reviewComments: import_zod3.z.string().describe("Review comments explaining requested changes (max 5000 chars)"),
1712
+ requestedChanges: import_zod3.z.array(import_zod3.z.string()).optional().describe("List of specific changes requested")
1713
+ }
1714
+ },
1715
+ async (args) => {
1716
+ assertApiKeyPermission(
1717
+ mockApiKey,
1718
+ ApiKeyPermission.WRITE,
1719
+ "request_changes"
1720
+ );
1721
+ const validated = RequestChangesInputSchema.parse(args);
1722
+ try {
1723
+ const result = await apiClient.requestChanges(
1724
+ validated.taskId,
1725
+ validated.projectId,
1726
+ validated.reviewComments,
1727
+ validated.requestedChanges
1728
+ );
1729
+ return {
1730
+ content: [
1731
+ {
1732
+ type: "text",
1733
+ text: JSON.stringify(result, null, 2)
1734
+ }
1735
+ ]
1736
+ };
1737
+ } catch (error) {
1738
+ return handleApiError(error);
1739
+ }
1740
+ }
1741
+ );
1742
+ server.registerTool(
1743
+ "approve_task",
1744
+ {
1745
+ description: "Approve a task in REVIEW state and mark it as DONE",
1746
+ inputSchema: {
1747
+ projectId: import_zod3.z.string().describe("The project ID"),
1748
+ taskId: import_zod3.z.string().describe("The task ID to approve"),
1749
+ reviewComments: import_zod3.z.string().optional().describe("Optional approval comments (max 2000 chars)")
1750
+ }
1751
+ },
1752
+ async (args) => {
1753
+ assertApiKeyPermission(
1754
+ mockApiKey,
1755
+ ApiKeyPermission.WRITE,
1756
+ "approve_task"
1757
+ );
1758
+ const validated = ApproveTaskInputSchema.parse(args);
1759
+ try {
1760
+ const result = await apiClient.approveTask(
1761
+ validated.taskId,
1762
+ validated.projectId,
1763
+ validated.reviewComments
1764
+ );
1765
+ return {
1766
+ content: [
1767
+ {
1768
+ type: "text",
1769
+ text: JSON.stringify(result, null, 2)
1770
+ }
1771
+ ]
1772
+ };
1773
+ } catch (error) {
1774
+ return handleApiError(error);
1775
+ }
1776
+ }
1777
+ );
1516
1778
  server.registerTool(
1517
1779
  "get_version",
1518
1780
  {