@taazkareem/clickup-mcp-server 0.4.42 → 0.4.43
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/build/handlers/prompts.js +63 -0
- package/build/index.js +40 -334
- package/package.json +1 -1
|
@@ -23,3 +23,66 @@ export async function handleAnalyzeTaskPriorities(clickup, teamId) {
|
|
|
23
23
|
}
|
|
24
24
|
return output;
|
|
25
25
|
}
|
|
26
|
+
export async function handleGenerateDescription(clickup, taskId) {
|
|
27
|
+
try {
|
|
28
|
+
const task = await clickup.getTask(taskId);
|
|
29
|
+
// Generate a structured description based on task properties
|
|
30
|
+
let description = "# Task Description\n\n";
|
|
31
|
+
// Basic Information
|
|
32
|
+
description += "## Overview\n";
|
|
33
|
+
description += `${task.name}\n\n`;
|
|
34
|
+
// Status and Priority
|
|
35
|
+
description += "## Status & Priority\n";
|
|
36
|
+
description += `- Status: ${task.status?.status || 'Not set'}\n`;
|
|
37
|
+
description += `- Priority: ${task.priority?.priority || 'Not set'}\n\n`;
|
|
38
|
+
// Time Information
|
|
39
|
+
description += "## Timeline\n";
|
|
40
|
+
description += `- Created: ${new Date(task.date_created).toLocaleDateString()}\n`;
|
|
41
|
+
if (task.due_date) {
|
|
42
|
+
description += `- Due Date: ${new Date(task.due_date).toLocaleDateString()}\n`;
|
|
43
|
+
}
|
|
44
|
+
description += "\n";
|
|
45
|
+
// Dependencies and Relationships
|
|
46
|
+
description += "## Dependencies & Relationships\n";
|
|
47
|
+
const dependencies = task.dependencies || [];
|
|
48
|
+
if (dependencies.length > 0) {
|
|
49
|
+
description += "### Dependencies:\n";
|
|
50
|
+
dependencies.forEach(dep => {
|
|
51
|
+
description += `- ${dep.task_id}\n`;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
description += "No dependencies identified.\n";
|
|
56
|
+
}
|
|
57
|
+
description += "\n";
|
|
58
|
+
// Success Criteria
|
|
59
|
+
description += "## Success Criteria\n";
|
|
60
|
+
const checkList = task.check_list || [];
|
|
61
|
+
if (checkList.length > 0) {
|
|
62
|
+
checkList.forEach(item => {
|
|
63
|
+
description += `- [ ] ${item.name}\n`;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
description += "- Task completion requirements to be defined\n";
|
|
68
|
+
}
|
|
69
|
+
description += "\n";
|
|
70
|
+
// Resources
|
|
71
|
+
description += "## Required Resources\n";
|
|
72
|
+
const assignees = task.assignees || [];
|
|
73
|
+
if (assignees.length > 0) {
|
|
74
|
+
description += "### Assigned Team Members:\n";
|
|
75
|
+
assignees.forEach(assignee => {
|
|
76
|
+
description += `- ${assignee.username}\n`;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
description += "No team members assigned yet.\n";
|
|
81
|
+
}
|
|
82
|
+
return description;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error('Error generating description:', error);
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
}
|
package/build/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSche
|
|
|
5
5
|
import { ClickUpService } from "./services/clickup.js";
|
|
6
6
|
import config from "./config.js";
|
|
7
7
|
import { handleWorkspaceHierarchy, handleCreateTask } from "./handlers/tools.js";
|
|
8
|
-
import { handleSummarizeTasks, handleAnalyzeTaskPriorities } from "./handlers/prompts.js";
|
|
8
|
+
import { handleSummarizeTasks, handleAnalyzeTaskPriorities, handleGenerateDescription } from "./handlers/prompts.js";
|
|
9
9
|
import { getAllTasks } from "./utils/resolvers.js";
|
|
10
10
|
console.log('Server starting up...');
|
|
11
11
|
console.log('Config loaded:', {
|
|
@@ -29,307 +29,9 @@ const server = new Server({
|
|
|
29
29
|
version: "0.1.0",
|
|
30
30
|
}, {
|
|
31
31
|
capabilities: {
|
|
32
|
-
resources: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
tools: {
|
|
37
|
-
workspace_hierarchy: {
|
|
38
|
-
description: "List complete hierarchy of the ClickUp workspace",
|
|
39
|
-
inputSchema: {
|
|
40
|
-
type: "object",
|
|
41
|
-
properties: {},
|
|
42
|
-
required: []
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
create_task: {
|
|
46
|
-
description: "Create a new task in ClickUp",
|
|
47
|
-
inputSchema: {
|
|
48
|
-
type: "object",
|
|
49
|
-
properties: {
|
|
50
|
-
listId: {
|
|
51
|
-
type: "string",
|
|
52
|
-
description: "ID of the list to create the task in (optional if listName is provided)"
|
|
53
|
-
},
|
|
54
|
-
listName: {
|
|
55
|
-
type: "string",
|
|
56
|
-
description: "Name of the list to create the task in (optional if listId is provided)"
|
|
57
|
-
},
|
|
58
|
-
name: {
|
|
59
|
-
type: "string",
|
|
60
|
-
description: "Name of the task"
|
|
61
|
-
},
|
|
62
|
-
description: {
|
|
63
|
-
type: "string",
|
|
64
|
-
description: "Description of the task"
|
|
65
|
-
},
|
|
66
|
-
status: {
|
|
67
|
-
type: "string",
|
|
68
|
-
description: "Status of the task"
|
|
69
|
-
},
|
|
70
|
-
priority: {
|
|
71
|
-
type: "number",
|
|
72
|
-
description: "Priority of the task (1-4)"
|
|
73
|
-
},
|
|
74
|
-
dueDate: {
|
|
75
|
-
type: "string",
|
|
76
|
-
description: "Due date of the task (ISO string)"
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
required: ["name"]
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
create_bulk_tasks: {
|
|
83
|
-
description: "Create multiple tasks in a ClickUp list",
|
|
84
|
-
inputSchema: {
|
|
85
|
-
type: "object",
|
|
86
|
-
properties: {
|
|
87
|
-
listId: {
|
|
88
|
-
type: "string",
|
|
89
|
-
description: "ID of the list to create the tasks in (optional if listName is provided)"
|
|
90
|
-
},
|
|
91
|
-
listName: {
|
|
92
|
-
type: "string",
|
|
93
|
-
description: "Name of the list to create the tasks in (optional if listId is provided)"
|
|
94
|
-
},
|
|
95
|
-
tasks: {
|
|
96
|
-
type: "array",
|
|
97
|
-
description: "Array of tasks to create",
|
|
98
|
-
items: {
|
|
99
|
-
type: "object",
|
|
100
|
-
properties: {
|
|
101
|
-
name: {
|
|
102
|
-
type: "string",
|
|
103
|
-
description: "Name of the task"
|
|
104
|
-
},
|
|
105
|
-
description: {
|
|
106
|
-
type: "string",
|
|
107
|
-
description: "Description of the task"
|
|
108
|
-
},
|
|
109
|
-
status: {
|
|
110
|
-
type: "string",
|
|
111
|
-
description: "Status of the task"
|
|
112
|
-
},
|
|
113
|
-
priority: {
|
|
114
|
-
type: "number",
|
|
115
|
-
description: "Priority level (1-4)"
|
|
116
|
-
},
|
|
117
|
-
dueDate: {
|
|
118
|
-
type: "string",
|
|
119
|
-
description: "Due date (ISO string)"
|
|
120
|
-
},
|
|
121
|
-
assignees: {
|
|
122
|
-
type: "array",
|
|
123
|
-
items: {
|
|
124
|
-
type: "number"
|
|
125
|
-
},
|
|
126
|
-
description: "Array of user IDs to assign to the task"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
required: ["name"]
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
required: ["tasks"]
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
create_list: {
|
|
137
|
-
description: "Create a new list in a ClickUp space",
|
|
138
|
-
inputSchema: {
|
|
139
|
-
type: "object",
|
|
140
|
-
properties: {
|
|
141
|
-
spaceId: {
|
|
142
|
-
type: "string",
|
|
143
|
-
description: "ID of the space to create the list in (optional if spaceName is provided)"
|
|
144
|
-
},
|
|
145
|
-
spaceName: {
|
|
146
|
-
type: "string",
|
|
147
|
-
description: "Name of the space to create the list in (optional if spaceId is provided)"
|
|
148
|
-
},
|
|
149
|
-
name: {
|
|
150
|
-
type: "string",
|
|
151
|
-
description: "Name of the list"
|
|
152
|
-
},
|
|
153
|
-
content: {
|
|
154
|
-
type: "string",
|
|
155
|
-
description: "Description or content of the list"
|
|
156
|
-
},
|
|
157
|
-
dueDate: {
|
|
158
|
-
type: "string",
|
|
159
|
-
description: "Due date for the list (ISO string)"
|
|
160
|
-
},
|
|
161
|
-
priority: {
|
|
162
|
-
type: "number",
|
|
163
|
-
description: "Priority of the list (1-4)"
|
|
164
|
-
},
|
|
165
|
-
assignee: {
|
|
166
|
-
type: "number",
|
|
167
|
-
description: "User ID to assign the list to"
|
|
168
|
-
},
|
|
169
|
-
status: {
|
|
170
|
-
type: "string",
|
|
171
|
-
description: "Status of the list"
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
required: ["name"]
|
|
175
|
-
}
|
|
176
|
-
},
|
|
177
|
-
create_folder: {
|
|
178
|
-
description: "Create a new folder in a ClickUp space",
|
|
179
|
-
inputSchema: {
|
|
180
|
-
type: "object",
|
|
181
|
-
properties: {
|
|
182
|
-
spaceId: {
|
|
183
|
-
type: "string",
|
|
184
|
-
description: "ID of the space to create the folder in (optional if spaceName is provided)"
|
|
185
|
-
},
|
|
186
|
-
spaceName: {
|
|
187
|
-
type: "string",
|
|
188
|
-
description: "Name of the space to create the folder in (optional if spaceId is provided)"
|
|
189
|
-
},
|
|
190
|
-
name: {
|
|
191
|
-
type: "string",
|
|
192
|
-
description: "Name of the folder"
|
|
193
|
-
},
|
|
194
|
-
override_statuses: {
|
|
195
|
-
type: "boolean",
|
|
196
|
-
description: "Whether to override space statuses"
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
required: ["name"]
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
create_list_in_folder: {
|
|
203
|
-
description: "Create a new list in a ClickUp folder",
|
|
204
|
-
inputSchema: {
|
|
205
|
-
type: "object",
|
|
206
|
-
properties: {
|
|
207
|
-
folderId: {
|
|
208
|
-
type: "string",
|
|
209
|
-
description: "ID of the folder to create the list in (optional if folderName and spaceId/spaceName are provided)"
|
|
210
|
-
},
|
|
211
|
-
folderName: {
|
|
212
|
-
type: "string",
|
|
213
|
-
description: "Name of the folder to create the list in"
|
|
214
|
-
},
|
|
215
|
-
spaceId: {
|
|
216
|
-
type: "string",
|
|
217
|
-
description: "ID of the space containing the folder (required if using folderName)"
|
|
218
|
-
},
|
|
219
|
-
spaceName: {
|
|
220
|
-
type: "string",
|
|
221
|
-
description: "Name of the space containing the folder (alternative to spaceId)"
|
|
222
|
-
},
|
|
223
|
-
name: {
|
|
224
|
-
type: "string",
|
|
225
|
-
description: "Name of the list"
|
|
226
|
-
},
|
|
227
|
-
content: {
|
|
228
|
-
type: "string",
|
|
229
|
-
description: "Description or content of the list"
|
|
230
|
-
},
|
|
231
|
-
status: {
|
|
232
|
-
type: "string",
|
|
233
|
-
description: "Status of the list"
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
required: ["name"]
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
move_task: {
|
|
240
|
-
description: "Move a task to a different list",
|
|
241
|
-
inputSchema: {
|
|
242
|
-
type: "object",
|
|
243
|
-
properties: {
|
|
244
|
-
taskId: {
|
|
245
|
-
type: "string",
|
|
246
|
-
description: "ID of the task to move"
|
|
247
|
-
},
|
|
248
|
-
listId: {
|
|
249
|
-
type: "string",
|
|
250
|
-
description: "ID of the destination list (optional if listName is provided)"
|
|
251
|
-
},
|
|
252
|
-
listName: {
|
|
253
|
-
type: "string",
|
|
254
|
-
description: "Name of the destination list (optional if listId is provided)"
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
required: ["taskId"]
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
duplicate_task: {
|
|
261
|
-
description: "Duplicate a task to a list",
|
|
262
|
-
inputSchema: {
|
|
263
|
-
type: "object",
|
|
264
|
-
properties: {
|
|
265
|
-
taskId: {
|
|
266
|
-
type: "string",
|
|
267
|
-
description: "ID of the task to duplicate"
|
|
268
|
-
},
|
|
269
|
-
listId: {
|
|
270
|
-
type: "string",
|
|
271
|
-
description: "ID of the destination list (optional if listName is provided)"
|
|
272
|
-
},
|
|
273
|
-
listName: {
|
|
274
|
-
type: "string",
|
|
275
|
-
description: "Name of the destination list (optional if listId is provided)"
|
|
276
|
-
}
|
|
277
|
-
},
|
|
278
|
-
required: ["taskId"]
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
update_task: {
|
|
282
|
-
description: "Update an existing task in ClickUp",
|
|
283
|
-
inputSchema: {
|
|
284
|
-
type: "object",
|
|
285
|
-
properties: {
|
|
286
|
-
taskId: {
|
|
287
|
-
type: "string",
|
|
288
|
-
description: "ID of the task to update"
|
|
289
|
-
},
|
|
290
|
-
name: {
|
|
291
|
-
type: "string",
|
|
292
|
-
description: "New name of the task"
|
|
293
|
-
},
|
|
294
|
-
description: {
|
|
295
|
-
type: "string",
|
|
296
|
-
description: "New description of the task"
|
|
297
|
-
},
|
|
298
|
-
status: {
|
|
299
|
-
type: "string",
|
|
300
|
-
description: "New status of the task"
|
|
301
|
-
},
|
|
302
|
-
priority: {
|
|
303
|
-
type: "number",
|
|
304
|
-
description: "New priority of the task (1-4)"
|
|
305
|
-
},
|
|
306
|
-
dueDate: {
|
|
307
|
-
type: "string",
|
|
308
|
-
description: "New due date of the task (ISO string)"
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
required: ["taskId"]
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
prompts: {
|
|
316
|
-
summarize_tasks: {
|
|
317
|
-
description: "Summarize tasks in the workspace",
|
|
318
|
-
inputSchema: {
|
|
319
|
-
type: "object",
|
|
320
|
-
properties: {},
|
|
321
|
-
required: []
|
|
322
|
-
}
|
|
323
|
-
},
|
|
324
|
-
analyze_priorities: {
|
|
325
|
-
description: "Analyze task priorities",
|
|
326
|
-
inputSchema: {
|
|
327
|
-
type: "object",
|
|
328
|
-
properties: {},
|
|
329
|
-
required: []
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
},
|
|
32
|
+
resources: {},
|
|
33
|
+
tools: {},
|
|
34
|
+
prompts: {},
|
|
333
35
|
},
|
|
334
36
|
});
|
|
335
37
|
console.log('MCP server created');
|
|
@@ -883,12 +585,13 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
883
585
|
if (!args.taskId) {
|
|
884
586
|
throw new Error("taskId is required");
|
|
885
587
|
}
|
|
588
|
+
const dueDate = args.due_date ? new Date(args.due_date).getTime() : undefined;
|
|
886
589
|
const task = await clickup.updateTask(args.taskId, {
|
|
887
590
|
name: args.name,
|
|
888
591
|
description: args.description,
|
|
889
592
|
status: args.status,
|
|
890
593
|
priority: args.priority,
|
|
891
|
-
due_date:
|
|
594
|
+
due_date: dueDate
|
|
892
595
|
});
|
|
893
596
|
return {
|
|
894
597
|
content: [{
|
|
@@ -919,6 +622,10 @@ server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
|
919
622
|
{
|
|
920
623
|
name: "analyze_task_priorities",
|
|
921
624
|
description: "Analyze task priorities"
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
name: "generate_description",
|
|
628
|
+
description: "Generate a detailed task description with objectives, success criteria, resources, and dependencies"
|
|
922
629
|
}
|
|
923
630
|
]
|
|
924
631
|
};
|
|
@@ -947,6 +654,18 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
|
947
654
|
}]
|
|
948
655
|
};
|
|
949
656
|
}
|
|
657
|
+
case "generate_description": {
|
|
658
|
+
if (!request.params.arguments?.taskId) {
|
|
659
|
+
throw new Error("taskId is required for generate_description prompt");
|
|
660
|
+
}
|
|
661
|
+
const output = await handleGenerateDescription(clickup, request.params.arguments.taskId);
|
|
662
|
+
return {
|
|
663
|
+
content: [{
|
|
664
|
+
type: "text",
|
|
665
|
+
text: output
|
|
666
|
+
}]
|
|
667
|
+
};
|
|
668
|
+
}
|
|
950
669
|
default:
|
|
951
670
|
throw new Error("Prompt not found");
|
|
952
671
|
}
|
|
@@ -956,37 +675,24 @@ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
|
956
675
|
throw error;
|
|
957
676
|
}
|
|
958
677
|
});
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
transport.close();
|
|
978
|
-
process.exit(0);
|
|
979
|
-
});
|
|
980
|
-
})
|
|
981
|
-
.catch(error => {
|
|
982
|
-
console.error('Failed to connect server to transport:', error);
|
|
983
|
-
process.exit(1);
|
|
984
|
-
});
|
|
985
|
-
}
|
|
986
|
-
else {
|
|
987
|
-
console.log('Starting server in standard mode...');
|
|
988
|
-
// Add your non-stdio server initialization here if needed
|
|
989
|
-
}
|
|
678
|
+
// Start the server
|
|
679
|
+
console.log('Setting up transport...');
|
|
680
|
+
const transport = new StdioServerTransport();
|
|
681
|
+
// Connect the server to the transport
|
|
682
|
+
console.log('Connecting server to transport...');
|
|
683
|
+
server.connect(transport).catch(error => {
|
|
684
|
+
console.error('Error connecting server to transport:', error);
|
|
685
|
+
process.exit(1);
|
|
686
|
+
});
|
|
687
|
+
// Handle process signals
|
|
688
|
+
process.on('SIGINT', () => {
|
|
689
|
+
console.log('Received SIGINT. Shutting down...');
|
|
690
|
+
transport.close();
|
|
691
|
+
});
|
|
692
|
+
process.on('SIGTERM', () => {
|
|
693
|
+
console.log('Received SIGTERM. Shutting down...');
|
|
694
|
+
transport.close();
|
|
695
|
+
});
|
|
990
696
|
// Prevent unhandled promise rejections from crashing the server
|
|
991
697
|
process.on('unhandledRejection', (error) => {
|
|
992
698
|
console.error('Unhandled promise rejection:', error);
|
package/package.json
CHANGED