mcp-sunsama 0.5.0 → 0.5.2
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/.claude/settings.local.json +3 -1
- package/CHANGELOG.md +12 -0
- package/dist/main.js +147 -77
- package/dist/schemas.d.ts +12 -1
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +9 -1
- package/package.json +3 -2
- package/src/main.ts +1 -1
- package/src/schemas.ts +4 -1
- package/TODO-0_5_0.md +0 -108
- package/TODO.md +0 -152
- package/dev/prd-get-archived-tasks.md +0 -156
- package/dev/sample-data/get-archived-tasks/get-archived-tasks-response.json +0 -3179
- package/dev/sample-data/get-archived-tasks/get-archived-tasks.sh +0 -20
- package/dev/user-stories/filter-tasks-by-stream.md +0 -18
- package/dev/user-stories/get-archived-tasks.md +0 -32
- package/dev/user-stories/implementation-notes.md +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# mcp-sunsama
|
|
2
2
|
|
|
3
|
+
## 0.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix updateTaskSnoozeDate schema validation for null values by using proper union types
|
|
8
|
+
|
|
9
|
+
## 0.5.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 005209d: Add prepublishOnly script to ensure build runs before publishing
|
|
14
|
+
|
|
3
15
|
## 0.5.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/main.js
CHANGED
|
@@ -3,7 +3,7 @@ import { FastMCP } from "fastmcp";
|
|
|
3
3
|
import { httpStreamAuthenticator } from "./auth/http.js";
|
|
4
4
|
import { initializeStdioAuth } from "./auth/stdio.js";
|
|
5
5
|
import { getTransportConfig } from "./config/transport.js";
|
|
6
|
-
import { createTaskSchema, deleteTaskSchema, getStreamsSchema, getTasksBacklogSchema, getTasksByDaySchema, getUserSchema, updateTaskCompleteSchema, updateTaskSnoozeDateSchema } from "./schemas.js";
|
|
6
|
+
import { createTaskSchema, deleteTaskSchema, getArchivedTasksSchema, getStreamsSchema, getTasksBacklogSchema, getTasksByDaySchema, getUserSchema, updateTaskCompleteSchema, updateTaskSnoozeDateSchema } from "./schemas.js";
|
|
7
7
|
import { getSunsamaClient } from "./utils/client-resolver.js";
|
|
8
8
|
import { filterTasksByCompletion } from "./utils/task-filters.js";
|
|
9
9
|
import { trimTasksForResponse } from "./utils/task-trimmer.js";
|
|
@@ -16,14 +16,14 @@ if (transportConfig.transportType === "stdio") {
|
|
|
16
16
|
}
|
|
17
17
|
const server = new FastMCP({
|
|
18
18
|
name: "Sunsama API Server",
|
|
19
|
-
version: "0.
|
|
19
|
+
version: "0.5.2",
|
|
20
20
|
instructions: `
|
|
21
21
|
This MCP server provides access to the Sunsama API for task and project management.
|
|
22
22
|
|
|
23
23
|
Available tools:
|
|
24
24
|
- Authentication: login, logout, check authentication status
|
|
25
25
|
- User operations: get current user information
|
|
26
|
-
- Task operations: get tasks by day, get backlog tasks
|
|
26
|
+
- Task operations: get tasks by day, get backlog tasks, get archived tasks
|
|
27
27
|
- Stream operations: get streams/channels for the user's group
|
|
28
28
|
|
|
29
29
|
Authentication is required for all operations. You can either:
|
|
@@ -149,6 +149,67 @@ server.addTool({
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
|
+
server.addTool({
|
|
153
|
+
name: "get-archived-tasks",
|
|
154
|
+
description: "Get archived tasks with optional pagination",
|
|
155
|
+
parameters: getArchivedTasksSchema,
|
|
156
|
+
execute: async (args, { session, log }) => {
|
|
157
|
+
try {
|
|
158
|
+
// Extract and set defaults for parameters
|
|
159
|
+
const offset = args.offset || 0;
|
|
160
|
+
const requestedLimit = args.limit || 100;
|
|
161
|
+
// Fetch limit + 1 to determine if there are more results
|
|
162
|
+
const fetchLimit = requestedLimit + 1;
|
|
163
|
+
log.info("Getting archived tasks", {
|
|
164
|
+
offset,
|
|
165
|
+
requestedLimit,
|
|
166
|
+
fetchLimit
|
|
167
|
+
});
|
|
168
|
+
// Get the appropriate client based on transport type
|
|
169
|
+
const sunsamaClient = getSunsamaClient(session);
|
|
170
|
+
// Get archived tasks (fetch limit + 1 to check for more)
|
|
171
|
+
const allTasks = await sunsamaClient.getArchivedTasks(offset, fetchLimit);
|
|
172
|
+
// Determine if there are more results and slice to requested limit
|
|
173
|
+
const hasMore = allTasks.length > requestedLimit;
|
|
174
|
+
const tasks = hasMore ? allTasks.slice(0, requestedLimit) : allTasks;
|
|
175
|
+
// Trim tasks to reduce response size while preserving essential data
|
|
176
|
+
const trimmedTasks = trimTasksForResponse(tasks);
|
|
177
|
+
// Create pagination metadata
|
|
178
|
+
const paginationInfo = {
|
|
179
|
+
offset,
|
|
180
|
+
limit: requestedLimit,
|
|
181
|
+
count: tasks.length,
|
|
182
|
+
hasMore,
|
|
183
|
+
nextOffset: hasMore ? offset + requestedLimit : null
|
|
184
|
+
};
|
|
185
|
+
log.info("Successfully retrieved archived tasks", {
|
|
186
|
+
totalReturned: tasks.length,
|
|
187
|
+
hasMore,
|
|
188
|
+
offset,
|
|
189
|
+
requestedLimit
|
|
190
|
+
});
|
|
191
|
+
// Create response with pagination metadata header and TSV data
|
|
192
|
+
const responseText = `# Pagination: offset=${paginationInfo.offset}, limit=${paginationInfo.limit}, count=${paginationInfo.count}, hasMore=${paginationInfo.hasMore}, nextOffset=${paginationInfo.nextOffset || 'null'}
|
|
193
|
+
${toTsv(trimmedTasks)}`;
|
|
194
|
+
return {
|
|
195
|
+
content: [
|
|
196
|
+
{
|
|
197
|
+
type: "text",
|
|
198
|
+
text: responseText
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
log.error("Failed to get archived tasks", {
|
|
205
|
+
offset: args.offset,
|
|
206
|
+
limit: args.limit,
|
|
207
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
208
|
+
});
|
|
209
|
+
throw new Error(`Failed to get archived tasks: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
});
|
|
152
213
|
// Task Mutation Operations
|
|
153
214
|
server.addTool({
|
|
154
215
|
name: "create-task",
|
|
@@ -397,15 +458,32 @@ server.addResource({
|
|
|
397
458
|
text: `# Sunsama MCP Server Documentation
|
|
398
459
|
|
|
399
460
|
## Overview
|
|
400
|
-
This MCP server provides access to the Sunsama API for task and project management.
|
|
401
|
-
|
|
461
|
+
This MCP server provides comprehensive access to the Sunsama API for task and project management.
|
|
462
|
+
Supports dual transport modes with different authentication strategies.
|
|
463
|
+
|
|
464
|
+
## Transport Modes
|
|
465
|
+
|
|
466
|
+
### Stdio Transport (Default)
|
|
467
|
+
- Single global authentication using environment variables
|
|
468
|
+
- Session maintained for entire server lifetime
|
|
469
|
+
- Best for single-user local development
|
|
470
|
+
|
|
471
|
+
### HTTP Stream Transport
|
|
472
|
+
- Per-request authentication via HTTP Basic Auth
|
|
473
|
+
- Session-isolated client instances
|
|
474
|
+
- Supports multiple concurrent users
|
|
402
475
|
|
|
403
476
|
## Authentication
|
|
404
|
-
|
|
477
|
+
|
|
478
|
+
### Stdio Transport
|
|
479
|
+
Uses environment variables (authenticated once at startup):
|
|
405
480
|
- \`SUNSAMA_EMAIL\`: Your Sunsama account email
|
|
406
481
|
- \`SUNSAMA_PASSWORD\`: Your Sunsama account password
|
|
407
482
|
|
|
408
|
-
|
|
483
|
+
### HTTP Stream Transport
|
|
484
|
+
Uses HTTP Basic Auth headers (per-request authentication):
|
|
485
|
+
- \`Authorization: Basic <base64(email:password)>\`
|
|
486
|
+
- Credentials provided in each HTTP request
|
|
409
487
|
|
|
410
488
|
## Available Tools
|
|
411
489
|
|
|
@@ -414,93 +492,85 @@ Authentication happens automatically on server startup. No client-side authentic
|
|
|
414
492
|
- Parameters: none
|
|
415
493
|
- Returns: User object with profile, timezone, and primary group details
|
|
416
494
|
|
|
417
|
-
### Task
|
|
495
|
+
### Task Management
|
|
418
496
|
- **get-tasks-by-day**: Get tasks for a specific day with optional filtering
|
|
419
497
|
- Parameters:
|
|
420
498
|
- \`day\` (required): Date in YYYY-MM-DD format
|
|
421
499
|
- \`timezone\` (optional): Timezone string (e.g., "America/New_York")
|
|
422
|
-
- \`completionFilter\` (optional): Filter by completion status
|
|
423
|
-
|
|
424
|
-
- \`"incomplete"\`: Return only incomplete tasks
|
|
425
|
-
- \`"completed"\`: Return only completed tasks
|
|
426
|
-
- Returns: Array of filtered Task objects for the specified day
|
|
500
|
+
- \`completionFilter\` (optional): Filter by completion status ("all", "incomplete", "completed")
|
|
501
|
+
- Returns: TSV of filtered Task objects for the specified day
|
|
427
502
|
|
|
428
503
|
- **get-tasks-backlog**: Get tasks from the backlog
|
|
429
504
|
- Parameters: none
|
|
430
|
-
- Returns:
|
|
505
|
+
- Returns: TSV of Task objects from the backlog
|
|
431
506
|
|
|
432
|
-
|
|
433
|
-
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
-
|
|
507
|
+
- **get-archived-tasks**: Get archived tasks with optional pagination
|
|
508
|
+
- Parameters:
|
|
509
|
+
- \`offset\` (optional): Pagination offset (defaults to 0)
|
|
510
|
+
- \`limit\` (optional): Maximum number of tasks to return (defaults to 100, max: 1000)
|
|
511
|
+
- Returns: TSV of trimmed archived Task objects with pagination metadata header
|
|
512
|
+
- Pagination: Uses limit+1 pattern to determine if more results are available
|
|
437
513
|
|
|
438
|
-
|
|
514
|
+
- **create-task**: Create a new task with optional properties
|
|
515
|
+
- Parameters:
|
|
516
|
+
- \`text\` (required): Task title/description
|
|
517
|
+
- \`notes\` (optional): Additional task notes
|
|
518
|
+
- \`streamIds\` (optional): Array of stream IDs to associate with task
|
|
519
|
+
- \`timeEstimate\` (optional): Time estimate in minutes
|
|
520
|
+
- \`dueDate\` (optional): Due date string (ISO format)
|
|
521
|
+
- \`snoozeUntil\` (optional): Snooze until date string (ISO format)
|
|
522
|
+
- \`private\` (optional): Whether the task is private
|
|
523
|
+
- \`taskId\` (optional): Custom task ID
|
|
524
|
+
- Returns: JSON with task creation result
|
|
439
525
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
_id: string;
|
|
447
|
-
email: string;
|
|
448
|
-
firstName: string;
|
|
449
|
-
lastName: string;
|
|
450
|
-
timezone: string;
|
|
451
|
-
avatarUrl?: string;
|
|
452
|
-
};
|
|
453
|
-
primaryGroup?: {
|
|
454
|
-
groupId: string;
|
|
455
|
-
name: string;
|
|
456
|
-
role?: string;
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
|
-
\`\`\`
|
|
526
|
+
- **update-task-complete**: Mark a task as complete
|
|
527
|
+
- Parameters:
|
|
528
|
+
- \`taskId\` (required): The ID of the task to mark as complete
|
|
529
|
+
- \`completeOn\` (optional): Completion timestamp (ISO format)
|
|
530
|
+
- \`limitResponsePayload\` (optional): Whether to limit response size
|
|
531
|
+
- Returns: JSON with completion result
|
|
460
532
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
status: string;
|
|
468
|
-
createdAt: string;
|
|
469
|
-
updatedAt: string;
|
|
470
|
-
scheduledDate?: string;
|
|
471
|
-
completedAt?: string;
|
|
472
|
-
streamId?: string;
|
|
473
|
-
userId: string;
|
|
474
|
-
groupId: string;
|
|
475
|
-
}
|
|
476
|
-
\`\`\`
|
|
533
|
+
- **delete-task**: Delete a task permanently
|
|
534
|
+
- Parameters:
|
|
535
|
+
- \`taskId\` (required): The ID of the task to delete
|
|
536
|
+
- \`limitResponsePayload\` (optional): Whether to limit response size
|
|
537
|
+
- \`wasTaskMerged\` (optional): Whether the task was merged before deletion
|
|
538
|
+
- Returns: JSON with deletion result
|
|
477
539
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
groupId: string;
|
|
486
|
-
isActive: boolean;
|
|
487
|
-
createdAt: string;
|
|
488
|
-
updatedAt: string;
|
|
489
|
-
}
|
|
490
|
-
\`\`\`
|
|
540
|
+
- **update-task-snooze-date**: Reschedule tasks or move to backlog
|
|
541
|
+
- Parameters:
|
|
542
|
+
- \`taskId\` (required): The ID of the task to reschedule
|
|
543
|
+
- \`newDay\` (required): Target date in YYYY-MM-DD format, or null for backlog
|
|
544
|
+
- \`timezone\` (optional): Timezone string
|
|
545
|
+
- \`limitResponsePayload\` (optional): Whether to limit response size
|
|
546
|
+
- Returns: JSON with update result
|
|
491
547
|
|
|
492
|
-
|
|
493
|
-
-
|
|
494
|
-
-
|
|
495
|
-
-
|
|
496
|
-
-
|
|
548
|
+
### Stream Operations
|
|
549
|
+
- **get-streams**: Get streams for the user's group
|
|
550
|
+
- Parameters: none
|
|
551
|
+
- Returns: TSV of Stream objects
|
|
552
|
+
- Note: Streams are called "channels" in the Sunsama UI
|
|
553
|
+
|
|
554
|
+
## Response Optimization
|
|
555
|
+
- **Task Filtering**: Applied before processing for efficiency
|
|
556
|
+
- **Task Trimming**: Removes non-essential fields, reducing payload by 60-80%
|
|
557
|
+
- **TSV Format**: Used for arrays to optimize data processing
|
|
497
558
|
|
|
498
559
|
## Environment Setup
|
|
499
|
-
|
|
500
|
-
|
|
560
|
+
|
|
561
|
+
### Required (Stdio Transport)
|
|
501
562
|
- \`SUNSAMA_EMAIL\`: Sunsama account email
|
|
502
563
|
- \`SUNSAMA_PASSWORD\`: Sunsama account password
|
|
503
|
-
|
|
564
|
+
|
|
565
|
+
### Optional Configuration
|
|
566
|
+
- \`TRANSPORT_TYPE\`: "stdio" (default) | "httpStream"
|
|
567
|
+
- \`PORT\`: Server port for HTTP transport (default: 3002)
|
|
568
|
+
|
|
569
|
+
## Error Handling
|
|
570
|
+
- Comprehensive parameter validation using Zod schemas
|
|
571
|
+
- Graceful handling of network errors with descriptive messages
|
|
572
|
+
- Session-specific error isolation in HTTP transport mode
|
|
573
|
+
- Proper authentication error responses
|
|
504
574
|
`.trim()
|
|
505
575
|
};
|
|
506
576
|
}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -17,6 +17,16 @@ export declare const getTasksByDaySchema: z.ZodObject<{
|
|
|
17
17
|
completionFilter?: "all" | "incomplete" | "completed" | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
export declare const getTasksBacklogSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
20
|
+
export declare const getArchivedTasksSchema: z.ZodObject<{
|
|
21
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
offset?: number | undefined;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
offset?: number | undefined;
|
|
28
|
+
limit?: number | undefined;
|
|
29
|
+
}>;
|
|
20
30
|
/**
|
|
21
31
|
* User Operation Schemas
|
|
22
32
|
*/
|
|
@@ -84,7 +94,7 @@ export declare const deleteTaskSchema: z.ZodObject<{
|
|
|
84
94
|
}>;
|
|
85
95
|
export declare const updateTaskSnoozeDateSchema: z.ZodObject<{
|
|
86
96
|
taskId: z.ZodString;
|
|
87
|
-
newDay: z.
|
|
97
|
+
newDay: z.ZodUnion<[z.ZodString, z.ZodNull]>;
|
|
88
98
|
timezone: z.ZodOptional<z.ZodString>;
|
|
89
99
|
limitResponsePayload: z.ZodOptional<z.ZodBoolean>;
|
|
90
100
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -523,6 +533,7 @@ export declare const errorResponseSchema: z.ZodObject<{
|
|
|
523
533
|
export type CompletionFilter = z.infer<typeof completionFilterSchema>;
|
|
524
534
|
export type GetTasksByDayInput = z.infer<typeof getTasksByDaySchema>;
|
|
525
535
|
export type GetTasksBacklogInput = z.infer<typeof getTasksBacklogSchema>;
|
|
536
|
+
export type GetArchivedTasksInput = z.infer<typeof getArchivedTasksSchema>;
|
|
526
537
|
export type GetUserInput = z.infer<typeof getUserSchema>;
|
|
527
538
|
export type GetStreamsInput = z.infer<typeof getStreamsSchema>;
|
|
528
539
|
export type CreateTaskInput = z.infer<typeof createTaskSchema>;
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AAGH,eAAO,MAAM,sBAAsB,+CAA6C,CAAC;AAGjF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAGH,eAAO,MAAM,qBAAqB,gDAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"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"}
|
package/dist/schemas.js
CHANGED
|
@@ -12,6 +12,11 @@ export const getTasksByDaySchema = z.object({
|
|
|
12
12
|
});
|
|
13
13
|
// Get tasks backlog parameters (no parameters needed)
|
|
14
14
|
export const getTasksBacklogSchema = z.object({});
|
|
15
|
+
// Get archived tasks parameters
|
|
16
|
+
export const getArchivedTasksSchema = z.object({
|
|
17
|
+
offset: z.number().int().min(0).optional().describe("Pagination offset (defaults to 0)"),
|
|
18
|
+
limit: z.number().int().min(1).max(1000).optional().describe("Maximum number of tasks to return (defaults to 100)"),
|
|
19
|
+
});
|
|
15
20
|
/**
|
|
16
21
|
* User Operation Schemas
|
|
17
22
|
*/
|
|
@@ -51,7 +56,10 @@ export const deleteTaskSchema = z.object({
|
|
|
51
56
|
// Update task snooze date parameters
|
|
52
57
|
export const updateTaskSnoozeDateSchema = z.object({
|
|
53
58
|
taskId: z.string().min(1, "Task ID is required").describe("The ID of the task to reschedule"),
|
|
54
|
-
newDay: z.
|
|
59
|
+
newDay: z.union([
|
|
60
|
+
z.string().date("Must be a valid date in YYYY-MM-DD format"),
|
|
61
|
+
z.null()
|
|
62
|
+
]).describe("Target date in YYYY-MM-DD format, or null to move to backlog"),
|
|
55
63
|
timezone: z.string().optional().describe("Timezone string (e.g., 'America/New_York'). If not provided, uses user's default timezone"),
|
|
56
64
|
limitResponsePayload: z.boolean().optional().describe("Whether to limit the response payload size"),
|
|
57
65
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-sunsama",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "MCP server for Sunsama API integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"inspect": "npx @modelcontextprotocol/inspector --config ./mcp-inspector.json --server sunsama",
|
|
20
20
|
"changeset": "changeset",
|
|
21
21
|
"version": "changeset version",
|
|
22
|
-
"release": "bun run build && changeset publish"
|
|
22
|
+
"release": "bun run build && changeset publish",
|
|
23
|
+
"prepublishOnly": "bun run build"
|
|
23
24
|
},
|
|
24
25
|
"dependencies": {
|
|
25
26
|
"@types/papaparse": "^5.3.16",
|
package/src/main.ts
CHANGED
|
@@ -31,7 +31,7 @@ if (transportConfig.transportType === "stdio") {
|
|
|
31
31
|
|
|
32
32
|
const server = new FastMCP({
|
|
33
33
|
name: "Sunsama API Server",
|
|
34
|
-
version: "0.5.
|
|
34
|
+
version: "0.5.2",
|
|
35
35
|
instructions: `
|
|
36
36
|
This MCP server provides access to the Sunsama API for task and project management.
|
|
37
37
|
|
package/src/schemas.ts
CHANGED
|
@@ -70,7 +70,10 @@ export const deleteTaskSchema = z.object({
|
|
|
70
70
|
// Update task snooze date parameters
|
|
71
71
|
export const updateTaskSnoozeDateSchema = z.object({
|
|
72
72
|
taskId: z.string().min(1, "Task ID is required").describe("The ID of the task to reschedule"),
|
|
73
|
-
newDay: z.
|
|
73
|
+
newDay: z.union([
|
|
74
|
+
z.string().date("Must be a valid date in YYYY-MM-DD format"),
|
|
75
|
+
z.null()
|
|
76
|
+
]).describe("Target date in YYYY-MM-DD format, or null to move to backlog"),
|
|
74
77
|
timezone: z.string().optional().describe("Timezone string (e.g., 'America/New_York'). If not provided, uses user's default timezone"),
|
|
75
78
|
limitResponsePayload: z.boolean().optional().describe("Whether to limit the response payload size"),
|
|
76
79
|
});
|
package/TODO-0_5_0.md
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
# Sunsama MCP Server - Implementation Status & Future Plans
|
|
2
|
-
|
|
3
|
-
## Current Status (⚠️ Update Required)
|
|
4
|
-
|
|
5
|
-
**Package Version**: sunsama-api v0.6.0 (updated 2025-06-20)
|
|
6
|
-
|
|
7
|
-
The MCP server currently implements **61.5% coverage** (8/13 methods) of available methods in the sunsama-api package.
|
|
8
|
-
|
|
9
|
-
**NEW METHODS AVAILABLE**: 5 additional methods are now available in sunsama-api v0.6.0 that need MCP tool implementation.
|
|
10
|
-
|
|
11
|
-
### Implemented Tools
|
|
12
|
-
|
|
13
|
-
#### User Operations
|
|
14
|
-
- ✅ `get-user` → `SunsamaClient.getUser()`
|
|
15
|
-
- Returns user profile, timezone, and group information
|
|
16
|
-
|
|
17
|
-
#### Task Operations
|
|
18
|
-
- ✅ `get-tasks-by-day` → `SunsamaClient.getTasksByDay(day, timezone?)`
|
|
19
|
-
- Supports completion filtering (`all`, `incomplete`, `completed`)
|
|
20
|
-
- Includes task trimming for response optimization
|
|
21
|
-
- ✅ `get-tasks-backlog` → `SunsamaClient.getTasksBacklog()`
|
|
22
|
-
- Returns all backlog tasks with trimming optimization
|
|
23
|
-
- ✅ `create-task` → `SunsamaClient.createTask(text, options?)`
|
|
24
|
-
- Full parameter support: notes, timeEstimate, dueDate, streamIds, etc.
|
|
25
|
-
- ✅ `update-task-complete` → `SunsamaClient.updateTaskComplete(taskId, completeOn?, limitResponsePayload?)`
|
|
26
|
-
- Mark tasks as complete with optional timestamp
|
|
27
|
-
- ✅ `delete-task` → `SunsamaClient.deleteTask(taskId, limitResponsePayload?, wasTaskMerged?)`
|
|
28
|
-
- Permanent task deletion
|
|
29
|
-
- ✅ `update-task-snooze-date` → `SunsamaClient.updateTaskSnoozeDate(taskId, newDay, options?)`
|
|
30
|
-
- Reschedule tasks or move to backlog
|
|
31
|
-
|
|
32
|
-
#### Stream Operations
|
|
33
|
-
- ✅ `get-streams` → `SunsamaClient.getStreamsByGroupId()`
|
|
34
|
-
- Returns all available streams (channels) for the user's group
|
|
35
|
-
|
|
36
|
-
## Future Enhancements
|
|
37
|
-
|
|
38
|
-
### 1. Archived Tasks (Priority: Medium)
|
|
39
|
-
**Status**: Research needed - API exists but not in sunsama-api package
|
|
40
|
-
|
|
41
|
-
**Description**: Implement support for retrieving archived tasks
|
|
42
|
-
- **API Endpoint**: `/get-archived-tasks` (confirmed in dev/user-stories/)
|
|
43
|
-
- **Parameters**: `userId`, `groupId`, `offset`, `limit`, optional filters
|
|
44
|
-
- **Returns**: Archived tasks with `archivedAt` timestamps
|
|
45
|
-
|
|
46
|
-
**Implementation Steps**:
|
|
47
|
-
1. **Upstream Work**: Add `getArchivedTasks()` method to sunsama-api package
|
|
48
|
-
2. **MCP Tool**: Implement `get-archived-tasks` tool with:
|
|
49
|
-
- Pagination support (`offset`, `limit`)
|
|
50
|
-
- Date range filtering (`dateFrom`, `dateTo`)
|
|
51
|
-
- Stream filtering
|
|
52
|
-
- Response trimming optimization
|
|
53
|
-
|
|
54
|
-
### 2. Enhanced Task Management (Priority: Low)
|
|
55
|
-
**Potential Extensions**:
|
|
56
|
-
- Task bulk operations (bulk delete, bulk complete)
|
|
57
|
-
- Task search/filtering by content
|
|
58
|
-
- Task time tracking integration
|
|
59
|
-
- Task dependency management
|
|
60
|
-
|
|
61
|
-
### 3. Advanced Stream Operations (Priority: Low)
|
|
62
|
-
**Potential Extensions**:
|
|
63
|
-
- Stream creation/modification (if API supports)
|
|
64
|
-
- Stream-specific task queries
|
|
65
|
-
- Stream statistics/analytics
|
|
66
|
-
|
|
67
|
-
### 4. Performance Optimizations (Priority: Low)
|
|
68
|
-
**Current Optimizations**:
|
|
69
|
-
- ✅ Task filtering before processing
|
|
70
|
-
- ✅ Response payload trimming (60-80% reduction)
|
|
71
|
-
- ✅ Dual transport support (stdio/HTTP)
|
|
72
|
-
|
|
73
|
-
**Future Optimizations**:
|
|
74
|
-
- Response caching for frequently accessed data
|
|
75
|
-
- Batch operations for multiple task updates
|
|
76
|
-
- Streaming responses for large datasets
|
|
77
|
-
|
|
78
|
-
## Development Notes
|
|
79
|
-
|
|
80
|
-
### Architecture Strengths
|
|
81
|
-
- Complete dual transport support (stdio + HTTP stream)
|
|
82
|
-
- Robust authentication handling per transport type
|
|
83
|
-
- Comprehensive error handling and validation
|
|
84
|
-
- Response optimization strategies
|
|
85
|
-
- Type-safe parameter validation with Zod schemas
|
|
86
|
-
|
|
87
|
-
### Maintenance Tasks
|
|
88
|
-
- ✅ Version synchronization (package.json ↔ src/main.ts)
|
|
89
|
-
- Monitor sunsama-api updates for new methods
|
|
90
|
-
- Update dependencies regularly
|
|
91
|
-
- Maintain test coverage
|
|
92
|
-
|
|
93
|
-
### Contributing Guidelines
|
|
94
|
-
- Follow existing patterns in `src/main.ts`
|
|
95
|
-
- Use Zod schemas for parameter validation
|
|
96
|
-
- Implement response trimming for large datasets
|
|
97
|
-
- Support both transport modes
|
|
98
|
-
- Add comprehensive tool descriptions
|
|
99
|
-
|
|
100
|
-
## Conclusion
|
|
101
|
-
|
|
102
|
-
The current implementation provides complete coverage of the sunsama-api package with a robust, well-architected foundation. Future enhancements should focus on:
|
|
103
|
-
|
|
104
|
-
1. **Upstream API Development**: Contributing archived tasks functionality to sunsama-api
|
|
105
|
-
2. **Advanced Features**: Building on the solid foundation for enhanced productivity workflows
|
|
106
|
-
3. **Performance**: Continuous optimization as usage scales
|
|
107
|
-
|
|
108
|
-
The codebase is well-positioned for extension and maintenance with clear patterns and comprehensive documentation.
|