@taazkareem/clickup-mcp-server 0.4.19 → 0.4.20

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/build/index.js +145 -182
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -319,202 +319,165 @@ const serverCapabilities = {
319
319
  // Create server instance with capabilities
320
320
  const server = new Server({
321
321
  name: "clickup-mcp-server",
322
- version: "0.4.18",
322
+ version: "0.4.19",
323
323
  transport: new StdioServerTransport(),
324
324
  capabilities: serverCapabilities,
325
325
  errorHandler: (error) => {
326
326
  logError('mcp', error);
327
327
  }
328
328
  });
329
- /**
330
- * Register handlers for MCP tool requests
331
- * Each tool is mapped to its corresponding handler function
332
- */
333
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
334
- try {
335
- logDebug('tool.request', { name: request.params.name });
336
- switch (request.params.name) {
337
- case "workspace_hierarchy": {
338
- return await handleWorkspaceHierarchy(clickup, config.teamId);
339
- }
340
- case "create_task": {
341
- const args = request.params.arguments;
342
- return await handleCreateTask(clickup, config.teamId, args);
343
- }
344
- case "create_bulk_tasks": {
345
- const args = request.params.arguments;
346
- return await handleCreateBulkTasks(clickup, config.teamId, args);
347
- }
348
- case "create_list": {
349
- const args = request.params.arguments;
350
- return await handleCreateList(clickup, config.teamId, args);
351
- }
352
- case "create_folder": {
353
- const args = request.params.arguments;
354
- return await handleCreateFolder(clickup, config.teamId, args);
355
- }
356
- case "create_list_in_folder": {
357
- const args = request.params.arguments;
358
- return await handleCreateListInFolder(clickup, config.teamId, args);
359
- }
360
- case "move_task": {
361
- const args = request.params.arguments;
362
- return await handleMoveTask(clickup, config.teamId, args);
363
- }
364
- case "duplicate_task": {
365
- const args = request.params.arguments;
366
- return await handleDuplicateTask(clickup, config.teamId, args);
367
- }
368
- case "update_task": {
369
- const args = request.params.arguments;
370
- return await handleUpdateTask(clickup, config.teamId, args);
371
- }
372
- default:
373
- throw new Error(`Unknown tool: ${request.params.name}`);
374
- }
375
- }
376
- catch (error) {
377
- logError(`tool.${request.params.name}`, error);
378
- throw error;
379
- }
380
- });
381
- /**
382
- * Initialize and start the server
383
- * Connects to the transport and begins listening for requests
384
- */
385
- try {
386
- logInfo('mcp', { status: 'connecting' });
329
+ // Server startup logic
330
+ if (process.argv.includes('--stdio')) {
331
+ logInfo('server', { status: 'stdio.starting' });
332
+ // Set up stdio transport and connect first
387
333
  const transport = new StdioServerTransport();
388
- await server.connect(transport);
389
- logInfo('mcp', { status: 'connected' });
390
- }
391
- catch (error) {
392
- logError('mcp.connection', error);
393
- process.exit(1);
394
- }
395
- /**
396
- * Handler for listing available ClickUp tasks as resources
397
- * Returns a list of all tasks across all spaces with their metadata
398
- */
399
- server.setRequestHandler(ListResourcesRequestSchema, async () => {
400
- logDebug('resources', { action: 'listing' });
401
- try {
402
- const { tasks, spaces } = await getAllTasks(clickup, config.teamId);
403
- return {
404
- resources: tasks.map(task => ({
405
- uri: `clickup://task/${task.id}`,
406
- mimeType: "application/json",
407
- name: task.name,
408
- description: task.description || `Task in ${task.list.name} (${task.space.name})`,
409
- tags: []
410
- }))
411
- };
412
- }
413
- catch (error) {
414
- logError('resources.list', error);
415
- throw error;
416
- }
417
- });
418
- /**
419
- * Handler for reading individual ClickUp task contents
420
- * Returns detailed information about a specific task
421
- */
422
- server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
423
- try {
424
- const url = new URL(request.params.uri);
425
- const taskId = url.pathname.replace(/^\/task\//, '');
426
- logDebug('resources.read', { taskId });
427
- const task = await clickup.getTask(taskId);
428
- return {
429
- contents: [{
430
- uri: request.params.uri,
431
- mimeType: "application/json",
432
- text: JSON.stringify(task, null, 2),
433
- tags: []
434
- }]
435
- };
436
- }
437
- catch (error) {
438
- logError('resources.read', error);
439
- throw error;
440
- }
441
- });
442
- /**
443
- * Handler for listing available tools
444
- * Returns metadata about all registered tools
445
- */
446
- server.setRequestHandler(ListToolsRequestSchema, async () => {
447
- logDebug('tools', { action: 'listing' });
448
- const toolCapabilities = server.capabilities?.tools || {};
449
- const tools = Object.entries(toolCapabilities).map(([name, tool]) => ({
450
- name,
451
- description: tool.description,
452
- inputSchema: tool.inputSchema
453
- }));
454
- logDebug('tools', { count: tools.length });
455
- return { tools };
456
- });
457
- /**
458
- * Handler for listing available prompts
459
- * Returns metadata about all registered prompts
460
- */
461
- server.setRequestHandler(ListPromptsRequestSchema, async () => {
462
- return {
463
- prompts: [
464
- {
465
- name: "summarize_tasks",
466
- description: "Summarize all ClickUp tasks"
467
- },
468
- {
469
- name: "analyze_task_priorities",
470
- description: "Analyze task priorities"
334
+ // Connect server with better error handling
335
+ server.connect(transport)
336
+ .then(() => {
337
+ logInfo('server', { status: 'connected' });
338
+ // Register handlers AFTER connection
339
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
340
+ try {
341
+ logDebug('tool.request', { name: request.params.name });
342
+ switch (request.params.name) {
343
+ case "workspace_hierarchy": {
344
+ return await handleWorkspaceHierarchy(clickup, config.teamId);
345
+ }
346
+ case "create_task": {
347
+ const args = request.params.arguments;
348
+ return await handleCreateTask(clickup, config.teamId, args);
349
+ }
350
+ case "create_bulk_tasks": {
351
+ const args = request.params.arguments;
352
+ return await handleCreateBulkTasks(clickup, config.teamId, args);
353
+ }
354
+ case "create_list": {
355
+ const args = request.params.arguments;
356
+ return await handleCreateList(clickup, config.teamId, args);
357
+ }
358
+ case "create_folder": {
359
+ const args = request.params.arguments;
360
+ return await handleCreateFolder(clickup, config.teamId, args);
361
+ }
362
+ case "create_list_in_folder": {
363
+ const args = request.params.arguments;
364
+ return await handleCreateListInFolder(clickup, config.teamId, args);
365
+ }
366
+ case "move_task": {
367
+ const args = request.params.arguments;
368
+ return await handleMoveTask(clickup, config.teamId, args);
369
+ }
370
+ case "duplicate_task": {
371
+ const args = request.params.arguments;
372
+ return await handleDuplicateTask(clickup, config.teamId, args);
373
+ }
374
+ case "update_task": {
375
+ const args = request.params.arguments;
376
+ return await handleUpdateTask(clickup, config.teamId, args);
377
+ }
378
+ default:
379
+ throw new Error(`Unknown tool: ${request.params.name}`);
380
+ }
471
381
  }
472
- ]
473
- };
474
- });
475
- /**
476
- * Handler for executing specific prompts
477
- * Maps prompt names to their corresponding handler functions
478
- */
479
- server.setRequestHandler(GetPromptRequestSchema, async (request) => {
480
- try {
481
- switch (request.params.name) {
482
- case "summarize_tasks": {
483
- const output = await handleSummarizeTasks(clickup, config.teamId);
382
+ catch (error) {
383
+ logError(`tool.${request.params.name}`, error);
384
+ throw error;
385
+ }
386
+ });
387
+ server.setRequestHandler(ListResourcesRequestSchema, async () => {
388
+ logDebug('resources', { action: 'listing' });
389
+ try {
390
+ const { tasks, spaces } = await getAllTasks(clickup, config.teamId);
484
391
  return {
485
- content: [{
486
- type: "text",
487
- text: output
488
- }]
392
+ resources: tasks.map(task => ({
393
+ uri: `clickup://task/${task.id}`,
394
+ mimeType: "application/json",
395
+ name: task.name,
396
+ description: task.description || `Task in ${task.list.name} (${task.space.name})`,
397
+ tags: []
398
+ }))
489
399
  };
490
400
  }
491
- case "analyze_task_priorities": {
492
- const output = await handleAnalyzeTaskPriorities(clickup, config.teamId);
401
+ catch (error) {
402
+ logError('resources.list', error);
403
+ throw error;
404
+ }
405
+ });
406
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
407
+ try {
408
+ const url = new URL(request.params.uri);
409
+ const taskId = url.pathname.replace(/^\/task\//, '');
410
+ logDebug('resources.read', { taskId });
411
+ const task = await clickup.getTask(taskId);
493
412
  return {
494
- content: [{
495
- type: "text",
496
- text: output
413
+ contents: [{
414
+ uri: request.params.uri,
415
+ mimeType: "application/json",
416
+ text: JSON.stringify(task, null, 2),
417
+ tags: []
497
418
  }]
498
419
  };
499
420
  }
500
- default:
501
- throw new Error("Prompt not found");
502
- }
503
- }
504
- catch (error) {
505
- logError('prompt', error);
506
- throw error;
507
- }
508
- });
509
- // Server startup logic
510
- if (process.argv.includes('--stdio')) {
511
- logInfo('server', { status: 'stdio.starting' });
512
- // Set up stdio transport
513
- const transport = new StdioServerTransport();
514
- // Connect server with better error handling
515
- server.connect(transport)
516
- .then(() => {
517
- logInfo('server', { status: 'connected' });
421
+ catch (error) {
422
+ logError('resources.read', error);
423
+ throw error;
424
+ }
425
+ });
426
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
427
+ logDebug('tools', { action: 'listing' });
428
+ const toolCapabilities = server.capabilities?.tools || {};
429
+ const tools = Object.entries(toolCapabilities).map(([name, tool]) => ({
430
+ name,
431
+ description: tool.description,
432
+ inputSchema: tool.inputSchema
433
+ }));
434
+ logDebug('tools', { count: tools.length });
435
+ return { tools };
436
+ });
437
+ server.setRequestHandler(ListPromptsRequestSchema, async () => {
438
+ return {
439
+ prompts: [
440
+ {
441
+ name: "summarize_tasks",
442
+ description: "Summarize all ClickUp tasks"
443
+ },
444
+ {
445
+ name: "analyze_task_priorities",
446
+ description: "Analyze task priorities"
447
+ }
448
+ ]
449
+ };
450
+ });
451
+ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
452
+ try {
453
+ switch (request.params.name) {
454
+ case "summarize_tasks": {
455
+ const output = await handleSummarizeTasks(clickup, config.teamId);
456
+ return {
457
+ content: [{
458
+ type: "text",
459
+ text: output
460
+ }]
461
+ };
462
+ }
463
+ case "analyze_task_priorities": {
464
+ const output = await handleAnalyzeTaskPriorities(clickup, config.teamId);
465
+ return {
466
+ content: [{
467
+ type: "text",
468
+ text: output
469
+ }]
470
+ };
471
+ }
472
+ default:
473
+ throw new Error("Prompt not found");
474
+ }
475
+ }
476
+ catch (error) {
477
+ logError('prompt', error);
478
+ throw error;
479
+ }
480
+ });
518
481
  // Send initial handshake message with more details
519
482
  const capabilities = {
520
483
  tools: server.capabilities?.tools || {},
@@ -528,7 +491,7 @@ if (process.argv.includes('--stdio')) {
528
491
  logInfo('mcp', {
529
492
  status: 'handshake',
530
493
  name: "clickup-mcp-server",
531
- version: "0.4.17", // Match package.json version
494
+ version: "0.4.19",
532
495
  hasTools: Object.keys(capabilities.tools).length > 0,
533
496
  hasPrompts: Object.keys(capabilities.prompts).length > 0
534
497
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taazkareem/clickup-mcp-server",
3
- "version": "0.4.19",
3
+ "version": "0.4.20",
4
4
  "description": "ClickUp MCP Server - Integrate ClickUp tasks with AI through Model Context Protocol",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",