@shortcut/mcp 0.5.0 → 0.6.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.
- package/README.md +3 -3
- package/dist/index.js +25 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ See the [official Windsurf docs](https://codeium.com/docs/windsurf/mcp) for more
|
|
|
17
17
|
"command": "npx",
|
|
18
18
|
"args": [
|
|
19
19
|
"-y",
|
|
20
|
-
"@shortcut/mcp"
|
|
20
|
+
"@shortcut/mcp@latest"
|
|
21
21
|
],
|
|
22
22
|
"env": {
|
|
23
23
|
"SHORTCUT_API_TOKEN": "<YOUR_SHORTCUT_API_TOKEN>"
|
|
@@ -41,7 +41,7 @@ See the [official Cursor docs](https://docs.cursor.com/context/model-context-pro
|
|
|
41
41
|
"command": "npx",
|
|
42
42
|
"args": [
|
|
43
43
|
"-y",
|
|
44
|
-
"@shortcut/mcp"
|
|
44
|
+
"@shortcut/mcp@latest"
|
|
45
45
|
],
|
|
46
46
|
"env": {
|
|
47
47
|
"SHORTCUT_API_TOKEN": "<YOUR_SHORTCUT_API_TOKEN>"
|
|
@@ -68,7 +68,7 @@ _You can add a new MCP server from the Claude Code CLI. But modifying the json f
|
|
|
68
68
|
"command": "npx",
|
|
69
69
|
"args": [
|
|
70
70
|
"-y",
|
|
71
|
-
"@shortcut/mcp"
|
|
71
|
+
"@shortcut/mcp@latest"
|
|
72
72
|
],
|
|
73
73
|
"env": {
|
|
74
74
|
"SHORTCUT_API_TOKEN": "<YOUR_SHORTCUT_API_TOKEN>"
|
package/dist/index.js
CHANGED
|
@@ -14799,11 +14799,11 @@ class ShortcutClientWrapper {
|
|
|
14799
14799
|
throw new Error(`Failed to create the task: ${response.status}`);
|
|
14800
14800
|
return task;
|
|
14801
14801
|
}
|
|
14802
|
-
async addRelationToStory(storyPublicId, linkedStoryId) {
|
|
14802
|
+
async addRelationToStory(storyPublicId, linkedStoryId, verb) {
|
|
14803
14803
|
const response = await this.client.createStoryLink({
|
|
14804
14804
|
object_id: linkedStoryId,
|
|
14805
14805
|
subject_id: storyPublicId,
|
|
14806
|
-
verb
|
|
14806
|
+
verb
|
|
14807
14807
|
});
|
|
14808
14808
|
const storyLink = response?.data ?? null;
|
|
14809
14809
|
if (!storyLink)
|
|
@@ -21563,7 +21563,7 @@ var import_client = __toESM(require_lib(), 1);
|
|
|
21563
21563
|
|
|
21564
21564
|
// package.json
|
|
21565
21565
|
var name = "@shortcut/mcp";
|
|
21566
|
-
var version = "0.
|
|
21566
|
+
var version = "0.6.0";
|
|
21567
21567
|
|
|
21568
21568
|
// src/tools/base.ts
|
|
21569
21569
|
class BaseTools {
|
|
@@ -21710,12 +21710,17 @@ var formatUsersList = (users) => {
|
|
|
21710
21710
|
};
|
|
21711
21711
|
|
|
21712
21712
|
// src/tools/utils/search.ts
|
|
21713
|
+
var keyRenames = { team: "group", name: "title" };
|
|
21714
|
+
var mapKeyName = (key) => {
|
|
21715
|
+
const lowercaseKey = key.toLowerCase();
|
|
21716
|
+
return keyRenames[lowercaseKey] || lowercaseKey;
|
|
21717
|
+
};
|
|
21713
21718
|
var getKey = (prop) => {
|
|
21714
21719
|
if (prop.startsWith("is"))
|
|
21715
|
-
return `is:${prop.slice(2)
|
|
21720
|
+
return `is:${mapKeyName(prop.slice(2))}`;
|
|
21716
21721
|
if (prop.startsWith("has"))
|
|
21717
|
-
return `has:${prop.slice(3)
|
|
21718
|
-
return prop;
|
|
21722
|
+
return `has:${mapKeyName(prop.slice(3))}`;
|
|
21723
|
+
return mapKeyName(prop);
|
|
21719
21724
|
};
|
|
21720
21725
|
var buildSearchQuery = async (params, currentUser) => {
|
|
21721
21726
|
const query = Object.entries(params).map(([key, value]) => {
|
|
@@ -22096,9 +22101,10 @@ The story will be added to the default state for the workflow.
|
|
|
22096
22101
|
taskDescription: z.string().min(1).describe("The description of the task"),
|
|
22097
22102
|
taskOwnerIds: z.array(z.string()).optional().describe("Array of user IDs to assign as owners of the task")
|
|
22098
22103
|
}, async (params) => await tools.addTaskToStory(params));
|
|
22099
|
-
server.tool("add-relation-to-story", "Add a
|
|
22104
|
+
server.tool("add-relation-to-story", "Add a story relationship to a story", {
|
|
22100
22105
|
storyPublicId: z.number().positive().describe("The public ID of the story"),
|
|
22101
|
-
relatedStoryPublicId: z.number().positive().describe("The public ID of the related story")
|
|
22106
|
+
relatedStoryPublicId: z.number().positive().describe("The public ID of the related story"),
|
|
22107
|
+
relationshipType: z.enum(["relates to", "blocks", "blocked by", "duplicates", "duplicated by"]).optional().default("relates to").describe("The type of relationship")
|
|
22102
22108
|
}, async (params) => await tools.addRelationToStory(params));
|
|
22103
22109
|
server.tool("update-task", "Update a task in a story", {
|
|
22104
22110
|
storyPublicId: z.number().positive().describe("The public ID of the story"),
|
|
@@ -22331,7 +22337,8 @@ ${comment.text || ""}`;
|
|
|
22331
22337
|
}
|
|
22332
22338
|
async addRelationToStory({
|
|
22333
22339
|
storyPublicId,
|
|
22334
|
-
relatedStoryPublicId
|
|
22340
|
+
relatedStoryPublicId,
|
|
22341
|
+
relationshipType
|
|
22335
22342
|
}) {
|
|
22336
22343
|
if (!storyPublicId)
|
|
22337
22344
|
throw new Error("Story public ID is required");
|
|
@@ -22343,8 +22350,15 @@ ${comment.text || ""}`;
|
|
|
22343
22350
|
const relatedStory = await this.client.getStory(relatedStoryPublicId);
|
|
22344
22351
|
if (!relatedStory)
|
|
22345
22352
|
throw new Error(`Failed to retrieve Shortcut story with public ID: ${relatedStoryPublicId}`);
|
|
22346
|
-
|
|
22347
|
-
|
|
22353
|
+
let subjectStoryId = storyPublicId;
|
|
22354
|
+
let objectStoryId = relatedStoryPublicId;
|
|
22355
|
+
if (relationshipType === "blocked by" || relationshipType === "duplicated by") {
|
|
22356
|
+
relationshipType = relationshipType === "blocked by" ? "blocks" : "duplicates";
|
|
22357
|
+
subjectStoryId = relatedStoryPublicId;
|
|
22358
|
+
objectStoryId = storyPublicId;
|
|
22359
|
+
}
|
|
22360
|
+
await this.client.addRelationToStory(subjectStoryId, objectStoryId, relationshipType);
|
|
22361
|
+
return this.toResult(relationshipType === "blocks" ? `Marked sc-${subjectStoryId} as a blocker to sc-${objectStoryId}.` : relationshipType === "duplicates" ? `Marked sc-${subjectStoryId} as a duplicate of sc-${objectStoryId}.` : `Added a relationship between sc-${subjectStoryId} and sc-${objectStoryId}.`);
|
|
22348
22362
|
}
|
|
22349
22363
|
}
|
|
22350
22364
|
|