AI から TODO を読み書きする(MCP)
Use MustDo from AI clients (MCP)
MustDo MCP サーバーとは
MustDo の TODO を、Claude Code / Claude Desktop などの MCP 対応 AI クライアントから読み書きするための小さなサーバーです。あなたの Mac 上で動き、Apple の CloudKit Web Services を通じて、iPhone のアプリと同じ iCloud 上のレコードを直接読み書きします。当社のサーバーは介在しません。
MCP を使うと、TODO の内容(タイトル・メモ・時刻など)があなたの選んだ AI クライアントに渡ります。渡したあとの取り扱いは、その AI クライアントのプライバシーポリシーに従います。詳しくはプライバシーポリシーの第7項。
必要なもの
- Mac と Node.js 24 以上(
node --versionで確認) - MustDo アプリを一度起動して iCloud に同期した Apple ID(iCloud 上の領域はアプリが作ります)
- MustDo の購読中、またはお試し期間中(期間が切れると
add_todoだけPAYMENT_REQUIREDになります。読み取り・完了・スヌーズは動きます) - CloudKit Dashboard の API Token(下記)
1. CloudKit の API Token を用意する
- CloudKit Dashboard でコンテナ
iCloud.jp.lightning.mustdoを選びます - API Access → API Tokens → 作成。Sign in Callback を URL にして
http://127.0.0.1:51234/callbackを登録します - 表示された token 文字列を控えます(
MUSTDO_CK_API_TOKEN)。この token だけでは他人のデータには入れませんが、無用に公開しないでください
2. 設定
環境変数か ~/.mustdo/config.json のどちらでも設定できます(環境変数が優先)。
| 環境変数 | config.json | 既定 | 意味 |
|---|---|---|---|
MUSTDO_CK_API_TOKEN | apiToken | (必須) | Dashboard の API Token |
MUSTDO_CK_ENV | environment | development | App Store 版のデータは production |
MUSTDO_CALLBACK_PORT | callbackPort | 51234 | サインインの戻り先ポート |
MUSTDO_HOME | — | ~/.mustdo | 設定とサインイン情報の置き場所 |
MUSTDO_LOG_LEVEL | — | INFO | DEBUG / INFO / WARN / ERROR |
// ~/.mustdo/config.json の例
{
"apiToken": "(Dashboard の API Token)",
"environment": "production"
}
3. ビルドと登録
cd mustdo-app/mcp
npm install
npm run build # dist/index.js ができる
# Claude Code に登録(config.json に書いた場合)
claude mcp add mustdo -- node /path/to/mustdo-app/mcp/dist/index.js
# 環境変数で渡す場合
claude mcp add mustdo -e MUSTDO_CK_API_TOKEN=<token> -e MUSTDO_CK_ENV=production \
-- node /path/to/mustdo-app/mcp/dist/index.js
4. サインイン
iCloud のプライベートデータベースを読むには、あなたの Apple ID でのサインインが要ります。
- 未サインインのまま何かツールを呼ぶと
NOT_SIGNED_INが返り、「sign_inを実行して」と言われます - AI に「sign_in して」と頼むと、Apple のサインイン画面がブラウザで開きます
- Apple ID でサインインすると
http://127.0.0.1:51234/callbackに戻り、サインイン情報が~/.mustdo/auth.json(権限 600)に保存されます - サインイン情報はしばらくすると失効します。そのときも同じ
NOT_SIGNED_INが返るので、もう一度sign_inしてください
ツール一覧
| ツール | 何をする |
|---|---|
sign_in | Apple のサインイン画面を開いてサインイン情報を保存 |
get_me | お試し・購読の状態、時間帯、今日の日付 |
list_todos | date か from/to(YYYY-MM-DD)と status(既定 pending)で絞る。繰り返しはテンプレートのまま返し、範囲内の回を添える |
add_todo | 追加。due は YYYY-MM-DDTHH:mm(あなたの時間帯)か ISO 8601 |
update_todo | 渡した項目だけ更新。repeat: null で繰り返しを外す |
complete_todo | 完了にする。繰り返しは「その日の回」だけ |
snooze_todo | until までスヌーズ |
delete_todo | 削除(14 日後に iCloud から物理削除) |
エラーは { "code": "...", "message": "..." } の形で返ります。code は NOT_SIGNED_IN / NOT_CONFIGURED / PAYMENT_REQUIRED / NOT_FOUND / INVALID_ARGUMENT / CONFLICT / CLOUDKIT_ERROR。
使ってみる
Claude に、たとえば「明日の 9 時に『薬を飲む』を MustDo に入れて」「今日の TODO を見せて」「『牛乳を買う』を 1 時間後にスヌーズして」と頼むだけです。iCloud に書き込まれると、iPhone のアプリが Apple のサイレントプッシュで数秒以内に起き、アラームを登録し直します。
補足
- MCP サーバーは MustDo アプリと同じリポジトリの
mcp/にあります。ソースコードの入手方法はお問い合わせください developmentとproductionでサインイン情報は別です。環境を切り替えたら再サインインしてください
iPhone / claude.ai から使う(カスタムコネクタ)
Mac が無くても、claude.ai と iPhone の Claude アプリからは当社の中継サーバー https://ltng.jp/api/mustdo/mcp を通して同じ 7 つのツールが使えます。上の手順(API Token・ビルド・サインイン)は不要です。
- claude.ai で 設定 → コネクタ → カスタムコネクタを追加。名前は「MustDo」、URL に
https://ltng.jp/api/mustdo/mcpを入れて追加します - 「接続」を押すと ltng.jp の同意画面が開きます。当社サーバーが何を預かるか(iCloud のサインイン用トークンだけ。TODO の内容は保存しない)を確認して「Apple ID でサインインして接続」
- Apple の画面で、MustDo アプリで使っている Apple ID で iCloud にサインインします。claude.ai に戻れば完了です
- 一度接続すれば、iPhone の Claude アプリでも同じコネクタがそのまま使えます
中継サーバーは、Apple ID で iCloud にサインインしたときのトークンを AWS 東京リージョンで AWS KMS により暗号化して保管し、リクエストのたびに利用者自身の iCloud を読み書きします。TODO の内容はサーバーに保存せず、ログにも残しません。詳しくはプライバシーポリシーの第7項。
接続解除: https://ltng.jp/api/mustdo/disconnect を開き、Apple ID でサインインして本人確認すると、当社サーバーに保管したトークンと発行済みの接続用トークンがすべて即時に削除されます。claude.ai 側のコネクタを削除するだけでは当社側のトークンは残るので、やめるときは両方行ってください。TODO は iCloud にそのまま残ります。
iCloud のサインインが Apple 側で失効すると、ツールが RECONNECT_REQUIRED を返します。claude.ai の設定 → コネクタ → MustDo から接続し直してください。
What the MustDo MCP server is
A small server that lets MCP-capable AI clients such as Claude Code and Claude Desktop read and write your MustDo to-dos. It runs on your own Mac and reads and writes the very same records in your iCloud that the iPhone app uses, through Apple’s CloudKit Web Services. No server of ours is involved.
When you use MCP, the contents of your to-dos (title, notes, time and so on) are passed to the AI client you chose. What happens to them after that is governed by that client’s privacy policy. See section 7 of the Privacy Policy.
Requirements
- A Mac with Node.js 24 or later (
node --version) - An Apple ID that has opened the MustDo app at least once and synced to iCloud (the app creates the iCloud area)
- An active MustDo subscription or free trial (after it ends, only
add_todoreturnsPAYMENT_REQUIRED; reading, completing and snoozing keep working) - A CloudKit Dashboard API token (below)
1. Create a CloudKit API token
- Open CloudKit Dashboard and select the container
iCloud.jp.lightning.mustdo - API Access → API Tokens → create one. Set Sign in Callback to URL and enter
http://127.0.0.1:51234/callback - Copy the token string (
MUSTDO_CK_API_TOKEN). On its own it cannot reach anyone else’s data, but do not publish it needlessly
2. Configuration
Use environment variables or ~/.mustdo/config.json (environment variables win).
| Environment variable | config.json | Default | Meaning |
|---|---|---|---|
MUSTDO_CK_API_TOKEN | apiToken | (required) | API token from the Dashboard |
MUSTDO_CK_ENV | environment | development | Use production for App Store data |
MUSTDO_CALLBACK_PORT | callbackPort | 51234 | Sign-in callback port |
MUSTDO_HOME | — | ~/.mustdo | Where config and sign-in data live |
MUSTDO_LOG_LEVEL | — | INFO | DEBUG / INFO / WARN / ERROR |
// Example ~/.mustdo/config.json
{
"apiToken": "(API token from the Dashboard)",
"environment": "production"
}
3. Build and register
cd mustdo-app/mcp
npm install
npm run build # produces dist/index.js
# Register with Claude Code (when using config.json)
claude mcp add mustdo -- node /path/to/mustdo-app/mcp/dist/index.js
# Or pass settings as environment variables
claude mcp add mustdo -e MUSTDO_CK_API_TOKEN=<token> -e MUSTDO_CK_ENV=production \
-- node /path/to/mustdo-app/mcp/dist/index.js
4. Sign in
Reading your private iCloud database requires signing in with your Apple ID.
- Calling any tool before signing in returns
NOT_SIGNED_INand asks you to runsign_in - Ask the AI to run
sign_in; Apple’s sign-in page opens in your browser - After signing in with your Apple ID you are sent back to
http://127.0.0.1:51234/callback, and the sign-in data is saved to~/.mustdo/auth.json(mode 600) - The sign-in data expires after a while. You will get the same
NOT_SIGNED_IN; just runsign_inagain
Tools
| Tool | What it does |
|---|---|
sign_in | Opens Apple’s sign-in page and saves the sign-in data |
get_me | Trial/subscription state, time zone and today’s date |
list_todos | Filter by date or from/to (YYYY-MM-DD) and status (default pending). Repeating to-dos are returned as templates with the occurrences in range |
add_todo | Add a to-do. due is YYYY-MM-DDTHH:mm (your time zone) or ISO 8601 |
update_todo | Update only the fields you pass. repeat: null removes the repeat |
complete_todo | Mark as done. For repeating to-dos, only that day’s occurrence |
snooze_todo | Snooze until until |
delete_todo | Delete (physically removed from iCloud 14 days later) |
Errors come back as { "code": "...", "message": "..." }, where code is one of NOT_SIGNED_IN / NOT_CONFIGURED / PAYMENT_REQUIRED / NOT_FOUND / INVALID_ARGUMENT / CONFLICT / CLOUDKIT_ERROR.
Try it
Just ask Claude: “Add ‘take the medicine’ to MustDo for 9 AM tomorrow”, “Show me today’s to-dos”, “Snooze ‘buy milk’ for an hour”. As soon as iCloud is updated, the iPhone app wakes up through Apple’s silent push within seconds and reschedules the alarms.
Notes
- The MCP server lives in the
mcp/directory of the MustDo app repository. Contact us for access to the source code - Sign-in data is separate for
developmentandproduction. Sign in again after switching environments
Using it from iPhone / claude.ai (custom connector)
Without a Mac, claude.ai and the Claude app on iPhone can use the same seven tools through our relay server at https://ltng.jp/api/mustdo/mcp. The steps above (API token, build, sign-in) are not needed.
- In claude.ai open Settings → Connectors → Add custom connector. Name it “MustDo” and enter
https://ltng.jp/api/mustdo/mcpas the URL - Press “Connect”. A consent page on ltng.jp explains what our server keeps (only your iCloud sign-in token; never the content of your to-dos). Choose “Sign in with Apple ID and connect”
- On Apple’s page, sign in to iCloud with the Apple ID you use in the MustDo app. You are returned to claude.ai and the connector is ready
- Once connected, the same connector works in the Claude app on iPhone
The relay stores the token issued when you sign in to iCloud with your Apple ID, encrypted with AWS KMS in the AWS Tokyo region, and uses it to read and write your own iCloud on each request. The content of your to-dos is never stored on the server or written to logs. See section 7 of the privacy policy.
Disconnecting: open https://ltng.jp/api/mustdo/disconnect and sign in with your Apple ID to verify it is you. The stored token and every connection token issued for it are deleted immediately. Removing the connector in claude.ai alone leaves our copy of the token in place, so do both when you stop using it. Your to-dos stay in iCloud untouched.
If Apple invalidates the iCloud sign-in, the tools return RECONNECT_REQUIRED. Reconnect from claude.ai Settings → Connectors → MustDo.