Used as the runtime environment for the MCP server, providing fast JavaScript/TypeScript execution for the Sunsama integration.
Supports environment variable configuration for authentication and server settings through .env files.
Used for version control and development workflow of the MCP-Sunsama project.
Source code repository hosting for the MCP-Sunsama project with issue tracking capabilities.
Sunsama MCP Server
A Model Context Protocol (MCP) server that provides comprehensive task management capabilities through the Sunsama API. This server enables AI assistants to access Sunsama tasks, create new tasks, mark tasks complete, and manage your productivity workflow.
Features
Task Management
Create Tasks - Create new tasks with notes, time estimates, due dates, stream assignments, and GitHub/Gmail integrations
Read Tasks - Get tasks by day with completion filtering, access backlog tasks, retrieve archived task history
Update Tasks - Mark tasks as complete with custom timestamps, reschedule tasks or move to backlog
Delete Tasks - Permanently remove tasks from your workspace
User & Stream Operations
User Information - Access user profile, timezone, and group details
Stream Management - Get streams/channels for project organization
Dual Transport - Support for both stdio and HTTP stream MCP transports
Related MCP server: DeltaTask MCP Server
Installation
Prerequisites
Bun runtime (for development)
Sunsama account with API access
Using NPX (Recommended)
No installation required! Use directly with:
Development Setup
Clone the repository:
Install dependencies:
Set up your environment variables:
Environment variables:
SUNSAMA_EMAIL- Your Sunsama account email (required for stdio transport)SUNSAMA_PASSWORD- Your Sunsama account password (required for stdio transport)TRANSPORT_MODE- Transport type:stdio(default) orhttpPORT- Server port for HTTP transport (default: 8080)HTTP_ENDPOINT- MCP endpoint path (default:/mcp)SESSION_TTL- Session timeout in milliseconds (default: 3600000 / 1 hour)CLIENT_IDLE_TIMEOUT- Client idle timeout in milliseconds (default: 900000 / 15 minutes)MAX_SESSIONS- Maximum concurrent sessions for HTTP transport (default: 100)
Usage
Transport Modes
This server supports two transport modes:
Stdio Transport (Default)
For local AI assistants (Claude Desktop, Cursor, etc.):
HTTP Stream Transport
For remote access and web-based integrations:
HTTP Endpoints:
MCP Endpoint:
POST http://localhost:8080/mcpHealth Check:
GET http://localhost:8080/
Authentication: HTTP requests require HTTP Basic Auth with your Sunsama credentials:
Claude Desktop Configuration
Add this configuration to your Claude Desktop MCP settings:
API Tools
Task Management
create-task- Create new tasks with optional properties including GitHub issue/PR and Gmail integrationget-tasks-by-day- Get tasks for a specific day with completion filteringget-tasks-backlog- Get backlog tasksget-archived-tasks- Get archived tasks with pagination (includes hasMore flag for LLM context)get-task-by-id- Get a specific task by its IDupdate-task-complete- Mark tasks as completeupdate-task-planned-time- Update the planned time (time estimate) for tasksupdate-task-notes- Update task notes content (requires eitherhtmlormarkdownparameter, mutually exclusive)update-task-due-date- Update the due date for tasks (set or clear due dates)update-task-text- Update the text/title of tasksupdate-task-stream- Update the stream/channel assignment for tasksupdate-task-snooze-date- Reschedule tasks to different datesupdate-task-backlog- Move tasks to the backlogdelete-task- Delete tasks permanently
User & Stream Operations
get-user- Get current user informationget-streams- Get streams/channels for project organization
Integration Examples
The create-task tool supports linking tasks to external services like GitHub and Gmail.
GitHub Integration
Link a task to a GitHub issue:
Link a task to a GitHub pull request:
Gmail Integration
Link a task to a Gmail email:
Note: All integration parameters are optional. Tasks can be created without integrations for standard task management.
Development
Running in Development
Testing with MCP Inspector
Then connect the MCP Inspector to test the tools interactively.
Testing
Build and Type Checking
Release Process
For information on creating releases and publishing to npm, see CONTRIBUTING.md.
Code Architecture
The server is organized with a modular, resource-based architecture:
Key Features:
Type Safety: Full TypeScript typing with Zod schema validation
Parameter Destructuring: Clean, explicit function signatures
Shared Utilities: Common patterns extracted to reduce duplication
Error Handling: Standardized error handling across all tools
Response Optimization: Task filtering and trimming for large datasets
Session Management: Dual-layer caching with TTL-based lifecycle management
Test Coverage: 251+ unit tests and comprehensive integration tests
Authentication
Stdio Transport: Requires SUNSAMA_EMAIL and SUNSAMA_PASSWORD environment variables.
HTTP Transport: Credentials provided via HTTP Basic Auth per request. No environment variables needed for credentials.
Contributing
We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines on:
Development workflow
Code style and conventions
Testing requirements
Release process (for maintainers)
Quick start:
Fork and clone the repository
Install dependencies:
bun installMake your changes
Create a changeset:
bun run changesetSubmit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
sunsama-api Library - The underlying API client