mcp-sunsama 0.5.2 → 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.
@@ -4,7 +4,7 @@
4
4
  "command": "bun",
5
5
  "args": [
6
6
  "--env-file=.env",
7
- "./main.ts"
7
+ "./src/main.ts"
8
8
  ],
9
9
  "env": {
10
10
  "PORT": "3002"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-sunsama",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "description": "MCP server for Sunsama API integration",
5
5
  "type": "module",
6
6
  "private": false,
@@ -16,7 +16,7 @@
16
16
  "typecheck": "bunx tsc --noEmit",
17
17
  "typecheck:watch": "bunx tsc --noEmit --watch",
18
18
  "build": "bunx tsc",
19
- "inspect": "npx @modelcontextprotocol/inspector --config ./mcp-inspector.json --server sunsama",
19
+ "inspect": "bunx @modelcontextprotocol/inspector --config ./mcp-inspector.json --server sunsama",
20
20
  "changeset": "changeset",
21
21
  "version": "changeset version",
22
22
  "release": "bun run build && changeset publish",
package/src/main.ts CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  getTasksBacklogSchema,
14
14
  getTasksByDaySchema,
15
15
  getUserSchema,
16
+ updateTaskBacklogSchema,
16
17
  updateTaskCompleteSchema,
17
18
  updateTaskSnoozeDateSchema
18
19
  } from "./schemas.js";
@@ -31,7 +32,7 @@ if (transportConfig.transportType === "stdio") {
31
32
 
32
33
  const server = new FastMCP({
33
34
  name: "Sunsama API Server",
34
- version: "0.5.2",
35
+ version: "0.6.0",
35
36
  instructions: `
36
37
  This MCP server provides access to the Sunsama API for task and project management.
37
38
 
@@ -507,6 +508,69 @@ server.addTool({
507
508
  }
508
509
  });
509
510
 
511
+ server.addTool({
512
+ name: "update-task-backlog",
513
+ description: "Move a task to the backlog",
514
+ parameters: updateTaskBacklogSchema,
515
+ execute: async (args, {session, log}) => {
516
+ try {
517
+ // Extract parameters
518
+ const {taskId, timezone, limitResponsePayload} = args;
519
+
520
+ log.info("Moving task to backlog", {
521
+ taskId: taskId,
522
+ timezone: timezone,
523
+ limitResponsePayload: limitResponsePayload
524
+ });
525
+
526
+ // Get the appropriate client based on transport type
527
+ const sunsamaClient = getSunsamaClient(session as SessionData | null);
528
+
529
+ // Build options object
530
+ const options: {
531
+ timezone?: string;
532
+ limitResponsePayload?: boolean;
533
+ } = {};
534
+ if (timezone) options.timezone = timezone;
535
+ if (limitResponsePayload !== undefined) options.limitResponsePayload = limitResponsePayload;
536
+
537
+ // Call sunsamaClient.updateTaskSnoozeDate(taskId, null, options) to move to backlog
538
+ const result = await sunsamaClient.updateTaskSnoozeDate(
539
+ taskId,
540
+ null,
541
+ options
542
+ );
543
+
544
+ log.info("Successfully moved task to backlog", {
545
+ taskId: taskId,
546
+ success: result.success
547
+ });
548
+
549
+ return {
550
+ content: [
551
+ {
552
+ type: "text",
553
+ text: JSON.stringify({
554
+ success: result.success,
555
+ taskId: taskId,
556
+ movedToBacklog: true,
557
+ updatedFields: result.updatedFields
558
+ })
559
+ }
560
+ ]
561
+ };
562
+
563
+ } catch (error) {
564
+ log.error("Failed to move task to backlog", {
565
+ taskId: args.taskId,
566
+ error: error instanceof Error ? error.message : 'Unknown error'
567
+ });
568
+
569
+ throw new Error(`Failed to move task to backlog: ${error instanceof Error ? error.message : 'Unknown error'}`);
570
+ }
571
+ }
572
+ });
573
+
510
574
  // Stream Operations
511
575
  server.addTool({
512
576
  name: "get-streams",