@shortcut/mcp 0.3.0 → 0.4.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 +89 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -14761,6 +14761,27 @@ class ShortcutClientWrapper {
14761
14761
  return { stories: null, total: null };
14762
14762
  return { stories, total: stories.length };
14763
14763
  }
14764
+ async createStoryComment(storyPublicId, params) {
14765
+ const response = await this.client.createStoryComment(storyPublicId, params);
14766
+ const storyComment = response?.data ?? null;
14767
+ if (!storyComment)
14768
+ throw new Error(`Failed to create the comment: ${response.status}`);
14769
+ return storyComment;
14770
+ }
14771
+ async createIteration(params) {
14772
+ const response = await this.client.createIteration(params);
14773
+ const iteration = response?.data ?? null;
14774
+ if (!iteration)
14775
+ throw new Error(`Failed to create the iteration: ${response.status}`);
14776
+ return iteration;
14777
+ }
14778
+ async createEpic(params) {
14779
+ const response = await this.client.createEpic(params);
14780
+ const epic = response?.data ?? null;
14781
+ if (!epic)
14782
+ throw new Error(`Failed to create the epic: ${response.status}`);
14783
+ return epic;
14784
+ }
14764
14785
  }
14765
14786
 
14766
14787
  // node_modules/zod/lib/index.mjs
@@ -21304,7 +21325,7 @@ var import_client = __toESM(require_lib(), 1);
21304
21325
 
21305
21326
  // package.json
21306
21327
  var name = "@shortcut/mcp";
21307
- var version = "0.3.0";
21328
+ var version = "0.4.0";
21308
21329
 
21309
21330
  // src/tools/base.ts
21310
21331
  class BaseTools {
@@ -21442,6 +21463,11 @@ class EpicTools extends BaseTools {
21442
21463
  completed: date2,
21443
21464
  due: date2
21444
21465
  }, async (params) => await tools.searchEpics(params));
21466
+ server.tool("create-epic", "Create a new Shortcut epic.", {
21467
+ name: z.string().describe("The name of the epic"),
21468
+ teamId: z.string().optional().describe("The ID of the team to assign the epic to"),
21469
+ description: z.string().optional().describe("The description of the epic")
21470
+ }, async (params) => await tools.createEpic(params));
21445
21471
  return tools;
21446
21472
  }
21447
21473
  async searchEpics(params) {
@@ -21476,6 +21502,19 @@ ${formatStats(epic.stats, showPoints)}
21476
21502
  Description:
21477
21503
  ${epic.description}`);
21478
21504
  }
21505
+ async createEpic({
21506
+ name: name2,
21507
+ teamId,
21508
+ description
21509
+ }) {
21510
+ if (teamId) {
21511
+ const team = await this.client.getTeam(teamId);
21512
+ if (!team)
21513
+ throw new Error(`Team with ID ${teamId} not found`);
21514
+ }
21515
+ const epic = await this.client.createEpic({ name: name2, group_id: teamId, description });
21516
+ return this.toResult(`Epic created with ID: ${epic.id}.`);
21517
+ }
21479
21518
  }
21480
21519
 
21481
21520
  // src/tools/iterations.ts
@@ -21497,6 +21536,13 @@ class IterationTools extends BaseTools {
21497
21536
  startDate: date2,
21498
21537
  endDate: date2
21499
21538
  }, async (params) => await tools.searchIterations(params));
21539
+ server.tool("create-iteration", "Create a new Shortcut iteration", {
21540
+ name: z.string().describe("The name of the iteration"),
21541
+ description: z.string().optional().describe("The description of the iteration"),
21542
+ startDate: z.string().describe("The start date of the iteration"),
21543
+ endDate: z.string().describe("The end date of the iteration"),
21544
+ teamId: z.string().optional().describe("The ID of the team to assign the iteration to")
21545
+ }, async (params) => await tools.createIteration(params));
21500
21546
  return tools;
21501
21547
  }
21502
21548
  async getIterationStories(iterationPublicId) {
@@ -21538,6 +21584,29 @@ ${formatStats(iteration.stats, showPoints)}
21538
21584
  Description:
21539
21585
  ${iteration.description}`);
21540
21586
  }
21587
+ async createIteration({
21588
+ name: name2,
21589
+ startDate,
21590
+ endDate,
21591
+ teamId,
21592
+ description
21593
+ }) {
21594
+ if (teamId) {
21595
+ const team = await this.client.getTeam(teamId);
21596
+ if (!team)
21597
+ throw new Error(`Team with ID ${teamId} not found`);
21598
+ }
21599
+ const iteration = await this.client.createIteration({
21600
+ name: name2,
21601
+ start_date: startDate,
21602
+ end_date: endDate,
21603
+ group_ids: teamId ? [teamId] : undefined,
21604
+ description
21605
+ });
21606
+ if (!iteration)
21607
+ throw new Error(`Failed to create the iteration.`);
21608
+ return this.toResult(`Iteration created with ID: ${iteration.id}.`);
21609
+ }
21541
21610
  }
21542
21611
 
21543
21612
  // src/tools/objectives.ts
@@ -21675,6 +21744,10 @@ The story will be added to the default state for the workflow.
21675
21744
  server.tool("unassign-current-user-as-owner", "Unassign the current user as the owner of a story", {
21676
21745
  storyPublicId: z.number().positive().describe("The public ID of the story")
21677
21746
  }, async ({ storyPublicId }) => await tools.unassignCurrentUserAsOwner(storyPublicId));
21747
+ server.tool("create-story-comment", "Create a comment on a story", {
21748
+ storyPublicId: z.number().positive().describe("The public ID of the story"),
21749
+ text: z.string().min(1).describe("The text of the comment")
21750
+ }, async (params) => await tools.createStoryComment(params));
21678
21751
  return tools;
21679
21752
  }
21680
21753
  async assignCurrentUserAsOwner(storyPublicId) {
@@ -21803,6 +21876,20 @@ ${comment.text || ""}`;
21803
21876
 
21804
21877
  `)}`);
21805
21878
  }
21879
+ async createStoryComment({
21880
+ storyPublicId,
21881
+ text
21882
+ }) {
21883
+ if (!storyPublicId)
21884
+ throw new Error("Story public ID is required");
21885
+ if (!text)
21886
+ throw new Error("Story comment text is required");
21887
+ const story = await this.client.getStory(storyPublicId);
21888
+ if (!story)
21889
+ throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}`);
21890
+ const storyComment = await this.client.createStoryComment(storyPublicId, { text });
21891
+ return this.toResult(`Created comment on story sc-${storyPublicId}. Comment URL: ${storyComment.app_url}.`);
21892
+ }
21806
21893
  }
21807
21894
 
21808
21895
  // src/tools/teams.ts
@@ -21894,7 +21981,7 @@ Default State: ${workflow.states.find((state) => state.id === workflow.default_s
21894
21981
 
21895
21982
  // src/server.ts
21896
21983
  var apiToken = process.env.SHORTCUT_API_TOKEN;
21897
- if (process.argv.length > 2) {
21984
+ if (process.argv.length === 3) {
21898
21985
  const [name2, token] = String(process.argv[2]).split("=");
21899
21986
  if (name2 === "SHORTCUT_API_TOKEN")
21900
21987
  apiToken = token;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "keywords": ["shortcut", "mcp", "modelcontextprotocol"],
10
10
  "license": "MIT",
11
- "version": "0.3.0",
11
+ "version": "0.4.0",
12
12
  "type": "module",
13
13
  "main": "dist/index.js",
14
14
  "bin": {