microsoft-todo-safe-mcp
Enables safe AI-assisted cleanup of Microsoft To Do tasks with backup, preview, confirmation, and audit safeguards.
README
Microsoft To Do Safe MCP
A local-first Microsoft To Do MCP server for AI-assisted task cleanup with backup, preview, confirmation, and audit safeguards.
This repository is a safety-focused fork of jordanburke/microsoft-todo-mcp-server. The goal is not to expose every Microsoft To Do CRUD operation directly to an AI assistant. The goal is to let an AI propose structured cleanup plans, preview the exact effects, and apply them only after explicit confirmation.
What This Is
This project sits between an AI assistant and Microsoft To Do:
Codex / Claude / local LLM
-> Safe MCP tools
-> Microsoft Graph API
-> Microsoft To Do
It is intended for personal task backlog cleanup:
- read visible Microsoft To Do lists and tasks
- export complete JSON backups
- validate AI-generated cleanup plans
- preview planned changes before any write
- require exact confirmation before applying
- write JSON Lines audit logs
- avoid permanent delete by default
- prefer soft archive lists such as Archive, Someday, and Needs Review
Current Status
Implemented:
- community repository evaluation notes
- device-code authentication for remote/iPhone operation
- doctor script for live Microsoft Graph To Do compatibility checks
- conservative local safe-plan proposal script
- full JSON backup export
- MCP backup-based
propose_plantool - safe list setup for Archive, Someday, and Needs Review
- strict safe-plan schema validation
- dry-run plan preview with saved
preview_id - confirmation-gated
apply_plan - JSON Lines audit log output
- read-only backup restore preview
- default hiding of direct destructive tools
Not implemented:
- GUI
- VPS deployment
- SQLite registry fallback
- permanent delete
- restore apply
- arbitrary Graph request tool
Safety Model
By default, direct dangerous upstream tools are not registered:
- task delete
- task-list delete
- checklist delete
- unrestricted update/create helpers
- destructive archive helper
- Graph exploration helper
Set MSTODO_ENABLE_UNSAFE_TOOLS=1 only if you intentionally want the original low-level tools exposed.
The supported AI write path is:
validate_plan -> preview_plan -> apply_plan
apply_plan always:
- validates the plan again
- requires a matching saved
preview_id - requires the exact confirmation phrase returned by
preview_plan - creates a full backup before writing
- writes JSON Lines audit events
- defaults to fail-fast
- preserves success mappings on partial failure
Soft move operations are implemented as:
copy task to Archive/Someday/Needs Review
copy checklist items when available
mark original task completed
The original task is not deleted.
Allowed Plan Operations
Plan schema version 1.0 allows:
move_to_archivemove_to_somedaymove_to_needs_reviewcompleteupdatecreate_checklist_item
Version 1.0 rejects:
deletedelete_task_list- silent overwrite
- apply without preview
- source-list mismatch
- missing task IDs
See docs/SAFE_PLAN_WORKFLOW.md.
Prerequisites
- Node.js 22 or newer
- Corepack / pnpm
- Microsoft account with Microsoft To Do enabled
- Microsoft Entra / Azure app registration for OAuth
No Azure hosting is required. The app registration is only used as an OAuth client identity.
Install
git clone https://github.com/Saenai/microsoft-todo-safe-mcp.git
cd microsoft-todo-safe-mcp
corepack pnpm install
corepack pnpm run build
Azure / Microsoft App Registration
Recommended setup for personal Microsoft accounts and remote Codex/iPhone operation:
- app type: public client
- tenant:
consumers - login flow: device code
- client secret: not needed
Required delegated Microsoft Graph permissions:
User.ReadTasks.ReadTasks.ReadWriteTasks.Read.SharedTasks.ReadWrite.Sharedoffline_accessopenidprofile
Full setup checklist: docs/AZURE_APP_REGISTRATION.md.
Authenticate
Set the app registration client ID:
$env:CLIENT_ID = "<application-client-id>"
$env:TENANT_ID = "consumers"
Start device-code login:
corepack pnpm run auth:device -- --start-only
Open the printed URL on your phone or browser, enter the code, and sign in.
Then complete token retrieval on the machine running the MCP server:
corepack pnpm run auth:device -- --complete
Tokens are stored under the local user profile:
%APPDATA%\microsoft-todo-mcp\tokens.json
Do not commit or share token files.
Verify Microsoft To Do Compatibility
Run:
corepack pnpm run doctor
The doctor checks:
- OAuth token availability
GET /meGET /me/todo/lists- visible list enumeration
- per-list task counts
- temporary list create/delete
- temporary task create/read/update/complete/delete
The doctor redacts tokens and client secrets from reports.
MCP Tools
Safe tools:
setup_safe_listsexport_backuppropose_planvalidate_planpreview_planapply_planrestore_preview- read/list tools inherited from the base server
Unsafe low-level tools are hidden unless MSTODO_ENABLE_UNSAFE_TOOLS=1.
Safe Plan Workflow
-
Call
setup_safe_lists. -
Call
export_backup. -
Generate a conservative starter plan with either the MCP tool:
propose_planor the local CLI:
corepack pnpm run propose:plan -- --backup safe-data/backups/<backup>.json --limit 5 -
Review or edit the generated schema version
1.0plan. -
Call
validate_plan. -
Call
preview_plan. -
Review
preview_id,confirmation_phrase, and effects. -
Call
apply_planwith the same plan, matchingpreview_id, and exact confirmation phrase.
Local outputs:
safe-data/backups/
safe-data/plans/
safe-data/previews/
safe-data/audit/
safe-data/ is ignored by git because it may contain personal task data.
Development
corepack pnpm test
corepack pnpm run typecheck
corepack pnpm run format:check
corepack pnpm run build
Useful scripts:
corepack pnpm run auth:devicecorepack pnpm run doctorcorepack pnpm run export:backupcorepack pnpm run propose:plan -- --backup safe-data/backups/<backup>.json --limit 5corepack pnpm run test:doctorcorepack pnpm run typecheck:doctor
Documentation
- docs/REPOSITORY_EVALUATION.md: community repository review
- docs/DECISIONS.md: implementation decisions and verified facts
- docs/AZURE_APP_REGISTRATION.md: app registration setup
- docs/SAFE_PLAN_WORKFLOW.md: plan validation, preview, and apply flow
Security Notes
- Token files are sensitive.
- Backups and audit logs may contain personal task metadata.
- This project intentionally avoids permanent delete in the safe plan flow.
- Do not expose unsafe tools to an autonomous AI assistant unless you understand the risk.
- Keep the repository private if you add personal plans, backups, logs, screenshots, or account-specific notes.
License
MIT. See LICENSE.
Acknowledgments
Forked from jordanburke/microsoft-todo-mcp-server, itself a fork of @jhirono/todomcp.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。