@shortcut/mcp 0.3.0 → 0.4.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 +86 -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.1";
21308
21329
 
21309
21330
  // src/tools/base.ts
21310
21331
  class BaseTools {
@@ -21442,6 +21463,12 @@ 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
+ owner: z.string().optional().describe("The user ID of the owner of the epic"),
21469
+ description: z.string().optional().describe("A description of the epic"),
21470
+ team: z.string().optional().describe("The ID of a team to assign the epic to")
21471
+ }, async (params) => await tools.createEpic(params));
21445
21472
  return tools;
21446
21473
  }
21447
21474
  async searchEpics(params) {
@@ -21476,6 +21503,20 @@ ${formatStats(epic.stats, showPoints)}
21476
21503
  Description:
21477
21504
  ${epic.description}`);
21478
21505
  }
21506
+ async createEpic({
21507
+ name: name2,
21508
+ owner,
21509
+ team: group_id,
21510
+ description
21511
+ }) {
21512
+ const epic = await this.client.createEpic({
21513
+ name: name2,
21514
+ group_id,
21515
+ owner_ids: owner ? [owner] : undefined,
21516
+ description
21517
+ });
21518
+ return this.toResult(`Epic created with ID: ${epic.id}.`);
21519
+ }
21479
21520
  }
21480
21521
 
21481
21522
  // src/tools/iterations.ts
@@ -21497,6 +21538,13 @@ class IterationTools extends BaseTools {
21497
21538
  startDate: date2,
21498
21539
  endDate: date2
21499
21540
  }, async (params) => await tools.searchIterations(params));
21541
+ server.tool("create-iteration", "Create a new Shortcut iteration", {
21542
+ name: z.string().describe("The name of the iteration"),
21543
+ startDate: z.string().describe("The start date of the iteration"),
21544
+ endDate: z.string().describe("The end date of the iteration"),
21545
+ team: z.string().optional().describe("The ID of a team to assign the iteration to"),
21546
+ description: z.string().optional().describe("A description of the iteration")
21547
+ }, async (params) => await tools.createIteration(params));
21500
21548
  return tools;
21501
21549
  }
21502
21550
  async getIterationStories(iterationPublicId) {
@@ -21538,6 +21586,24 @@ ${formatStats(iteration.stats, showPoints)}
21538
21586
  Description:
21539
21587
  ${iteration.description}`);
21540
21588
  }
21589
+ async createIteration({
21590
+ name: name2,
21591
+ startDate,
21592
+ endDate,
21593
+ team,
21594
+ description
21595
+ }) {
21596
+ const iteration = await this.client.createIteration({
21597
+ name: name2,
21598
+ start_date: startDate,
21599
+ end_date: endDate,
21600
+ group_ids: team ? [team] : undefined,
21601
+ description
21602
+ });
21603
+ if (!iteration)
21604
+ throw new Error(`Failed to create the iteration.`);
21605
+ return this.toResult(`Iteration created with ID: ${iteration.id}.`);
21606
+ }
21541
21607
  }
21542
21608
 
21543
21609
  // src/tools/objectives.ts
@@ -21675,6 +21741,10 @@ The story will be added to the default state for the workflow.
21675
21741
  server.tool("unassign-current-user-as-owner", "Unassign the current user as the owner of a story", {
21676
21742
  storyPublicId: z.number().positive().describe("The public ID of the story")
21677
21743
  }, async ({ storyPublicId }) => await tools.unassignCurrentUserAsOwner(storyPublicId));
21744
+ server.tool("create-story-comment", "Create a comment on a story", {
21745
+ storyPublicId: z.number().positive().describe("The public ID of the story"),
21746
+ text: z.string().min(1).describe("The text of the comment")
21747
+ }, async (params) => await tools.createStoryComment(params));
21678
21748
  return tools;
21679
21749
  }
21680
21750
  async assignCurrentUserAsOwner(storyPublicId) {
@@ -21803,6 +21873,20 @@ ${comment.text || ""}`;
21803
21873
 
21804
21874
  `)}`);
21805
21875
  }
21876
+ async createStoryComment({
21877
+ storyPublicId,
21878
+ text
21879
+ }) {
21880
+ if (!storyPublicId)
21881
+ throw new Error("Story public ID is required");
21882
+ if (!text)
21883
+ throw new Error("Story comment text is required");
21884
+ const story = await this.client.getStory(storyPublicId);
21885
+ if (!story)
21886
+ throw new Error(`Failed to retrieve Shortcut story with public ID: ${storyPublicId}`);
21887
+ const storyComment = await this.client.createStoryComment(storyPublicId, { text });
21888
+ return this.toResult(`Created comment on story sc-${storyPublicId}. Comment URL: ${storyComment.app_url}.`);
21889
+ }
21806
21890
  }
21807
21891
 
21808
21892
  // src/tools/teams.ts
@@ -21894,7 +21978,7 @@ Default State: ${workflow.states.find((state) => state.id === workflow.default_s
21894
21978
 
21895
21979
  // src/server.ts
21896
21980
  var apiToken = process.env.SHORTCUT_API_TOKEN;
21897
- if (process.argv.length > 2) {
21981
+ if (process.argv.length === 3) {
21898
21982
  const [name2, token] = String(process.argv[2]).split("=");
21899
21983
  if (name2 === "SHORTCUT_API_TOKEN")
21900
21984
  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.1",
12
12
  "type": "module",
13
13
  "main": "dist/index.js",
14
14
  "bin": {