Microsoft Todo Mcp Server

io.github.jordanburke由 GitHub 帳號 jordanburke 發布v1.2.0更新於 Nov 1, 2026

Microsoft To Do via Graph — task lists, tasks, checklist items and reminders.

發布方自己的服務:Microsoft Learn MCP

已驗證STDIO僅桌面效率與工作流檔案與儲存

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理透過 Microsoft Graph API 讀取與管理 Microsoft To Do 的工作清單、工作、週期性工作與檢查清單項目。

可以做什麼
  • 列出工作清單(含依命名與共用狀態整理的資料夾式檢視),並建立、重新命名或刪除清單
  • 依篩選、排序與分頁讀取清單中的工作,並建立、更新或刪除工作,支援到期日、重要性、提醒與週期規則
  • 管理工作下的檢查清單項目(子工作):列出、新增、修改文字或完成狀態、刪除
  • 將超過指定天數的已完成工作封存到另一個清單
  • 查看驗證狀態與權杖到期時間
適用情境
適合把待辦事項放在 Microsoft To Do 的使用者,希望助理在 Claude Desktop、Cursor 等用戶端中檢視、新增、改期或清理工作與子工作,包括帳單、每週檢視等週期性事項。
執行需求
需在本機執行 Node.js 16 或以上版本(npm 套件 microsoft-todo-mcp-server,也可用 npx 直接執行)。需要 Microsoft 帳戶,並在 Azure 註冊應用程式,授予 Graph 委派權限 Tasks.Read、Tasks.ReadWrite 與 User.Read 並完成系統管理員同意。需設定 CLIENT_ID、CLIENT_SECRET 與 TENANT_ID,並透過 OAuth 流程產生權杖檔案,或直接提供 MS_TODO_ACCESS_TOKEN 與 MS_TODO_REFRESH_TOKEN。僅支援桌面用戶端。
安裝前請注意
需要 Azure 應用程式的用戶端密碼(CLIENT_SECRET),並將 OAuth 權杖存放在 tokens.json 檔案中,應妥善保護該檔案與密碼。僅透過 MS_TODO_ACCESS_TOKEN 與 MS_TODO_REFRESH_TOKEN 提供的權杖不會就地更新;缺少 CLIENT_ID 與 CLIENT_SECRET 時,存取權杖過期後呼叫就會失敗。工具會寫入與刪除資料:刪除工作清單會一併刪除其中所有工作,刪除工作會一併刪除其檢查清單項目。個人 Microsoft 帳戶可能受 Graph API 限制。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Microsoft Todo Mcp Server,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Microsoft To Do MCP

[CI] [npm version]

A Model Context Protocol (MCP) server that enables AI assistants like Claude and Cursor to interact with Microsoft To Do via the Microsoft Graph API. This service provides comprehensive task management capabilities through a secure OAuth 2.0 authentication flow.

Just want to try it? Use Agent Todo

Running this server yourself means registering an app in Azure and managing its client secret. If you'd rather skip that, Agent Todo is a hosted MCP server that supports Microsoft To Do, from the same maintainer. You sign in to Agent Todo, connect your Microsoft To Do account on its Connections page, then add the connector to your AI assistant. There's nothing to register or install.

  • Free plan: one connected task provider, such as Microsoft To Do, with read and write access.
  • Pro plan: every provider (Google Tasks and Todoist too), with sync between them.

Connect it from any MCP client that supports remote servers. It signs you in with OAuth on first use.

bash
# Claude Codeclaude mcp add --transport http agent-todo https://api.agent-gate.com/agent-todo/mcp

In Claude Desktop or claude.ai, open Settings, then Connectors, and add https://api.agent-gate.com/agent-todo/mcp as a custom connector.

Want to run it on your own machine, or keep your tokens local? Keep reading to set up this server.

Features

  • 17 MCP Tools: Complete task management functionality including lists, tasks, checklist items, and organization features
  • Recurring Tasks: First-class support for Microsoft Graph recurrence (daily / weekly / absoluteMonthly / relativeMonthly / absoluteYearly / relativeYearly) on create-task and update-task
  • OAuth 2.0 Authentication: Sign in once; tokens renew automatically
  • Microsoft Graph API Integration: Direct integration with Microsoft's official API
  • Multi-tenant Support: Works with personal, work, and school Microsoft accounts
  • Built on somamcp: MCP SDK 2.x underneath, served over stdio
  • TypeScript: Fully typed for reliability and developer experience
  • ESM Modules: Modern JavaScript module system

Prerequisites

  • Node.js 20 or higher (CI tests 22.x and 24.x); building from source needs 22.18 or higher, or 24.11 or higher
  • pnpm, only to build from source
  • A Microsoft account (personal, work, or school)
  • Azure App Registration (see setup below)

Installation

Option 1: Global Installation (Recommended)

bash
# Install globally using npmnpm install -g microsoft-todo-mcp-server
# Or using pnpmpnpm install -g microsoft-todo-mcp-server
# Or run directly with npx (no installation)npx microsoft-todo-mcp-server

The package provides four commands:

  • microsoft-todo-mcp-server - The MCP server
  • mstodo - Short alias for the MCP server
  • mstodo-config - Writes an mcp.json from tokens.json (see Step 3 for a caveat)
  • mstodo-setup - Guided setup. It does not yet finish on its own after you sign in, so use the steps under Usage instead

Option 2: Clone and Run Locally

bash
git clone https://github.com/jordanburke/microsoft-todo-mcp-server.gitcd microsoft-todo-mcp-serverpnpm installpnpm run build

Azure App Registration

  1. Go to the Azure Portal
  2. Navigate to "App registrations" and create a new registration
  3. Name your application (e.g., "To Do MCP")
  4. For "Supported account types", select one of the following based on your needs:
    • Accounts in this organizational directory only (Single tenant) - For use within a single organization
    • Accounts in any organizational directory (Any Azure AD directory - Multitenant) - For use across multiple organizations
    • Accounts in any organizational directory and personal Microsoft accounts - For both work accounts and personal accounts
  5. Add a Web platform redirect URI: http://localhost:3000/callback
  6. After creating the app, go to "Certificates & secrets" and create a new client secret. Note when it expires: sign-in and token renewal stop working on that date
  7. Go to "API permissions" and add these Microsoft Graph delegated permissions. The sign-in requests these (plus the standard openid and profile), so adding them here is what lets an admin approve them ahead of time:
    • Tasks.Read, Tasks.ReadWrite, Tasks.Read.Shared, Tasks.ReadWrite.Shared
    • User.Read, offline_access
  8. For a work or school tenant that requires it, an admin clicks "Grant admin consent". Personal accounts consent on the sign-in page

Configuration

Environment Setup

Create a .env file in the repository root, where you run pnpm run auth (required for sign-in):

env
CLIENT_ID=your_client_idCLIENT_SECRET=your_client_secretTENANT_ID=your_tenant_settingREDIRECT_URI=http://localhost:3000/callback

TENANT_ID Options

  • organizations - For multi-tenant organizational accounts (the default when TENANT_ID is unset)
  • consumers - For personal Microsoft accounts only
  • common - For both organizational and personal accounts
  • your-specific-tenant-id - For single-tenant configurations

Examples:

env
# For multi-tenant organizational accounts (default)TENANT_ID=organizations
# For personal Microsoft accountsTENANT_ID=consumers
# For both organizational and personal accountsTENANT_ID=common
# For a specific organization tenantTENANT_ID=00000000-0000-0000-0000-000000000000

Token Storage

The server stores authentication tokens in tokens.json. It looks in three places, in order:

  1. MSTODO_TOKEN_FILE, if set
  2. the per-user config directory — ~/.config/microsoft-todo-mcp/tokens.json, or %APPDATA%\microsoft-todo-mcp\tokens.json on Windows
  3. tokens.json in the working directory, which is migrated to whichever of (1) or (2) is in effect on first read
bash
# Override the locationexport MSTODO_TOKEN_FILE=/path/to/custom/tokens.json

You can also supply tokens directly, which takes precedence over the file:

bash
export MS_TODO_ACCESS_TOKEN=your_access_tokenexport MS_TODO_REFRESH_TOKEN=your_refresh_token

These two are a starting point, not a live store — nothing rewrites your environment when a token is renewed. A renewal is kept for the rest of the session and written to the token file, and the environment pair is not consulted again.

How the expiry is known depends on your account type. Work and school accounts get a JWT access token, so the server reads the real deadline from it and renews 5 minutes early. Personal accounts get an opaque token, where there is nothing to read and the server assumes an hour from when it first saw the value. Either way renewal needs CLIENT_ID and CLIENT_SECRET; without them the server cannot refresh, and calls start failing once the supplied token runs out.

Usage

Complete Setup Workflow

Step 1: Sign in with Microsoft

Sign-in runs from a clone of this repository, with the .env file from Configuration in its root:

bash
git clone https://github.com/jordanburke/microsoft-todo-mcp-server.gitcd microsoft-todo-mcp-serverpnpm installpnpm run buildpnpm run auth

Open http://localhost:3000 and sign in. Microsoft sends you back to /callback, and the server writes tokens.json in the repository root. Stop it with Ctrl+C when the page says authentication succeeded.

Step 2: Move the tokens where the server looks

tokens.json holds your refresh token and your client secret, so keep it private:

bash
# macOS and Linuxmkdir -p ~/.config/microsoft-todo-mcpmv tokens.json ~/.config/microsoft-todo-mcp/tokens.jsonchmod 600 ~/.config/microsoft-todo-mcp/tokens.json

On Windows, move it to %APPDATA%\microsoft-todo-mcp\tokens.json. To keep it elsewhere, set MSTODO_TOKEN_FILE to its path in the next step.

Step 3: Configure Your AI Assistant

The server finds the token file itself and renews tokens with the client credentials stored in it, so the config needs no secrets.

Claude Code:

bash
claude mcp add -s user microsoft-todo -- npx -y microsoft-todo-mcp-server
# Token file somewhere else:claude mcp add -s user microsoft-todo -e MSTODO_TOKEN_FILE=/path/to/tokens.json -- npx -y microsoft-todo-mcp-server

-s user makes it available in every project; without it, Claude Code adds it only to the folder you ran the command in.

Claude Desktop: add this to its config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
json
{  "mcpServers": {    "microsoftTodo": {      "command": "npx",      "args": ["--yes", "microsoft-todo-mcp-server"]    }  }}

Add "env": { "MSTODO_TOKEN_FILE": "/path/to/tokens.json" } if the file is not in the default location.

Cursor: add the same mcpServers entry to ~/.cursor/mcp.json.

About mstodo-config and token environment variables: pnpm run create-config (or mstodo-config) writes an mcp.json that passes MS_TODO_ACCESS_TOKEN and MS_TODO_REFRESH_TOKEN instead of a token file. Renewing those also needs CLIENT_ID and CLIENT_SECRET in the same env block, plus TENANT_ID unless it is organizations. Without them, calls start failing when the access token expires, within about an hour of signing in. The token-file setup above avoids this.

Available Scripts

bash
# Development & Buildingpnpm run build        # Build TypeScript to JavaScriptpnpm run dev          # Build and run CLI in one commandpnpm run validate     # Format, lint, typecheck, test and buildpnpm test             # Run the tests
# Running the Serverpnpm start            # Run MCP server directlypnpm run cli          # Run MCP server via CLI wrappernpx microsoft-todo-mcp-server  # Run globally installed version
# Authentication & Configurationpnpm run auth         # Start OAuth authentication serverpnpm run create-config # Generate mcp.json from tokens.json
# Code Qualitypnpm run format       # Format code with Prettierpnpm run format:check # Check code formattingpnpm run lint         # Run linting checkspnpm run typecheck    # TypeScript type checking

MCP Tools

The server provides 17 tools for comprehensive Microsoft To Do management:

Authentication and Server Info

  • auth-status - Check authentication status, token expiration, and account type
  • info - Report the server's name, version, build, runtime, and tool count (from somamcp; build details come from the SOMAMCP_BUILD_COMMIT, SOMAMCP_BUILD_DATE, SOMAMCP_BUILD_BRANCH and SOMAMCP_ENVIRONMENT environment variables when set)

Task Lists (Top-level Containers)

  • get-task-lists - Retrieve all task lists with metadata (default, shared, etc.)
  • create-task-list - Create a new task list
  • update-task-list - Rename an existing task list
  • delete-task-list - Delete a task list and all its contents
  • get-task-lists-organized - Group task lists into folders by naming pattern, emoji prefix, or sharing status (groupBy: category, shared, or type; includeIds adds an ID reference)

Tasks (Main Todo Items)

  • get-tasks - Get tasks from a list with filtering, sorting, and pagination
    • Supports OData query parameters: $filter, $orderby, $top, $skip, $count
    • orderby works on date fields such as createdDateTime; Graph rejects orderby=title
    • top caps the total, and the server follows Graph's paging to collect every page
    • count prints the number of tasks returned; Graph itself returns no count for To Do tasks
    • select limits which fields print (status, dueDateTime, importance, categories, recurrence, body); it is applied by the server, not sent to Graph
  • create-task - Create a new task with full property support
    • Title, description, due date, start date, importance, reminders, status, categories, recurrence
  • update-task - Update any task properties including recurrence (pass null to stop a recurring task)
  • delete-task - Delete a task and all its checklist items

Recurring Tasks

Pass a recurrence object to create-task or update-task to make a task repeat. Recurrence derives its first occurrence from the task's dueDateTime, which is required. Examples:

json
// Monthly bill, 15th of every month, forever{  "pattern": {"type": "absoluteMonthly", "interval": 1, "dayOfMonth": 15},  "range":   {"type": "noEnd"}}
// Weekly standup every Monday, ends 2027-01-01{  "pattern": {"type": "weekly", "interval": 1, "daysOfWeek": ["monday"]},  "range":   {"type": "endDate", "endDate": "2027-01-01"}}
// Annual birthday, on the 4th of September{  "pattern": {"type": "absoluteYearly", "interval": 1, "dayOfMonth": 4, "month": 9},  "range":   {"type": "noEnd"}}

Each pattern type needs its own fields, and the server refuses a rule that leaves one out or adds one the type does not use: weekly and relativeMonthly take daysOfWeek, absoluteMonthly takes dayOfMonth, absoluteYearly takes dayOfMonth and month, and relativeYearly takes daysOfWeek and month. A weekly rule without firstDayOfWeek gets sunday. An endDate range needs endDate, and a numbered range needs numberOfOccurrences.

Stop a recurring task by passing recurrence: null to update-task. See https://learn.microsoft.com/en-us/graph/api/resources/recurrencepattern for the full schema.

Checklist Items (Subtasks)

  • get-checklist-items - Get subtasks for a specific task
  • create-checklist-item - Add a new subtask to a task
  • update-checklist-item - Update subtask text or completion status
  • delete-checklist-item - Remove a specific subtask

Maintenance and Diagnostics

  • archive-completed-tasks - Move completed tasks older than olderThanDays (default 90) from one list to another; dryRun previews without moving
  • test-graph-api-exploration - Run read-only Graph API probes (odata-select, odata-expand, headers, extensions, or all) to look for hidden list properties; for debugging, not everyday use

Architecture

Project Structure

  • MCP Server (src/todo-index.ts) - The 16 To Do tools, registered on a somamcp server
  • Token Manager (src/token-manager.ts) - Finds, renews and saves tokens
  • CLI Wrapper (src/cli.ts) - Executable entry point; starts the server over stdio
  • Auth Server (src/auth-server.ts) - Express server for the OAuth 2.0 sign-in
  • Setup (src/setup.ts) - The guided mstodo-setup command
  • Config Generator (src/create-mcp-config.ts) - Helper to create MCP configurations

Technical Details

  • MCP framework: somamcp 2.x, with Zod 4 parameter schemas
  • Microsoft Graph API: Uses v1.0 endpoints
  • Authentication: MSAL (Microsoft Authentication Library) authorization-code flow with a client secret
  • Token Management: Renews 5 minutes before expiry, and again whenever Graph rejects a token
  • Build System: ts-builds (tsdown) for fast TypeScript compilation
  • Module System: ESM (ECMAScript modules)

Limitations & Known Issues

Personal Microsoft Accounts

  • Personal accounts (outlook.com, hotmail.com, live.com) work. A live.com account tested on 2026-10-31 had full access: 30 lists, paging through a 399-task list, writes and recurring tasks
  • auth-status and the sign-in page still warn that personal accounts may hit MailboxNotEnabledForRESTAPI. If you do see that error, Microsoft has not enabled the To Do API for that mailbox. It is a Microsoft-side limit, not a bug in this server

API Limitations

  • Rate limits apply according to Microsoft's policies
  • Some features may be unavailable for personal accounts
  • Shared lists have limited functionality

Troubleshooting

Authentication Issues

Token acquisition failures

  • unauthorized_client: The client does not exist or is not enabled for consumers: Microsoft can't use the app for this account. Either the app registration was deleted, or its supported account types exclude personal accounts
  • AADSTS7000215 (invalid client secret) or AADSTS7000222 (expired client secret): create a new secret under "Certificates & secrets" and update .env, then sign in again so tokens.json stores it
  • Verify CLIENT_ID, CLIENT_SECRET, and TENANT_ID in your .env file
  • Ensure redirect URI matches exactly: http://localhost:3000/callback
  • Check Azure App permissions are granted with admin consent

Permission issues

  • Ensure all required Graph API permissions are added and consented
  • For organizational accounts, admin consent may be required

Account Type Configuration

Work/School Accounts

env
TENANT_ID=organizations  # Multi-tenant# Or use your specific tenant ID

Personal Accounts

env
TENANT_ID=consumers  # Personal only# Or TENANT_ID=common for both types

Debugging

Check authentication status:

bash
# Using the MCP tool# In your AI assistant: "Check auth status"
# Or read the expiry from the token file (it also holds secrets, so don't share its contents)jq '.expiresAt' ~/.config/microsoft-todo-mcp/tokens.json
# Convert the timestamp to a readable datedate -d @$(($(jq -r '.expiresAt' ~/.config/microsoft-todo-mcp/tokens.json) / 1000))

Enable verbose logging:

bash
# The server logs to stderr for debuggingmstodo 2> debug.log

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Run pnpm run validate (format, lint, typecheck, test, build) before submitting
  4. Submit a pull request

License

MIT License - See LICENSE file for details

Acknowledgments

Support

來源:README.md,提交 88fc6ab

工具

16

auth-status

Check if you're authenticated with Microsoft Graph API. Shows current token status and expiration time, and indicates if the token needs to be refreshed.

無需輸入參數。

get-task-lists

Get all Microsoft Todo task lists (the top-level containers that organize your tasks). Shows list names, IDs, and indicates default or shared lists.

無需輸入參數。

get-task-lists-organized

Get all task lists organized into logical folders/categories based on naming patterns, emoji prefixes, and sharing status. Provides a hierarchical view similar to folder organization.

輸入參數groupByincludeIds

create-task-list

Create a new task list (top-level container) in Microsoft Todo to help organize your tasks into categories or projects.

輸入參數displayName必填

update-task-list

Update the name of an existing task list (top-level container) in Microsoft Todo.

輸入參數listId必填displayName必填

delete-task-list

Delete a task list (top-level container) from Microsoft Todo. This will remove the list and all tasks within it.

輸入參數listId必填

get-tasks

Get tasks from a specific Microsoft Todo list. These are the main todo items that can contain checklist items (subtasks).

輸入參數topskipcountfilterlistId必填selectorderby

create-task

Create a new task in a specific Microsoft Todo list. A task is the main todo item that can have a title, description, due date, and other properties. Pass `recurrence` to make the task repeat (e.g. monthly bill payments, birthdays, weekly reviews).

輸入參數bodytitle必填listId必填statuscategoriesimportancerecurrencedueDateTimeisReminderOnstartDateTimereminderDateTime

update-task

Update an existing task in Microsoft Todo. Allows changing any properties of the task including title, due date, importance, and recurrence. To stop a recurring task, pass `recurrence: null`. Pass a new `recurrence` object to change or add recurrence.

輸入參數bodytitlelistId必填statustaskId必填categoriesimportancerecurrencedueDateTimeisReminderOnstartDateTimereminderDateTime

delete-task

Delete a task from a Microsoft Todo list. This will remove the task and all its checklist items (subtasks).

輸入參數listId必填taskId必填

get-checklist-items

Get checklist items (subtasks) for a specific task. Checklist items are smaller steps or components that belong to a parent task.

輸入參數listId必填taskId必填

create-checklist-item

Create a new checklist item (subtask) for a task. Checklist items help break down a task into smaller, manageable steps.

輸入參數listId必填taskId必填isCheckeddisplayName必填

update-checklist-item

Update an existing checklist item (subtask). Allows changing the text content or completion status of the subtask.

輸入參數listId必填taskId必填isCheckeddisplayNamechecklistItemId必填

delete-checklist-item

Delete a checklist item (subtask) from a task. This removes just the specific subtask, not the parent task.

輸入參數listId必填taskId必填checklistItemId必填

archive-completed-tasks

Move completed tasks older than a specified number of days from one list to another (archive) list. Useful for cleaning up active lists while preserving historical tasks.

輸入參數dryRunsourceListId必填targetListId必填olderThanDays

test-graph-api-exploration

Test various Graph API queries to discover hidden properties or endpoints for folder/group organization in Microsoft To Do.

輸入參數testType必填

版本歷史

2
  1. v1.2.0最新Oct 31, 2026
  2. v1.1.4Oct 29, 2026

評分

已滿足適用檢查項的 80%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。

其他 Microsoft 整合