MCPInstall
Open Sunsama logo

Open Sunsama

by kaijiabo 188 stars kaijiabo/open-sunsama

Daily planner: tasks, subtasks, time blocks, Ideas boards and synced calendar events.

READMEHEAD

Open Sunsama MCP Server

An MCP (Model Context Protocol) server that enables AI agents like Claude, ChatGPT, Cursor, and other AI assistants to manage your tasks, time blocks, calendar, and Ideas through the Open Sunsama API.

Most people don't need this package. Open Sunsama hosts the same server at https://api.opensunsama.com/mcp with OAuth sign-in. Add that URL to Claude (Settings → Customize → Connectors), ChatGPT (Developer mode → Plugins), Claude Code, or Cursor, then sign in and allow access. There's no API key. See the setup guides.

Use this npm package (the local stdio server + API key) for clients without OAuth support, scripts, CI, or self-hosted instances that aren't reachable from the internet.

Features

  • Task Management: Create, update, complete, delete, and schedule tasks
  • Time Blocking: Schedule focused work sessions on your calendar
  • Subtasks: Break down tasks into smaller actionable items
  • Ideas: Manage boards, columns, cards, and checklists, and promote ideas to tasks
  • User Profile: Access and update user preferences
  • Full CRUD Operations: Complete API coverage for AI-assisted productivity

Prerequisites

  1. An Open Sunsama account (cloud: opensunsama.com or self-hosted)
  2. An API key from your Open Sunsama account
  3. Node.js 18+ or Bun runtime

Installation

Quick Start (local server)

No installation required. Use npx to run it directly:

{
  "mcpServers": {
    "open-sunsama": {
      "command": "npx",
      "args": ["-y", "@open-sunsama/mcp"],
      "env": {
        "OPENSUNSAMA_API_KEY": "os_your-api-key-here"
      }
    }
  }
}

From Source (Development)

# Clone the repository (the mcp package is a workspace of the monorepo)
git clone https://github.com/kaijiabo/open-sunsama.git
cd open-sunsama
bun install

# Build
bun run --filter=@open-sunsama/mcp build

The tools live in src/tools/ and are shared with the hosted server: the API imports createOpenSunsamaMcpServer from @open-sunsama/mcp/server and serves it at /mcp.

Getting an API Key

The fastest way: in the web app, open Settings → MCP, expand Use an API key instead, and click Generate key. The configs are filled in for you.

Or create one with custom scopes:

  1. Open the Open Sunsama web app
  2. Go to Settings → API Keys
  3. Click "Generate New Key"
  4. Select scopes:
    • tasks:read and tasks:write for task management
    • time-blocks:read and time-blocks:write for time blocks
    • calendar:read for events from connected Google, Outlook and iCloud calendars
    • ideas:read and ideas:write for idea boards, columns, cards, and checklists
    • user:read and user:write for profile access
  5. Copy the key (it's only shown once!)

Configuration

Environment Variables

VariableRequiredDefaultDescription
OPENSUNSAMA_API_KEYYes-Your API key starting with os_
OPENSUNSAMA_API_URLNohttps://api.opensunsama.comAPI server URL

Self-Hosted / Local Development

If you're running the API locally or self-hosting, set OPENSUNSAMA_API_URL to your API URL:

{
  "env": {
    "OPENSUNSAMA_API_KEY": "os_your-api-key",
    "OPENSUNSAMA_API_URL": "http://localhost:3001"
  }
}

Note: If you're using the official cloud version at opensunsama.com, you can omit OPENSUNSAMA_API_URL (defaults to https://api.opensunsama.com).

Usage with AI Assistants

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "open-sunsama": {
      "command": "npx",
      "args": ["-y", "@open-sunsama/mcp"],
      "env": {
        "OPENSUNSAMA_API_KEY": "os_your-api-key-here"
      }
    }
  }
}

Self-hosted/Local: Add "OPENSUNSAMA_API_URL": "http://localhost:3001" to the env object

Cursor

Create .cursor/mcp.json in your project root or configure in Cursor Settings → MCP:

{
  "mcpServers": {
    "open-sunsama": {
      "command": "npx",
      "args": ["-y", "@open-sunsama/mcp"],
      "env": {
        "OPENSUNSAMA_API_KEY": "os_your-api-key-here"
      }
    }
  }
}

Self-hosted/Local: Add "OPENSUNSAMA_API_URL": "http://localhost:3001" to the env object

VS Code with Continue Extension

Add to ~/.continue/config.json:

{
  "mcpServers": [
    {
      "name": "open-sunsama",
      "command": "npx",
      "args": ["-y", "@open-sunsama/mcp"],
      "env": {
        "OPENSUNSAMA_API_KEY": "os_your-api-key-here"
      }
    }
  ]
}

Windsurf / Cline / Other MCP-Compatible Tools

Most tools use a similar configuration format:

{
  "mcpServers": {
    "open-sunsama": {
      "command": "npx",
      "args": ["-y", "@open-sunsama/mcp"],
      "env": {
        "OPENSUNSAMA_API_KEY": "os_your-api-key-here"
      }
    }
  }
}

Running with Bunx

If you prefer Bun over Node.js:

{
  "mcpServers": {
    "open-sunsama": {
      "command": "bunx",
      "args": ["@open-sunsama/mcp"],
      "env": {
        "OPENSUNSAMA_API_KEY": "os_your-api-key-here"
      }
    }
  }
}

Available Tools

Task Management

ToolDescription
list_tasksList tasks with filters (date, range, completion status, backlog)
get_taskGet detailed information about a specific task
create_taskCreate a new task with title, notes, priority, schedule
update_taskUpdate task fields (title, notes, priority, schedule)
complete_taskMark a task as complete
uncomplete_taskReopen a completed task
delete_taskPermanently delete a task
schedule_taskMove a task to a specific date or backlog
reorder_tasksReorder tasks within a date

Subtask Management

ToolDescription
list_subtasksList all subtasks for a task
create_subtaskAdd a subtask to a task
toggle_subtaskToggle subtask completion
update_subtaskUpdate subtask title/position
delete_subtaskDelete a subtask

Time Block Management

ToolDescription
list_time_blocksList time blocks with filters
get_time_blockGet details of a time block
create_time_blockSchedule a new time block
update_time_blockUpdate time block details
delete_time_blockRemove a time block
link_task_to_time_blockLink/unlink a task to a time block
get_schedule_for_dayGet a day's calendar events and time blocks in one view

Calendar Events (read-only)

ToolDescription
list_calendar_eventsList events from connected Google, Outlook and iCloud calendars for a day or range

User Profile

ToolDescription
get_user_profileGet current user's profile
update_user_profileUpdate name, timezone, preferences

Example Interactions

Once configured, you can ask your AI assistant things like:

Task Management

  • "What tasks do I have scheduled for today?"
  • "Create a task to review the quarterly report with high priority"
  • "Mark my 'Send emails' task as complete"
  • "Move the 'Research competitors' task to next Monday"
  • "Show me all my backlog tasks"

Time Blocking

  • "Block 2 hours tomorrow morning for deep work starting at 9 AM"
  • "What does my schedule look like for Friday?"
  • "Link my 'Write documentation' task to my 2 PM time block"
  • "Delete the meeting block I created for today"

Subtasks

  • "Add subtasks to my 'Prepare presentation' task: create slides, add charts, practice delivery"
  • "Check off the 'create slides' subtask"
  • "What subtasks are left on my project task?"

Planning

  • "Help me plan my day around my meetings - I need to do code review and write docs"
  • "When am I free tomorrow afternoon?"
  • "Schedule my tasks for this week based on priority"

Testing

Run the test suite to verify your setup:

# Set your API key
export OPENSUNSAMA_API_KEY=os_your-api-key-here

# Run all tests against the live API
bun run test:live

# Or run individual test suites
bun run test:tasks
bun run test:time-blocks
bun run test:subtasks

Hosted server OAuth flow

tests/oauth-e2e.ts drives the full OAuth connector flow (discovery, registration, PKCE, consent, token refresh, revocation, CIMD clients, API keys) with the official MCP SDK client. Point it at a local API, since it creates a throwaway account:

MCP_E2E_API_URL=http://localhost:3001 bun run tests/oauth-e2e.ts

Using MCP Inspector

For interactive testing and debugging:

export OPENSUNSAMA_API_KEY=os_your-api-key-here
bun run inspector

This opens a web UI where you can test each tool manually.

Troubleshooting

"OPENSUNSAMA_API_KEY environment variable is required"

Make sure you've set the API key in your MCP configuration:

{
  "env": {
    "OPENSUNSAMA_API_KEY": "os_your-actual-key"
  }
}

"Network request failed" or Connection Errors

  1. Verify the API is reachable: curl https://api.opensunsama.com/health
  2. If self-hosted/local, check OPENSUNSAMA_API_URL is correct
  3. Ensure your API key has the required scopes

Tools Not Appearing in AI Assistant

  1. Restart your AI assistant after changing the configuration
  2. Check the configuration file path is correct
  3. Verify npx is available in your PATH (try running npx -v in terminal)

"Authentication required" or 401 Errors

  1. Verify your API key is valid and not expired
  2. Check that your key has the required scopes for the operation
  3. Generate a new API key if needed

Development

Project Structure

mcp/
├── src/
│   ├── index.ts          # Main entry point
│   ├── lib/
│   │   └── api-client.ts # HTTP client for Open Sunsama API
│   └── tools/
│       ├── tasks.ts      # Task management tools
│       ├── time-blocks.ts# Time block tools
│       ├── subtasks.ts   # Subtask tools
│       ├── calendar-events.ts # Calendar event tools (read-only)
│       └── user.ts       # User profile tools
├── tests/
│   └── test-all.ts       # Comprehensive test suite
├── build/                # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

Building

bun run build    # Compile TypeScript
bun run dev      # Watch mode for development

Adding New Tools

  1. Create or edit a file in src/tools/
  2. Use the server.tool() pattern with Zod schemas for validation
  3. Register your tools in src/index.ts
  4. Rebuild and test

API Key Scopes

ScopePermissions
tasks:readList and view tasks
tasks:writeCreate, update, delete tasks
time-blocks:readList and view time blocks
time-blocks:writeCreate, update, delete time blocks
calendar:readList events from connected calendars
ideas:readList idea boards, columns, cards, and checklists
ideas:writeCreate, update, delete, and reorder ideas
user:readView user profile
user:writeUpdate user profile

License

This MCP server is part of the Open Sunsama project and follows the same license terms. See the main repository LICENSE file for details.

Support

More Productivity & Workflow MCP servers

Similar servers from the same category.

Integrates with monday.com API to enable direct access to boards, workflows, and data for automating tasks and managing resources without context switching.

Productivity & Workflow
Activepieces logo

Activepieces

activepieces

Dynamic server to which you can add apps (Google Calendar, Notion, etc) or advanced Activepieces Flows (Refund logic, a research and enrichment logic, etc).

search
Time logo

Time

modelcontextprotocol

Time and timezone conversion capabilities

timeconversion

Interact with Microsoft Word.

word