文档

sunsama

试用

通过 MCP 接入 Sunsama,统一管理任务、日程、待办列表、目标、计时器和邮件线程,认证由平台托管。

它能做什么

通过 Maton 代理以 MCP 协议连接 Sunsama,OAuth 授权由平台托管完成。连接后可以搜索、创建、编辑、完成和归档任务,管理子任务、待办文件夹和周目标;对任务进行排期、重排和时间盒设定;创建与管理日历事件;启动和停止任务计时器;以及对 Gmail 或 Outlook 中的邮件线程进行列表、标记已读、删除和创建跟进任务。所有写入操作都需要用户明确确认,邮件相关操作会直接影响已关联的邮箱账户。

什么时候用它

  • 每日任务规划与复盘
  • 待办列表整理与重新排期
  • 日历事件创建与任务时间盒
  • 处理 Gmail 或 Outlook 中的邮件线程

技能文档

Sunsama MCP

Access Sunsama via MCP (Model Context Protocol) with managed authentication.

Quick Start

python <<'EOF'
import urllib.request, os, json
data = json.dumps({'searchTerm': 'meeting'}).encode()
req = urllib.request.Request('https://api.maton.ai/sunsama/search_tasks', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Base URL

https://api.maton.ai/sunsama/{tool-name}

Maton proxies requests to Sunsama's MCP server and automatically injects your credentials. The {tool-name} corresponds to the MCP tool name (e.g., search_tasks).

Authentication

All requests require the Maton API key:

Authorization: Bearer $MATON_API_KEY

Environment Variable: Set your API key as MATON_API_KEY:

export MATON_API_KEY="YOUR_API_KEY"

Getting Your API Key

  1. Sign in or create an account at maton.ai
  2. Go to maton.ai/settings
  3. Copy your API key

Connection Management

Manage your Sunsama MCP connections at https://api.maton.ai.

List Connections

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections?app=sunsama&method=MCP&status=ACTIVE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Create Connection

python <<'EOF'
import urllib.request, os, json
data = json.dumps({'app': 'sunsama', 'method': 'MCP'}).encode()
req = urllib.request.Request('https://api.maton.ai/connections', data=data, method='POST')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
req.add_header('Content-Type', 'application/json')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Get Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Response:

{
  "connection": {
    "connection_id": "{connection_id}",
    "status": "PENDING",
    "creation_time": "2026-03-03T10:44:23.480898Z",
    "url": "https://connect.maton.ai/?session_token=...",
    "app": "sunsama",
    "method": "MCP",
    "metadata": {}
  }
}

Open the returned url in a browser to complete OAuth authorization.

Delete Connection

python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections/{connection_id}', method='DELETE')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Security & Permissions

  • Access is scoped to tasks, channels, timers, scheduling data, and email threads within the connected Sunsama account.
  • Email thread access spans connected email accounts. Sunsama can list, read, mark as read, delete, and create follow-up tasks from email threads in linked Gmail or Outlook accounts. Always confirm with the user before performing any email operation, as these actions affect the connected email account directly.
  • All write operations require explicit user approval. Before executing any create, update, or delete call — including email deletions and calendar event changes — confirm the target resource and intended effect with the user.

MCP Reference

All MCP tools use POST method:

Task Management

ToolDescriptionSchema
search_tasksSearch tasks by termschema
create_taskCreate a new taskschema
edit_task_titleUpdate task titleschema
delete_taskDelete a taskschema
mark_task_as_completedMark task completeschema
mark_task_as_incompleteMark task incompleteschema
append_task_notesAdd notes to taskschema
edit_task_time_estimateSet time estimateschema
edit_task_recurrence_ruleSet recurrenceschema
get_task_time_estimateGet AI time estimateschema
restore_taskRestore deleted taskschema

Subtasks

ToolDescriptionSchema
add_subtasks_to_taskAdd subtasksschema
edit_subtask_titleUpdate subtask titleschema
mark_subtask_as_completedMark subtask completeschema
mark_subtask_as_incompleteMark subtask incompleteschema

Backlog

ToolDescriptionSchema
get_backlog_tasksList backlog tasksschema
move_task_to_backlogMove task to backlogschema
move_task_from_backlogMove from backlog to dayschema
reposition_task_in_backlogReorder backlog taskschema
change_backlog_folderChange task folderschema
create_braindump_taskCreate backlog taskschema

Scheduling

ToolDescriptionSchema
move_task_to_dayReschedule taskschema
reorder_tasksReorder day's tasksschema
timebox_a_task_to_calendarBlock time for taskschema
set_shutdown_timeSet daily end timeschema

Calendar Events

ToolDescriptionSchema
create_calendar_eventCreate calendar eventschema
delete_calendar_eventDelete calendar eventschema
move_calendar_eventReschedule eventschema
import_task_from_calendar_eventImport event as taskschema
set_calendar_event_allow_task_projectionsToggle task overlapschema
accept_meeting_inviteAccept meetingschema
decline_meeting_inviteDecline meetingschema

Time Tracking

ToolDescriptionSchema
start_task_timerStart timerschema
stop_task_timerStop timerschema

Channels & Objectives

ToolDescriptionSchema
create_channelCreate channel/contextschema
add_task_to_channelAssign task to channelschema
create_weekly_objectiveCreate weekly goalschema
align_task_with_objectiveLink task to objectiveschema

Archive

ToolDescriptionSchema
get_archived_tasksList archived tasksschema
unarchive_taskRestore archived taskschema

Email Integration

ToolDescriptionSchema
list_email_threadsList email threadsschema
create_follow_up_task_from_emailCreate task from emailschema
delete_email_threadDelete email threadschema
mark_email_thread_as_readMark email as readschema

Recurring Tasks

ToolDescriptionSchema
delete_all_incomplete_recurring_task_instancesDelete future recurrencesschema
update_all_incomplete_recurring_task_instancesUpdate future recurrencesschema

Settings & Preferences

ToolDescriptionSchema
toggle_auto_import_eventsToggle event auto-importschema
update_calendar_preferencesUpdate calendar settingsschema
update_import_event_filtersSet event filtersschema
log_user_feedbackSubmit feedbackschema

Common Endpoints

Search Tasks

Search for tasks by keyword:

POST /sunsama/search_tasks
Content-Type: application/json

{
  "searchTerm": "meeting"
}

Response:

{
  "content": [
    {
      "type": "text",
      "text": "{\"tasks\":[{\"_id\":\"69a6bf3a04d3cd0001595308\",\"title\":\"Team meeting prep\",\"scheduledDate\":\"2026-03-03\",\"completed\":false}]}"
    }
  ],
  "isError": false
}

Create Task

Create a new task scheduled for a specific day:

POST /sunsama/create_task
Content-Type: application/json

{
  "title": "Review quarterly report",
  "day": "2026-03-03",
  "alreadyInTaskList": false
}

Response:

{
  "content": [
    {
      "type": "text",
      "text": "{\"success\":true,\"task\":{\"_id\":\"69a6bf3a04d3cd0001595308\",\"title\":\"Review quarterly report\",\"notes\":\"\",\"timeEstimate\":\"20 minutes\",\"sortOrder\":-1772535610535,\"isPersonal\":false,\"isWork\":true,\"isPrivate\":false,\"isArchived\":false,\"completed\":false,\"isBacklogged\":false,\"scheduledDate\":\"2026-03-03\",\"subtasks\":[],\"channel\":\"work\",\"folder\":null,\"timeboxEventIds\":[]}}"
    }
  ],
  "isError": false
}

Get Backlog Tasks

List all tasks in the backlog:

POST /sunsama/get_backlog_tasks
Content-Type: application/json

{}

Response:

{
  "content": [
    {
      "type": "text",
      "text": "{\"tasks\":[],\"queryId\":\"bb7d004a-0b29-49d9-8345-6d9037786fbb\",\"totalPages\":1}"
    }
  ],
  "isError": false
}

Mark Task as Completed

POST /sunsama/mark_task_as_completed
Content-Type: application/json

{
  "taskId": "69a6bf3a04d3cd0001595308",
  "finishedDay": "2026-03-03"
}

Add Subtasks to Task

POST /sunsama/add_subtasks_to_task
Content-Type: application/json

{
  "taskId": "69a6bf3a04d3cd0001595308",
  "subtasks": [
    {"title": "Step 1: Research"},
    {"title": "Step 2: Draft outline"},
    {"title": "Step 3: Review"}
  ]
}

Create Calendar Event

POST /sunsama/create_calendar_event
Content-Type: application/json

{
  "title": "Team standup",
  "startDate": "2026-03-03T09:00:00"
}

Move Task to Day

Reschedule a task to a different day:

POST /sunsama/move_task_to_day
Content-Type: application/json

{
  "taskId": "69a6bf3a04d3cd0001595308",
  "calendarDay": "2026-03-04"
}

Timebox Task to Calendar

Block time for a task on your calendar:

POST /sunsama/timebox_a_task_to_calendar
Content-Type: application/json

{
  "taskId": "69a6bf3a04d3cd0001595308",
  "startDate": "2026-03-03",
  "startTime": "14:00"
}

Create Weekly Objective

POST /sunsama/create_weekly_objective
Content-Type: application/json

{
  "title": "Complete Q1 planning",
  "weekStartDay": "2026-03-03"
}

Create Braindump Task (Backlog)

Add a task to backlog with time bucket:

POST /sunsama/create_braindump_task
Content-Type: application/json

{
  "title": "Research new tools",
  "timeBucket": "in the next month"
}

Time bucket options:

  • "in the next two weeks"
  • "in the next month"
  • "in the next quarter"
  • "in the next year"
  • "someday"
  • "never"

Start/Stop Task Timer

POST /sunsama/start_task_timer
Content-Type: application/json

{
  "taskId": "69a6bf3a04d3cd0001595308"
}
POST /sunsama/stop_task_timer
Content-Type: application/json

{
  "taskId": "69a6bf3a04d3cd0001595308"
}

Set Shutdown Time

Set when your workday ends:

POST /sunsama/set_shutdown_time
Content-Type: application/json

{
  "calendarDay": "2026-03-03",
  "hour": 18,
  "minute": 0
}

Code Examples

JavaScript

const response = await fetch('https://api.maton.ai/sunsama/search_tasks', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${process.env.MATON_API_KEY}`
  },
  body: JSON.stringify({
    searchTerm: 'meeting'
  })
});
const data = await response.json();
console.log(data);

Python

import os
import requests

response = requests.post(
    'https://api.maton.ai/sunsama/search_tasks',
    headers={
        'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}',
        'Content-Type': 'application/json'
    },
    json={
        'searchTerm': 'meeting'
    }
)
print(response.json())

Error Handling

StatusMeaning
400Missing MCP connection or invalid tool name
401Invalid or missing Maton API key
429Rate limited

Troubleshooting: API Key Issues

  1. Check that the MATON_API_KEY environment variable is set:
echo $MATON_API_KEY
  1. Verify the API key is valid by listing connections:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://api.maton.ai/connections')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF

Notes

  • All task IDs are MongoDB ObjectIds (24-character hex strings)
  • Date format: YYYY-MM-DD for days, ISO 8601 for datetimes
  • MCP tool responses wrap content in {"content": [{"type": "text", "text": "..."}], "isError": false} format
  • The text field contains JSON-stringified data that should be parsed
  • Time estimates are returned as human-readable strings (e.g., "20 minutes")

Resources

常见问题

认证流程是怎样的?
需要配置 MATON_API_KEY 环境变量,Maton 作为代理把请求转发到 Sunsama 的 MCP 服务器并自动注入凭证,OAuth 授权通过连接接口返回的 URL 在浏览器中完成。
该技能能访问哪些数据?
范围限定在已连接 Sunsama 账户内的任务、频道、计时器、排期数据和邮件线程,邮件线程访问还会延伸到已关联的 Gmail 或 Outlook 账户。
写入操作是否需要确认?
所有创建、更新和删除调用(包括邮件删除和日历事件变更)在执行前都必须先与用户确认目标和影响。

相关技能

Sunsama MCP (help.sunsama.com). Use this skill for ANY Sunsama MCP request — reading, creating, updating, and deleting data. Whenever a task involves Sunsama MCP, use this skill instead of calling the API directly.

通过托管网关调用第三方 API,免去自行管理 OAuth 和密钥的负担。

作者 byungkyu

通过托管 OAuth 接入 Cal.com 排程 API,管理事件类型、预约、可用时段、排班与 Webhook。

52 次安装

通过 Maton 网关以托管 OAuth 方式访问 Basecamp 4,管理项目、待办、日程、留言、文档与团队聊天。

168 次安装5 星标

通过托管 OAuth 连接 Motion API,管理任务、项目、循环任务和工作区。

44 次安装

通过托管 OAuth 代理读写并管理 Gmail 邮件、会话、标签和草稿。

作者 byungkyu