@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/index.js CHANGED
@@ -37,7 +37,7 @@ var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
37
37
  var import_stdio = require("@modelcontextprotocol/sdk/server/stdio.js");
38
38
 
39
39
  // src/version.ts
40
- var VERSION = "0.2.2";
40
+ var VERSION = "0.2.4";
41
41
 
42
42
  // src/index.ts
43
43
  var import_zod3 = require("zod");
@@ -411,7 +411,8 @@ var ListProjectsInputSchema = import_zod2.z.object({
411
411
  var ListTasksInputSchema = import_zod2.z.object({
412
412
  projectId: import_zod2.z.string().optional(),
413
413
  state: import_zod2.z.nativeEnum(TaskState).optional(),
414
- assigneeId: import_zod2.z.string().optional()
414
+ assigneeId: import_zod2.z.string().optional(),
415
+ includeArchived: import_zod2.z.boolean().optional()
415
416
  });
416
417
  var cuidOrPrefixedId = import_zod2.z.string().regex(/^([a-z0-9]+|[a-z]+_[a-zA-Z0-9]+)$/);
417
418
  var GetTaskInputSchema = import_zod2.z.object({
@@ -452,12 +453,41 @@ var AbandonTaskInputSchema = import_zod2.z.object({
452
453
  taskId: cuidOrPrefixedId,
453
454
  deleteBranch: import_zod2.z.boolean().optional()
454
455
  });
456
+ var RequestChangesInputSchema = import_zod2.z.object({
457
+ projectId: cuidOrPrefixedId,
458
+ taskId: cuidOrPrefixedId,
459
+ reviewComments: import_zod2.z.string().min(1).max(5e3),
460
+ requestedChanges: import_zod2.z.array(import_zod2.z.string().min(1).max(500)).optional()
461
+ });
462
+ var ApproveTaskInputSchema = import_zod2.z.object({
463
+ projectId: cuidOrPrefixedId,
464
+ taskId: cuidOrPrefixedId,
465
+ reviewComments: import_zod2.z.string().max(2e3).optional()
466
+ });
467
+ var ArchiveTaskInputSchema = import_zod2.z.object({
468
+ projectId: cuidOrPrefixedId,
469
+ taskId: cuidOrPrefixedId
470
+ });
471
+ var UnarchiveTaskInputSchema = import_zod2.z.object({
472
+ projectId: cuidOrPrefixedId,
473
+ taskId: cuidOrPrefixedId
474
+ });
455
475
  var CreatePersonalProjectInputSchema = import_zod2.z.object({
456
476
  name: import_zod2.z.string().min(1).max(100),
457
477
  description: import_zod2.z.string().max(500).optional(),
458
478
  repositoryUrl: import_zod2.z.string().url()
459
479
  });
460
480
  var CheckActiveTaskInputSchema = import_zod2.z.object({});
481
+ var CreateTaskMCPInputSchema = import_zod2.z.object({
482
+ projectId: cuidOrPrefixedId,
483
+ epicId: cuidOrPrefixedId.nullable().optional(),
484
+ title: import_zod2.z.string().min(1).max(200),
485
+ description: import_zod2.z.string().max(5e3),
486
+ priority: import_zod2.z.nativeEnum(TaskPriority).default(TaskPriority.MEDIUM),
487
+ acceptanceCriteria: import_zod2.z.array(import_zod2.z.object({
488
+ description: import_zod2.z.string().min(1).max(500)
489
+ })).min(1)
490
+ });
461
491
  var CreateOrganizationInputSchema = import_zod2.z.object({
462
492
  name: import_zod2.z.string().min(1).max(255),
463
493
  slug: import_zod2.z.string().min(1).max(100).regex(/^[a-z0-9-]+$/).optional()
@@ -995,6 +1025,12 @@ var MCPApiClient = class {
995
1025
  { name, description, repositoryUrl }
996
1026
  );
997
1027
  }
1028
+ /**
1029
+ * Create a task in a project
1030
+ */
1031
+ async createTask(input) {
1032
+ return this.request("POST", "/api/mcp/tasks", input);
1033
+ }
998
1034
  /**
999
1035
  * List tasks with optional filters
1000
1036
  */
@@ -1003,6 +1039,7 @@ var MCPApiClient = class {
1003
1039
  if (filters.projectId) params.set("projectId", filters.projectId);
1004
1040
  if (filters.state) params.set("state", filters.state);
1005
1041
  if (filters.assigneeId) params.set("assigneeId", filters.assigneeId);
1042
+ if (filters.includeArchived) params.set("includeArchived", "true");
1006
1043
  const queryString = params.toString();
1007
1044
  const path = queryString ? `/api/mcp/tasks?${queryString}` : "/api/mcp/tasks";
1008
1045
  return this.request("GET", path);
@@ -1047,6 +1084,22 @@ var MCPApiClient = class {
1047
1084
  deleteBranch
1048
1085
  });
1049
1086
  }
1087
+ /**
1088
+ * Archive a task (soft delete)
1089
+ */
1090
+ async archiveTask(taskId, projectId) {
1091
+ return this.request("POST", `/api/mcp/tasks/${taskId}/archive`, {
1092
+ projectId
1093
+ });
1094
+ }
1095
+ /**
1096
+ * Unarchive a task (restore)
1097
+ */
1098
+ async unarchiveTask(taskId, projectId) {
1099
+ return this.request("DELETE", `/api/mcp/tasks/${taskId}/archive`, {
1100
+ projectId
1101
+ });
1102
+ }
1050
1103
  /**
1051
1104
  * Report task error
1052
1105
  */
@@ -1063,6 +1116,25 @@ var MCPApiClient = class {
1063
1116
  async addNote(taskId, content) {
1064
1117
  return this.request("POST", `/api/mcp/tasks/${taskId}/notes`, { content });
1065
1118
  }
1119
+ /**
1120
+ * Request changes on a task in review
1121
+ */
1122
+ async requestChanges(taskId, projectId, reviewComments, requestedChanges) {
1123
+ return this.request("POST", `/api/mcp/tasks/${taskId}/request-changes`, {
1124
+ projectId,
1125
+ reviewComments,
1126
+ requestedChanges
1127
+ });
1128
+ }
1129
+ /**
1130
+ * Approve a task in review and mark as DONE
1131
+ */
1132
+ async approveTask(taskId, projectId, reviewComments) {
1133
+ return this.request("POST", `/api/mcp/tasks/${taskId}/approve`, {
1134
+ projectId,
1135
+ reviewComments
1136
+ });
1137
+ }
1066
1138
  /**
1067
1139
  * Get GitHub token
1068
1140
  */
@@ -1168,7 +1240,8 @@ async function createMCPServer() {
1168
1240
  inputSchema: {
1169
1241
  projectId: import_zod3.z.string().optional().describe("Filter by project ID"),
1170
1242
  state: import_zod3.z.nativeEnum(TaskState).optional().describe("Filter by task state"),
1171
- assigneeId: import_zod3.z.string().optional().describe("Filter by assignee ID")
1243
+ assigneeId: import_zod3.z.string().optional().describe("Filter by assignee ID"),
1244
+ includeArchived: import_zod3.z.boolean().optional().describe("Include archived tasks (default: false)")
1172
1245
  }
1173
1246
  },
1174
1247
  async (args) => {
@@ -1178,7 +1251,8 @@ async function createMCPServer() {
1178
1251
  const tasks = await apiClient.listTasks({
1179
1252
  projectId: validated.projectId,
1180
1253
  state: validated.state,
1181
- assigneeId: validated.assigneeId
1254
+ assigneeId: validated.assigneeId,
1255
+ includeArchived: validated.includeArchived
1182
1256
  });
1183
1257
  return {
1184
1258
  content: [
@@ -1486,6 +1560,74 @@ async function createMCPServer() {
1486
1560
  }
1487
1561
  }
1488
1562
  );
1563
+ server.registerTool(
1564
+ "archive_task",
1565
+ {
1566
+ description: "Archive a task (soft delete). Task can be restored later.",
1567
+ inputSchema: {
1568
+ projectId: import_zod3.z.string().describe("The project ID"),
1569
+ taskId: import_zod3.z.string().describe("The task ID to archive")
1570
+ }
1571
+ },
1572
+ async (args) => {
1573
+ assertApiKeyPermission(
1574
+ mockApiKey,
1575
+ ApiKeyPermission.WRITE,
1576
+ "archive_task"
1577
+ );
1578
+ const validated = ArchiveTaskInputSchema.parse(args);
1579
+ try {
1580
+ const result = await apiClient.archiveTask(
1581
+ validated.taskId,
1582
+ validated.projectId
1583
+ );
1584
+ return {
1585
+ content: [
1586
+ {
1587
+ type: "text",
1588
+ text: JSON.stringify(result, null, 2)
1589
+ }
1590
+ ]
1591
+ };
1592
+ } catch (error) {
1593
+ return handleApiError(error);
1594
+ }
1595
+ }
1596
+ );
1597
+ server.registerTool(
1598
+ "unarchive_task",
1599
+ {
1600
+ description: "Restore an archived task",
1601
+ inputSchema: {
1602
+ projectId: import_zod3.z.string().describe("The project ID"),
1603
+ taskId: import_zod3.z.string().describe("The task ID to restore")
1604
+ }
1605
+ },
1606
+ async (args) => {
1607
+ assertApiKeyPermission(
1608
+ mockApiKey,
1609
+ ApiKeyPermission.WRITE,
1610
+ "unarchive_task"
1611
+ );
1612
+ const validated = UnarchiveTaskInputSchema.parse(args);
1613
+ try {
1614
+ const result = await apiClient.unarchiveTask(
1615
+ validated.taskId,
1616
+ validated.projectId
1617
+ );
1618
+ return {
1619
+ content: [
1620
+ {
1621
+ type: "text",
1622
+ text: JSON.stringify(result, null, 2)
1623
+ }
1624
+ ]
1625
+ };
1626
+ } catch (error) {
1627
+ return handleApiError(error);
1628
+ }
1629
+ }
1630
+ );
1489
1631
  server.registerTool(
1490
1632
  "create_personal_project",
1491
1633
  {
@@ -1522,6 +1664,126 @@ async function createMCPServer() {
1522
1664
  }
1523
1665
  }
1524
1666
  );
1667
+ server.registerTool(
1668
+ "create_task",
1669
+ {
1670
+ description: "Create a new task in a project. Requires WRITE permission and project access.",
1671
+ inputSchema: {
1672
+ projectId: import_zod3.z.string().describe("The project ID to create the task in"),
1673
+ epicId: import_zod3.z.string().nullable().optional().describe("Optional epic ID to associate the task with"),
1674
+ title: import_zod3.z.string().describe("Task title (max 200 chars)"),
1675
+ description: import_zod3.z.string().describe("Task description (max 5000 chars)"),
1676
+ priority: import_zod3.z.nativeEnum(TaskPriority).optional().describe("Task priority: LOW, MEDIUM, HIGH, CRITICAL (default: MEDIUM)"),
1677
+ acceptanceCriteria: import_zod3.z.array(
1678
+ import_zod3.z.object({
1679
+ description: import_zod3.z.string().describe("Acceptance criterion description (max 500 chars)")
1680
+ })
1681
+ ).describe("Array of acceptance criteria (at least 1 required)")
1682
+ }
1683
+ },
1684
+ async (args) => {
1685
+ assertApiKeyPermission(
1686
+ mockApiKey,
1687
+ ApiKeyPermission.WRITE,
1688
+ "create_task"
1689
+ );
1690
+ const validated = CreateTaskMCPInputSchema.parse(args);
1691
+ try {
1692
+ const result = await apiClient.createTask({
1693
+ projectId: validated.projectId,
1694
+ epicId: validated.epicId,
1695
+ title: validated.title,
1696
+ description: validated.description,
1697
+ priority: validated.priority,
1698
+ acceptanceCriteria: validated.acceptanceCriteria
1699
+ });
1700
+ return {
1701
+ content: [
1702
+ {
1703
+ type: "text",
1704
+ text: JSON.stringify(result, null, 2)
1705
+ }
1706
+ ]
1707
+ };
1708
+ } catch (error) {
1709
+ return handleApiError(error);
1710
+ }
1711
+ }
1712
+ );
1713
+ server.registerTool(
1714
+ "request_changes",
1715
+ {
1716
+ description: "Submit review comments requesting changes on a task in REVIEW state",
1717
+ inputSchema: {
1718
+ projectId: import_zod3.z.string().describe("The project ID"),
1719
+ taskId: import_zod3.z.string().describe("The task ID to review"),
1720
+ reviewComments: import_zod3.z.string().describe("Review comments explaining requested changes (max 5000 chars)"),
1721
+ requestedChanges: import_zod3.z.array(import_zod3.z.string()).optional().describe("List of specific changes requested")
1722
+ }
1723
+ },
1724
+ async (args) => {
1725
+ assertApiKeyPermission(
1726
+ mockApiKey,
1727
+ ApiKeyPermission.WRITE,
1728
+ "request_changes"
1729
+ );
1730
+ const validated = RequestChangesInputSchema.parse(args);
1731
+ try {
1732
+ const result = await apiClient.requestChanges(
1733
+ validated.taskId,
1734
+ validated.projectId,
1735
+ validated.reviewComments,
1736
+ validated.requestedChanges
1737
+ );
1738
+ return {
1739
+ content: [
1740
+ {
1741
+ type: "text",
1742
+ text: JSON.stringify(result, null, 2)
1743
+ }
1744
+ ]
1745
+ };
1746
+ } catch (error) {
1747
+ return handleApiError(error);
1748
+ }
1749
+ }
1750
+ );
1751
+ server.registerTool(
1752
+ "approve_task",
1753
+ {
1754
+ description: "Approve a task in REVIEW state and mark it as DONE",
1755
+ inputSchema: {
1756
+ projectId: import_zod3.z.string().describe("The project ID"),
1757
+ taskId: import_zod3.z.string().describe("The task ID to approve"),
1758
+ reviewComments: import_zod3.z.string().optional().describe("Optional approval comments (max 2000 chars)")
1759
+ }
1760
+ },
1761
+ async (args) => {
1762
+ assertApiKeyPermission(
1763
+ mockApiKey,
1764
+ ApiKeyPermission.WRITE,
1765
+ "approve_task"
1766
+ );
1767
+ const validated = ApproveTaskInputSchema.parse(args);
1768
+ try {
1769
+ const result = await apiClient.approveTask(
1770
+ validated.taskId,
1771
+ validated.projectId,
1772
+ validated.reviewComments
1773
+ );
1774
+ return {
1775
+ content: [
1776
+ {
1777
+ type: "text",
1778
+ text: JSON.stringify(result, null, 2)
1779
+ }
1780
+ ]
1781
+ };
1782
+ } catch (error) {
1783
+ return handleApiError(error);
1784
+ }
1785
+ }
1786
+ );
1525
1787
  server.registerTool(
1526
1788
  "get_version",
1527
1789
  {