# mcp-sunsama
## 0.18.0
### Minor Changes
- f806778: Add three new tools for sunsama-api 0.14.0 endpoints:
- `reorder-task` — move a task to a specific 0-based position within a day
- `create-calendar-event` — create a new calendar event (with optional stream links, visibility, and task seed)
- `update-calendar-event` — update an existing calendar event (requires full CalendarEventUpdateData)
- f806778: Add `update-task-uncomplete` tool to mark a completed task as incomplete, wrapping the previously missing `SunsamaClient.updateTaskUncomplete()` method.
### Patch Changes
- 846299b: Fix HTTP transport returning 401 for all errors instead of only authentication failures. Non-auth errors (transport failures, unexpected exceptions) now correctly return 500.
- c1badc0: Fix HTTP transport tools always falling through to stdio client. The MCP SDK provides `sessionId` as a string on the `extra` object, not a nested `session` object. `client-resolver` now checks `extra.sessionId` to look up the per-request authenticated client in `SessionManager`.
- d3f81d7: Add retry with exponential backoff for 429 rate limit errors during login. Both stdio startup auth and HTTP per-request auth now retry up to 3 times (delays: 1s, 5s, 15s) when `SunsamaAuthError` contains "429". Non-429 errors are rethrown immediately.
- 3f0070a: Eliminate any types in shared tool infrastructure. ToolConfig is now generic over the Zod schema so tool execute functions receive properly typed args. ToolContext.client is typed as SunsamaClient and session as unknown, removing the catch-all index signature.
- af74a9d: Update sunsama-api dependency to 0.14.0 (bug fix release — no new endpoints).
## 0.17.0
### Minor Changes
- 26000bd: Add subtask management support
- Update sunsama-api dependency to 0.13.1
- Add 5 new subtask management tools:
- `add-subtask` - Create a subtask with a title in one call (recommended)
- `create-subtasks` - Create multiple subtasks for a task (bulk operations)
- `update-subtask-title` - Update the title of a subtask
- `complete-subtask` - Mark a subtask as complete
- `uncomplete-subtask` - Mark a subtask as incomplete
- Update README and CLAUDE.md documentation
- e3336cf: Add session token authentication support for users with SSO/OAuth login. Users can now authenticate using `SUNSAMA_SESSION_TOKEN` environment variable (stdio) or Bearer token authentication (HTTP) as an alternative to email/password credentials.
## 0.16.1
### Patch Changes
- 5df00f4: Bump sunsama-api dependency from 0.12.0 to 0.12.1
- 14c0713: Fix update-task-notes tool failing with MCP error -32603. Removed Zod `.refine()` from schema which was causing MCP SDK to fail parsing the tool parameters. XOR validation between html/markdown is now handled at runtime.
## 0.16.0
### Minor Changes
- 56872df: Add GitHub and Gmail integration support to create-task tool
This minor release adds support for creating Sunsama tasks with GitHub and Gmail integrations, enabling users to convert GitHub issues/PRs and Gmail emails into tasks with proper linking and metadata.
**New Features:**
- Added `TaskGithubIntegration` schema with all required fields (id, repositoryOwnerLogin, repositoryName, number, type, url)
- Added `TaskGmailIntegration` schema with all required fields (id, messageId, accountId, url)
- Updated `create-task` tool to accept optional `integration` parameter
- Implemented discriminated union pattern for type-safe integration handling
- Full TypeScript support with Zod schema validation
**Migration:**
No breaking changes. This is a purely additive feature that extends existing functionality. The integration parameter is optional, so existing code will continue to work without modifications.
## 0.15.4
### Patch Changes
- eb40ca5: Fix executable permissions on bin file by adding postbuild script. Adds chmod +x to ensure dist/main.js is executable after build, resolving 'Permission denied' error when running via npx.
## 0.15.3
### Patch Changes
- b9cd204: Fix TypeScript build output by excluding **tests** from compilation. Version 0.15.2 broke because TypeScript was compiling both src/ and **tests**/ directories, causing files to be output to dist/src/ instead of dist/. Now excludes **tests** so production code builds directly to dist/.
## 0.15.2
### Patch Changes
- 6128d4c: Fix Node.js v20 compatibility by using sunsama-api subpath exports. Updates all imports to use explicit subpath exports ('sunsama-api/client' and 'sunsama-api/types') instead of root import, resolving ESM/CommonJS interoperability issues.
## 0.15.1
### Patch Changes
- 8924946: Bump sunsama-api to version 0.11.2
## 0.15.0
### Minor Changes
- f2a39f2: Add HTTP transport support with session management and comprehensive test suite
- Implement HTTP Stream transport alongside existing stdio transport
- Add dual-layer session caching (client cache + session manager)
- Implement TTL-based session management with configurable timeouts
- Add comprehensive unit test suite (251 tests)
- Add integration test suite for authenticated flows
- Reorganize tests into standard **tests** directory structure
- Add TypeScript types for better type safety in tests
## 0.14.1
### Patch Changes
- fix: resolve stdio authentication race condition
Fixes critical race condition in stdio authentication that caused "Global Sunsama client not initialized" errors and -32800 request cancelled errors in Raycast and other MCP clients. Implements lazy authentication with promise caching to prevent concurrent auth attempts and adds graceful startup error handling.
## 0.14.0
### Minor Changes
- Upgrade FastMCP dependency from 3.3.1 to 3.18.0
- Updated FastMCP to latest version for improved MCP protocol support and performance
- Added comprehensive CONTRIBUTING.md documentation with release process
- Improved README documentation structure
- All existing functionality remains compatible
## 0.13.0
### Minor Changes
- a39494b: Refactor to modular architecture with improved type safety
- **BREAKING**: Refactored codebase into modular, resource-based architecture
- **Major code organization improvements**:
- Extracted tools into separate files by resource type (user, task, stream)
- Reduced main.ts complexity by 96% (1162 → 47 lines)
- Created shared utilities for common patterns
- Moved API documentation to dedicated resources file
- **Complete type safety overhaul**:
- Eliminated all `any` types from function parameters
- Added proper TypeScript typing with Zod schema inference
- Implemented parameter destructuring for cleaner function signatures
- Added missing type exports to schemas
- **Enhanced developer experience**:
- Standardized error handling and logging across all tools
- Consistent response formatting with shared utilities
- Better code maintainability and testability
- Clear separation of concerns
- **New modular structure**:
```
src/tools/
├── shared.ts # Common utilities and patterns
├── user-tools.ts # User operations
├── task-tools.ts # Task operations (14 tools)
├── stream-tools.ts # Stream operations
└── index.ts # Export all tools
```
This refactoring maintains 100% API compatibility while significantly improving code quality, type safety, and maintainability.
## 0.12.1
### Patch Changes
- Update update-task-stream tool to use sunsama-api updateTaskStream method
- Replaced direct GraphQL implementation with sunsama-api updateTaskStream method
- Changed parameter from `streamIds` array to single `streamId` for API compatibility
- Updated schema validation and tests to match new single stream parameter
- Removed `recommendedStreamId` parameter as it's not supported by the API method
- Improved error handling and logging consistency
## 0.12.0
### Minor Changes
- 763b5b4: feat: add update-task-stream tool for task stream/channel assignment
Add new `update-task-stream` tool that allows updating the stream/channel assignment for existing Sunsama tasks. This tool provides the ability to:
- Assign tasks to one or more streams/channels
- Clear stream assignments by providing an empty array
- Set a recommended stream ID for the task
- Control response payload size with limitResponsePayload option
The tool follows the established patterns for parameter validation, error handling, and response formatting. Includes comprehensive test coverage and updated documentation.
- cde6e75: Add update-task-text tool for updating task titles/text
Implement new `update-task-text` MCP tool that allows updating the text/title of tasks using the Sunsama API. This tool follows the established patterns for task mutation operations and includes:
- Zod schema validation with comprehensive parameter documentation
- Support for optional recommended stream ID and response payload limiting
- Full test coverage with edge case validation
- Updated API documentation and README
## 0.11.0
### Minor Changes
- 9d0d694: feat: add update-task-due-date tool for setting and clearing task due dates
- Adds new `update-task-due-date` tool to set or clear task due dates using ISO datetime format or null
- Includes comprehensive parameter validation with Zod schema for taskId, dueDate, and limitResponsePayload
- Supports both setting due dates with ISO datetime strings and clearing due dates with null values
- Adds extensive test coverage with 11 test cases covering valid inputs, error cases, and edge conditions
- Updates API documentation and README with complete tool information
- Follows established patterns for dual transport support (stdio/httpStream) and response optimization
## 0.10.2
### Patch Changes
- Upgrades sunsama package to 0.8.1. Fixes create-task tool snooze date
## 0.10.1
### Patch Changes
- 002cd07: Fix MCP Inspector compatibility for update-task-notes schema
- Replace ZodIntersection (.and()) with single z.object() using .refine() for XOR validation
- Ensure schema generates proper JSON Schema with "type": "object" for MCP Inspector
- Add clear parameter descriptions indicating mutual exclusivity
- Maintain same validation behavior while fixing compatibility issues
- Update documentation to reflect schema architecture improvements
## 0.10.0
### Minor Changes
- 52e464c: Refactor update-task-notes schema to use XOR pattern for content parameters
- Replace nested content object with separate html and markdown parameters
- Implement XOR validation ensuring exactly one content type is provided
- Add comprehensive test coverage for the new schema pattern
- Update tool implementation to handle simplified parameter structure
- Update documentation across README.md, CLAUDE.md, and API docs
## 0.9.0
### Minor Changes
- 953ecb7: Add update-task-notes tool for updating task notes content
- New `update-task-notes` tool supports updating task notes with HTML or Markdown content
- Accepts either `{html: string}` or `{markdown: string}` content format (mutually exclusive)
- Includes optional `limitResponsePayload` parameter for response optimization
- Integrates with Sunsama's collaborative editing system for proper synchronization
- Follows established patterns for tool implementation and error handling
- Updates API documentation, README, and CLAUDE.md with new tool information
## 0.8.0
### Minor Changes
- 6585510: feat: add update-task-planned-time tool for updating task time estimates
This adds a new MCP tool that allows users to update the planned time (time estimate) for existing tasks in Sunsama. The tool accepts a task ID and time estimate in minutes, with optional response payload limiting.
Features:
- Update task time estimates in minutes (converted to seconds for API)
- Support for clearing time estimates by setting to 0
- Comprehensive input validation and error handling
- Full test coverage including edge cases
- Documentation updates for README and CLAUDE.md
The implementation follows established patterns in the codebase and leverages the existing sunsama-api updateTaskPlannedTime method.
## 0.7.0
### Minor Changes
- 3394176: Add get-task-by-id tool for retrieving specific tasks by their unique identifier
- Add `get-task-by-id` MCP tool that retrieves a specific task by its ID
- Add `getTaskByIdSchema` with taskId parameter validation
- Return complete task object if found, null if not found
- Follow standard tool patterns for authentication, error handling, and logging
- Update documentation in README.md and CLAUDE.md
- Maintain consistent JSON response format for single object retrieval
## 0.6.0
### Minor Changes
- 7c90fef: feat: add update-task-backlog tool for moving tasks to backlog
- Add new update-task-backlog tool that moves tasks to the backlog
- Update updateTaskSnoozeDateSchema to require newDay parameter
- Add comprehensive test coverage for the new tool
- Update documentation in README.md and CLAUDE.md
## 0.5.2
### Patch Changes
- Fix updateTaskSnoozeDate schema validation for null values by using proper union types
## 0.5.1
### Patch Changes
- 005209d: Add prepublishOnly script to ensure build runs before publishing
## 0.5.0
### Minor Changes
- 8478b69: Add get-archived-tasks tool with enhanced pagination
- Implement get-archived-tasks tool to access archived task history
- Add smart pagination with limit+1 pattern to determine if more results exist
- Include pagination metadata (hasMore flag, nextOffset, count) for LLM context
- Default limit set to 100 for optimal performance
- Response format includes TSV data with pagination header
- Update documentation in README.md and CLAUDE.md
## 0.4.0
### Minor Changes
- 8955a8f: Update the task integration response object and include the url if available
- 8955a8f: Add functional HTTP_ENDPOINT env variable
### Patch Changes
- 8955a8f: Improve transport configuration type safety with discriminated union and template literal validation
## 0.3.0
### Minor Changes
- cdbbdc6: Add update-task-snooze-date tool for comprehensive task scheduling
- New `update-task-snooze-date` MCP tool enables moving tasks between days, scheduling backlog tasks, and unscheduling tasks to backlog
- Supports timezone handling and response payload limiting options
- Uses existing sunsama-api `updateTaskSnoozeDate` method with proper Zod schema validation
- Addresses three key user stories through single unified tool interface
## 0.2.2
### Patch Changes
- 177cf46: Fix ES module import error in sunsama-api dependency by patching directory imports to include explicit file extensions
## 0.2.1
### Patch Changes
- Fix binary execution issue by adding Node.js shebang line
The npm package binary was failing to execute because it was missing the `#!/usr/bin/env node` shebang line at the top of the file. This caused the shell to treat the JavaScript file as a shell script instead of passing it to Node.js for execution.
## 0.2.0
### Minor Changes
- Initial release of MCP Sunsama Server
- Full CRUD task management (create, read, update, delete)
- Dual transport support (stdio and HTTP stream)
- User operations and stream management
- Task filtering by completion status
- Response optimization with task trimming
- Comprehensive TypeScript support with Zod validation
- Authentication support for session tokens and email/password
## 1.0.0
### Major Changes
- Initial release of MCP Sunsama Server
- Full CRUD task management (create, read, update, delete)
- Dual transport support (stdio and HTTP stream)
- User operations and stream management
- Task filtering by completion status
- Response optimization with task trimming
- Comprehensive TypeScript support with Zod validation
- Authentication support for session tokens and email/password