by jordanburke
Provides AI assistants with full Microsoft To Do task management via the Microsoft Graph API, handling OAuth 2.0 authentication and exposing a suite of 17 MCP tools for lists, tasks, recurring events, and checklist items.
A Model Context Protocol server that enables AI assistants (e.g., Claude, Cursor) to read, create, update, and organize Microsoft To Do data. It connects directly to the Microsoft Graph API, manages OAuth 2.0 token acquisition/refresh, and offers a rich set of task‑management commands.
npx microsoft-todo-mcp-server (or install globally via npm/pnpm)..env file.pnpm run auth (or the built‑in mstodo-setup flow) to open a local web page, sign in, and generate tokens.json.mstodo-http to serve the tools over HTTP for remote MCP clients.claude mcp add -s user microsoft-todo -- npx -y microsoft-todo-mcp-server or add the generated mcp.json entry to Claude Desktop / Cursor configuration.mstodo, mstodo-config, mstodo-setup, mstodo-http).Q: Do I need to register an Azure app? A: Yes, an app registration with client secret and the listed Graph permissions is required unless you use the hosted Agent Todo service.
Q: Which accounts are supported?
A: Personal Microsoft accounts, work/school accounts, and multi‑tenant scenarios via the TENANT_ID configuration (organizations, consumers, common, or a specific tenant GUID).
Q: Where are tokens stored?
A: By default in ~/.config/microsoft-todo-mcp/tokens.json (or %APPDATA%\microsoft-todo-mcp\tokens.json on Windows). The location can be overridden with MSTODO_TOKEN_FILE.
Q: Can I run the server behind a reverse proxy?
A: Yes. Use mstodo-http in HTTP mode, set MSTODO_HTTP_BASE_URL to the public origin, and configure MSTODO_HTTP_REDIRECT_URIS as needed.
Q: How are recurring tasks defined?
A: Provide a recurrence object matching Microsoft Graph’s schema (pattern type, interval, daysOfWeek, etc.) when creating or updating a task.
Q: What if I encounter MailboxNotEnabledForRESTAPI?
A: This indicates the To Do API is not enabled for that mailbox on Microsoft’s side; it is not a bug in the server.
Q: How do I upgrade from an older version?
A: Remove any MS_TODO_ACCESS_TOKEN/MS_TODO_REFRESH_TOKEN entries from your AI assistant’s config and rely on the token file; the server will handle renewal automatically.
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.
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.
Connect it from any MCP client that supports remote servers. It signs you in with OAuth on first use.
# Claude Code
claude 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.
recurrence (daily / weekly / absoluteMonthly / relativeMonthly / absoluteYearly / relativeYearly) on create-task and update-task# Install globally using npm
npm install -g microsoft-todo-mcp-server
# Or using pnpm
pnpm install -g microsoft-todo-mcp-server
# Or run directly with npx (no installation)
npx microsoft-todo-mcp-server
The package provides five commands:
microsoft-todo-mcp-server - The MCP servermstodo - Short alias for the MCP servermstodo-config - Writes an mcp.json that points the server at your tokens.jsonmstodo-setup - Guided setup. It does not yet finish on its own after you sign in, so use the steps under Usage insteadmstodo-http - The MCP server over HTTP, for remote clients; each user signs in with their own Microsoft account (see HTTP Mode)git clone https://github.com/jordanburke/microsoft-todo-mcp-server.git
cd microsoft-todo-mcp-server
pnpm install
pnpm run build
http://localhost:3000/callback. For HTTP Mode, also add <your base URL>/oauth/callbackopenid 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.SharedUser.Read, offline_accessCreate a .env file in the repository root, where you run pnpm run auth (required for sign-in):
CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
TENANT_ID=your_tenant_setting
REDIRECT_URI=http://localhost:3000/callback
organizations - For multi-tenant organizational accounts (the default when TENANT_ID is unset)consumers - For personal Microsoft accounts onlycommon - For both organizational and personal accountsyour-specific-tenant-id - For single-tenant configurationsExamples:
# For multi-tenant organizational accounts (default)
TENANT_ID=organizations
# For personal Microsoft accounts
TENANT_ID=consumers
# For both organizational and personal accounts
TENANT_ID=common
# For a specific organization tenant
TENANT_ID=00000000-0000-0000-0000-000000000000
The server stores authentication tokens in tokens.json. It looks in three places, in order:
MSTODO_TOKEN_FILE, if set~/.config/microsoft-todo-mcp/tokens.json, or %APPDATA%\microsoft-todo-mcp\tokens.json on Windowstokens.json in the working directory, which is migrated to whichever of (1) or (2) is in effect on first read# Override the location
export MSTODO_TOKEN_FILE=/path/to/custom/tokens.json
You can also supply tokens directly, which takes precedence over the file:
export MS_TODO_ACCESS_TOKEN=your_access_token
export 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. On later launches the server uses that token file instead, as long as the environment still holds the same pair it was renewed from; set a new pair, for example after signing in again, and it starts over from that.
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.
Sign-in runs from a clone of this repository, with the .env file from Configuration in its root:
git clone https://github.com/jordanburke/microsoft-todo-mcp-server.git
cd microsoft-todo-mcp-server
pnpm install
pnpm run build
pnpm 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.
tokens.json holds your refresh token and your client secret, so keep it private:
# macOS and Linux
mkdir -p ~/.config/microsoft-todo-mcp
mv tokens.json ~/.config/microsoft-todo-mcp/tokens.json
chmod 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.
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:
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:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.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: pnpm run create-config (or mstodo-config) writes an mcp.json with the entry above, plus MSTODO_TOKEN_FILE set to the token file's absolute path. It copies no tokens into the config. It warns if the token file lacks clientId and clientSecret, which renewal needs.
About token environment variables: if you pass MS_TODO_ACCESS_TOKEN and MS_TODO_REFRESH_TOKEN instead, renewing them 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.
Upgrading from an older version: older versions copied renewed tokens into Claude Desktop's config as MS_TODO_ACCESS_TOKEN and MS_TODO_REFRESH_TOKEN, and older mstodo-config wrote them into mcp.json. The server now picks up its token file when that file holds the same refresh token, which heals the copied Claude Desktop entries. An old mcp.json sets no MSTODO_TOKEN_FILE, so it heals only if the server's token file (the default location, or MSTODO_TOKEN_FILE) is the one that pair came from. Either way, the fix that always works is to delete those two variables from the entry, so the server reads only the token file. Do the same if you sign in again: a fresh token file is ignored while an old pair is still set.
# Development & Building
pnpm run build # Build TypeScript to JavaScript
pnpm run dev # Build and run CLI in one command
pnpm run validate # Format, lint, typecheck, test and build (fixes format and lint)
pnpm run ci # The same checks without fixing anything; what CI runs
pnpm test # Run the tests
# Running the Server
pnpm start # Run MCP server (dist/cli.js)
pnpm run cli # Run MCP server via CLI wrapper
npx microsoft-todo-mcp-server # Run globally installed version
# Authentication & Configuration
pnpm run auth # Start OAuth authentication server
pnpm run create-config # Generate mcp.json from tokens.json
# Code Quality
pnpm run format # Format code with Prettier
pnpm run format:check # Check code formatting
pnpm run lint # Run linting checks
pnpm run typecheck # TypeScript type checking
mstodo-http serves the same tools over Streamable HTTP, for clients that connect by URL, such as a Claude custom connector. It is its own OAuth server in front of Microsoft, built on somamcp's Azure provider:
tokens.json and MS_TODO_* variables are never read in this mode.<your base URL>/oauth/callback, for example https://todo.example.com/oauth/callback..env in the working directory:| Variable | Required | Meaning |
|---|---|---|
MSTODO_HTTP_BASE_URL |
yes | The server's public origin, such as https://todo.example.com: https (plain http only for localhost), with no path. A reverse proxy that mounts the server under a path must strip it. |
CLIENT_ID, CLIENT_SECRET, TENANT_ID |
yes | The app registration. Use the tenant's id (a GUID) for a work or school tenant: sign-ins from other tenants are then refused. Use consumers for personal accounts only; common on a multi-tenant app also admits every work or school tenant. |
JWT_SIGNING_KEY, TOKEN_ENCRYPTION_KEY |
yes | Two different keys of at least 32 characters, such as openssl rand -base64 48. Keep them: changing either signs everyone out. |
MSTODO_HTTP_ALLOWED_USERS |
recommended | Comma-separated accounts allowed to sign in, by object id, sign-in name or email. With common or organizations, list object ids: another tenant can issue an id token with any email in it. Without the setting, any account the app registration accepts can sign in, and each sees only its own To Do. |
MSTODO_HTTP_PORT, MSTODO_HTTP_HOST |
no | Where to listen. Defaults: 3100 on 127.0.0.1. Use 0.0.0.0 in a container. |
MSTODO_HTTP_STORE |
no | Where sign-ins are stored, encrypted. Default ~/.config/microsoft-todo-mcp/http-store. It must be writable; the server checks at startup. |
MSTODO_HTTP_REDIRECT_URIS |
no | Comma-separated redirect URI patterns a client may register. Default: https://claude.ai/*, http://localhost:*/*, http://127.0.0.1:*/*. Each pattern must spell out its scheme and host in lower case; * and ? match only in the path, so https://claude.ai* is refused. Only localhost may use http or leave the port open. |
mstodo-http # or: npx -p microsoft-todo-mcp-server mstodo-http
It refuses to start, and lists what is wrong, until every required setting is valid.
<your base URL>/mcp. The client discovers the OAuth endpoints, registers itself, and sends you to Microsoft to sign in. Finish signing in within a day: a client nobody signs in with lapses after 24 hours, and then has to be removed and added again. A client that has signed in lasts 90 days after its last sign-in or refresh.auth-status reports who is signed in and when their Microsoft token expires.
The server provides 17 tools for comprehensive Microsoft To Do management:
auth-status - Check authentication status, token expiration, and account typeinfo - 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)get-task-lists - Retrieve all task lists with metadata (default, shared, etc.)create-task-list - Create a new task listupdate-task-list - Rename an existing task listdelete-task-list - Delete a task list and all its contentsget-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)get-tasks - Get tasks from a list with filtering, sorting, and pagination
$filter, $orderby, $top, $skip, $countorderby works on date fields such as createdDateTime; Graph rejects orderby=titletop caps the total, and the server follows Graph's paging to collect every pagecount prints the number of tasks returned; Graph itself returns no count for To Do tasksselect limits which fields print (status, dueDateTime, importance, categories, recurrence, body); it is applied by the server, not sent to Graphcreate-task - Create a new task with full property support
update-task - Update any task properties including recurrence (pass null to stop a recurring task)delete-task - Delete a task and all its checklist itemsPass 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:
// 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.
get-checklist-items - Get subtasks for a specific taskcreate-checklist-item - Add a new subtask to a taskupdate-checklist-item - Update subtask text or completion statusdelete-checklist-item - Remove a specific subtaskarchive-completed-tasks - Move completed tasks older than olderThanDays (default 90) from one list to another; dryRun previews without movingtest-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 usesrc/todo-index.ts) - The 16 To Do tools, registered on a somamcp serversrc/token-manager.ts) - Finds, renews and saves tokenssrc/cli.ts) - Executable entry point; starts the server over stdiosrc/auth-server.ts) - Express server for the OAuth 2.0 sign-insrc/setup.ts) - The guided mstodo-setup commandsrc/create-mcp-config.ts) - Helper to create MCP configurationsMailboxNotEnabledForRESTAPI, Microsoft has not enabled the To Do API for that mailbox. It is a Microsoft-side limit, not a bug in this server, and the server says so when it happensToken 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 accountsAADSTS7000215 (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 itCLIENT_ID, CLIENT_SECRET, and TENANT_ID in your .env filehttp://localhost:3000/callbackPermission issues
Work/School Accounts
TENANT_ID=organizations # Multi-tenant
# Or use your specific tenant ID
Personal Accounts
TENANT_ID=consumers # Personal only
# Or TENANT_ID=common for both types
Check authentication status:
# 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 date
date -d @$(($(jq -r '.expiresAt' ~/.config/microsoft-todo-mcp/tokens.json) / 1000))
Enable verbose logging:
# The server logs to stderr for debugging
mstodo 2> debug.log
Contributions are welcome! Please:
pnpm run validate (format, lint, typecheck, test, build) before submitting; CI runs pnpm run ci, the same checks without fixingMIT License - See LICENSE file for details
Maintained by Jordan Burke · Affiliated with SapientsAI
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by headroomlabs-ai
Compress tool outputs, logs, files, RAG chunks, and conversation history before they reach the LLM, keeping answers identical while saving up to 95% of tokens for JSON payloads.
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
{
"mcpServers": {
"microsoftTodo": {
"command": "npx",
"args": [
"-y",
"microsoft-todo-mcp-server"
],
"env": {
"CLIENT_ID": "<YOUR_CLIENT_ID>",
"CLIENT_SECRET": "<YOUR_CLIENT_SECRET>",
"TENANT_ID": "<YOUR_TENANT_ID>",
"REDIRECT_URI": "http://localhost:3000/callback"
}
}
}
}claude mcp add microsoftTodo npx -y microsoft-todo-mcp-server