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.
- package/CHANGELOG.md +11 -0
- package/CLAUDE.md +1 -1
- package/README.md +2 -1
- package/dist/main.js +52 -2
- package/dist/schemas.d.ts +16 -3
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +7 -4
- package/dist/schemas.test.d.ts +2 -0
- package/dist/schemas.test.d.ts.map +1 -0
- package/dist/schemas.test.js +486 -0
- package/mcp-inspector.json +1 -1
- package/package.json +2 -2
- package/src/main.ts +65 -1
- package/src/schemas.test.ts +608 -0
- package/src/schemas.ts +8 -4
- package/.claude/settings.local.json +0 -37
package/mcp-inspector.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-sunsama",
|
|
3
|
-
"version": "0.
|
|
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": "
|
|
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.
|
|
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",
|