Microsoft To Do MCP

Microsoft To Do MCP

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.

Category
访问服务器

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.

Features

  • 15 MCP Tools: Complete task management functionality including lists, tasks, checklist items, and organization features
  • Seamless Authentication: Automatic token refresh with zero manual intervention
  • OAuth 2.0 Authentication: Secure authentication with automatic token refresh
  • Microsoft Graph API Integration: Direct integration with Microsoft's official API
  • Multi-tenant Support: Works with personal, work, and school Microsoft accounts
  • TypeScript: Fully typed for reliability and developer experience
  • ESM Modules: Modern JavaScript module system

Prerequisites

  • Node.js 16 or higher (tested with Node.js 18.x, 20.x, and 22.x)
  • pnpm package manager
  • A Microsoft account (personal, work, or school)
  • Azure App Registration (see setup below)

Installation

Option 1: Global Installation (Recommended)

# 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 three command aliases:

  • microsoft-todo-mcp-server - Full package name
  • mstodo - Short alias for the MCP server
  • mstodo-config - Configuration helper tool

Option 2: Clone and Run Locally

git clone https://github.com/jordanburke/microsoft-todo-mcp-server.git
cd microsoft-todo-mcp-server
pnpm install
pnpm 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. Set the Redirect URI to http://localhost:3000/callback
  6. After creating the app, go to "Certificates & secrets" and create a new client secret
  7. Go to "API permissions" and add the following permissions:
    • Microsoft Graph > Delegated permissions:
      • Tasks.Read
      • Tasks.ReadWrite
      • User.Read
  8. Click "Grant admin consent" for these permissions

Configuration

Environment Setup

Create a .env file in the project root (required for authentication):

CLIENT_ID=your_client_id
CLIENT_SECRET=your_client_secret
TENANT_ID=your_tenant_setting
REDIRECT_URI=http://localhost:3000/callback

TENANT_ID Options

  • organizations - For multi-tenant organizational accounts (default if not specified)
  • consumers - For personal Microsoft accounts only
  • common - For both organizational and personal accounts
  • your-specific-tenant-id - For single-tenant configurations

Examples:

# 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

Token Storage

The server stores authentication tokens in tokens.json with automatic refresh 5 minutes before expiration. You can override the token file location:

# Using environment variable
export MSTODO_TOKEN_FILE=/path/to/custom/tokens.json

# Or pass tokens directly
export MS_TODO_ACCESS_TOKEN=your_access_token
export MS_TODO_REFRESH_TOKEN=your_refresh_token

Usage

Complete Setup Workflow

Step 1: Authenticate with Microsoft

# If installed globally
git clone https://github.com/jordanburke/microsoft-todo-mcp-server.git
cd microsoft-todo-mcp-server
pnpm install
pnpm run auth

# Or if running locally
pnpm run auth

This opens a browser window for Microsoft authentication and creates a tokens.json file.

Step 2: Create MCP Configuration

# Generate MCP configuration file
pnpm run create-config

# Or use the global helper (if installed globally)
mstodo-config

This creates an mcp.json file with your authentication tokens.

Step 3: Configure Your AI Assistant

For Claude Desktop:

Add to your configuration file:

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

For Cursor:

# Copy to Cursor's global configuration
cp mcp.json ~/.cursor/mcp-servers.json

Available Scripts

# Development & Building
pnpm run build        # Build TypeScript to JavaScript
pnpm run dev          # Build and run CLI in one command

# Running the Server
pnpm start            # Run MCP server directly
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

MCP Tools

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

Authentication

  • auth-status - Check authentication status, token expiration, and account type

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

Tasks (Main Todo Items)

  • get-tasks - Get tasks from a list with filtering, sorting, and pagination
    • Supports OData query parameters: $filter, $select, $orderby, $top, $skip, $count
  • create-task - Create a new task with full property support
    • Title, description, due date, start date, importance, reminders, status, categories
  • update-task - Update any task properties
  • delete-task - Delete a task and all its checklist items

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

Architecture

Project Structure

  • MCP Server (src/todo-index.ts) - Core server implementing the MCP protocol
  • CLI Wrapper (src/cli.ts) - Executable entry point with token management
  • Auth Server (src/auth-server.ts) - Express server for OAuth 2.0 flow
  • Config Generator (src/create-mcp-config.ts) - Helper to create MCP configurations

Technical Details

  • Microsoft Graph API: Uses v1.0 endpoints
  • Authentication: MSAL (Microsoft Authentication Library) with PKCE flow
  • Token Management: Automatic refresh 5 minutes before expiration
  • Build System: tsup for fast TypeScript compilation
  • Module System: ESM (ECMAScript modules)

Limitations & Known Issues

Personal Microsoft Accounts

  • MailboxNotEnabledForRESTAPI Error: Personal Microsoft accounts (outlook.com, hotmail.com, live.com) have limited access to the To Do API through Microsoft Graph
  • This is a Microsoft service limitation, not an issue with this application
  • Work/school accounts have full API access

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

  • 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

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

Debugging

Check authentication status:

# Using the MCP tool
# In your AI assistant: "Check auth status"

# Or examine tokens directly
cat tokens.json | jq '.expiresAt'

# Convert timestamp to readable date
date -d @$(($(cat tokens.json | jq -r '.expiresAt') / 1000))

Enable verbose logging:

# The server logs to stderr for debugging
mstodo 2> debug.log

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Run pnpm run lint and pnpm run typecheck before submitting
  4. Submit a pull request

License

MIT License - See LICENSE file for details

Acknowledgments

Support

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选