Sunsamaのロゴ

Sunsama

コミュニティ
robertn702

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,…

公開者robertn702
リポジトリmcp-sunsama
言語TypeScript
フォーク
18
スター
52
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Sunsamaは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには52件のスターと18件のフォークがあります。

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
  • Subtasks - Add, update, complete, and manage subtasks within tasks
  • 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

Installation

Prerequisites

  • Bun runtime (for development)
  • Sunsama account with API access

Using NPX (Recommended)

No installation required! Use directly with:

bash
npx mcp-sunsama

Development Setup

  1. Clone the repository:
bash
git clone https://github.com/robertn702/mcp-sunsama.git
cd mcp-sunsama
  1. Install dependencies:
bash
bun install
  1. Set up your environment variables:
bash
cp .env.example .env
# Edit .env and add your Sunsama credentials

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) or http
  • PORT - 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.):

bash
bun run dev
# or
TRANSPORT_MODE=stdio bun run src/main.ts

HTTP Stream Transport

For remote access and web-based integrations:

bash
TRANSPORT_MODE=http PORT=8080 bun run src/main.ts

HTTP Endpoints:

  • MCP Endpoint: POST http://localhost:8080/mcp
  • Health Check: GET http://localhost:8080/

Authentication: HTTP requests require HTTP Basic Auth with your Sunsama credentials:

bash
curl -X POST http://localhost:8080/mcp \
  -H "Authorization: Basic $(echo -n 'your-email:your-password' | base64)" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

Claude Desktop Configuration

Add this configuration to your Claude Desktop MCP settings:

json
{
  "mcpServers": {
    "sunsama": {
      "command": "npx",
      "args": ["mcp-sunsama"],
      "env": {
        "SUNSAMA_EMAIL": "your-email@example.com",
        "SUNSAMA_PASSWORD": "your-password"
      }
    }
  }
}

Claude Code Configuration

Add the Sunsama MCP server using the Claude Code CLI:

bash
claude mcp add sunsama --scope user \
  -e SUNSAMA_EMAIL=your-email@example.com \
  -e SUNSAMA_PASSWORD=your-password \
  -- npx mcp-sunsama

Scope Options:

  • --scope user - Available across all projects (recommended)
  • --scope project - Only available in the current project

After adding the server, restart Claude Code to connect to the Sunsama MCP server.

API Tools

Task Management

  • create-task - Create new tasks with optional properties including GitHub issue/PR and Gmail integration
  • get-tasks-by-day - Get tasks for a specific day with completion filtering
  • get-tasks-backlog - Get backlog tasks
  • get-archived-tasks - Get archived tasks with pagination (includes hasMore flag for LLM context)
  • get-task-by-id - Get a specific task by its ID
  • update-task-complete - Mark tasks as complete
  • update-task-planned-time - Update the planned time (time estimate) for tasks
  • update-task-notes - Update task notes content (requires either html or markdown parameter, 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 tasks
  • update-task-stream - Update the stream/channel assignment for tasks
  • update-task-snooze-date - Reschedule tasks to different dates
  • update-task-backlog - Move tasks to the backlog
  • delete-task - Delete tasks permanently

Subtask Management

  • add-subtask - Create a subtask with a title in one call (recommended for single subtask creation)
  • create-subtasks - Create multiple subtasks for a task (low-level API for bulk operations)
  • update-subtask-title - Update the title of a subtask
  • complete-subtask - Mark a subtask as complete with optional completion timestamp
  • uncomplete-subtask - Mark a subtask as incomplete

User & Stream Operations

  • get-user - Get current user information
  • get-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:

json
{
  "text": "Fix authentication bug",
  "integration": {
    "service": "github",
    "identifier": {
      "id": "I_kwDOO4SCuM7VTB4n",
      "repositoryOwnerLogin": "robertn702",
      "repositoryName": "mcp-sunsama",
      "number": 42,
      "type": "Issue",
      "url": "https://github.com/robertn702/mcp-sunsama/issues/42",
      "__typename": "TaskGithubIntegrationIdentifier"
    },
    "__typename": "TaskGithubIntegration"
  }
}

Link a task to a GitHub pull request:

json
{
  "text": "Review API refactoring PR",
  "integration": {
    "service": "github",
    "identifier": {
      "id": "PR_kwDOO4SCuM7VTB5o",
      "repositoryOwnerLogin": "robertn702",
      "repositoryName": "mcp-sunsama",
      "number": 15,
      "type": "PullRequest",
      "url": "https://github.com/robertn702/mcp-sunsama/pull/15",
      "__typename": "TaskGithubIntegrationIdentifier"
    },
    "__typename": "TaskGithubIntegration"
  }
}

Gmail Integration

Link a task to a Gmail email:

json
{
  "text": "Respond to project update email",
  "integration": {
    "service": "gmail",
    "identifier": {
      "id": "19a830b40fd7ab7d",
      "messageId": "19a830b40fd7ab7d",
      "accountId": "user@example.com",
      "url": "https://mail.google.com/mail/u/user@example.com/#inbox/19a830b40fd7ab7d",
      "__typename": "TaskGmailIntegrationIdentifier"
    },
    "__typename": "TaskGmailIntegration"
  }
}

Note: All integration parameters are optional. Tasks can be created without integrations for standard task management.

Development

Running in Development

bash
bun run dev

Testing with MCP Inspector

bash
bun run inspect

Then connect the MCP Inspector to test the tools interactively.

Testing

bash
bun test                   # Run unit tests only
bun test:unit              # Run unit tests only (alias)
bun test:integration       # Run integration tests (requires credentials)
bun test:all               # Run all tests
bun test:watch             # Watch mode for unit tests

Build and Type Checking

bash
bun run build              # Compile TypeScript to dist/
bun run typecheck          # Run TypeScript type checking
bun run typecheck:watch    # Watch mode 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:

src/
├── tools/
│   ├── shared.ts          # Common utilities and patterns
│   ├── user-tools.ts      # User operations (get-user)
│   ├── task-tools.ts      # Task operations (15 tools)
│   ├── stream-tools.ts    # Stream operations (get-streams)
│   └── index.ts           # Export all tools
├── resources/
│   └── index.ts           # API documentation resource
├── auth/                  # Authentication strategies
│   ├── stdio.ts           # Stdio transport authentication
│   ├── http.ts            # HTTP Basic Auth parsing
│   └── types.ts           # Shared auth types
├── transports/
│   ├── stdio.ts           # Stdio transport implementation
│   └── http.ts            # HTTP Stream transport with session management
├── session/
│   └── session-manager.ts # Session lifecycle management
├── config/                # Environment configuration
│   ├── transport.ts       # Transport mode configuration
│   └── session-config.ts  # Session TTL configuration
├── utils/                 # Utilities (filtering, trimming, etc.)
│   ├── client-resolver.ts # Transport-agnostic client resolution
│   ├── task-filters.ts    # Task completion filtering
│   ├── task-trimmer.ts    # Response size optimization
│   └── to-tsv.ts          # TSV formatting utilities
├── schemas.ts             # Zod validation schemas
└── main.ts                # Server setup (47 lines vs 1162 before refactoring)

__tests__/
├── unit/                  # Unit tests (no auth required)
│   ├── auth/              # Auth utility tests
│   ├── config/            # Configuration tests
│   └── session/           # Session management tests
└── integration/           # Integration tests (requires credentials)
    └── http-transport.test.ts

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:

  1. Fork and clone the repository
  2. Install dependencies: bun install
  3. Make your changes
  4. Create a changeset: bun run changeset
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

インストール

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "sunsama": {
      "command": "npx",
      "args": [
        "mcp-sunsama"
      ],
      "env": {
        "SUNSAMA_EMAIL": "your-email@example.com",
        "SUNSAMA_PASSWORD": "your-password"
      }
    }
  }
}

SunsamaのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Sunsamaに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Sunsamaをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. SunsamaのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "sunsama": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-sunsama"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてSunsamaのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. SunsamaのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Sunsamaを使ってこのタスクを手伝ってもらえますか?
Sunsama
はい、読みました。
Sunsamaで調べた結果をお伝えします。

よくある質問

Sunsama MCPサーバーは何に使いますか?

Sunsamaは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでSunsama MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでSunsamaを利用できます。

TypingMindでSunsama MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Sunsamaを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Sunsama MCPをTypingMindに接続するにはどうすればよいですか?

SunsamaはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでSunsama MCPのどのようなツールを利用できますか?

SunsamaはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Sunsama MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Sunsamaで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇