Outlook OAuth MCP Server

Outlook OAuth MCP Server

Enables interaction with Microsoft Outlook for managing emails and calendars through OAuth2 delegated access. It provides a stateless, spec-compliant server that allows users to authenticate and perform mail and calendar operations with their own Microsoft accounts.

Category
访问服务器

README

useful-outlook-mcp

A remote MCP server for Microsoft Outlook with proper OAuth2 and agent-optimized tools.

Features

  • Spec Compliant: RFC 9728/8414 OAuth metadata, RFC 7591 dynamic client registration
  • Stateless OAuth: Tokens managed by client, not server—as OAuth intended
  • Agent-Optimized Tools: Extensive prompt engineering in tool descriptions
  • Dynamic Scopes: OAuth scopes auto-adjust to enabled tools
  • Production Ready: Docker, rate limiting, read-only mode, tool filtering

Quick Start

npm install
npm run build
npm start  # Server at http://localhost:3000

Required environment:

MS365_MCP_CLIENT_ID=your-azure-ad-client-id
MS365_MCP_CLIENT_SECRET=your-azure-ad-client-secret
MS365_MCP_TENANT_ID=your-tenant-id  # or 'common'

Azure AD Setup

  1. Azure Portal → Microsoft Entra ID → App registrations → New
  2. Add delegated permissions: User.Read, Mail.Read, Mail.ReadWrite, Mail.Send, Calendars.Read, Calendars.ReadWrite, Calendars.Read.Shared, offline_access
  3. Add redirect URI: http://localhost:6274/oauth/callback (for MCP Inspector)
  4. Certificates & secrets → New client secret → Copy the value
  5. Copy Client ID, Client Secret, and Tenant ID to your .env

Tools

Mail

list-mail-folders · list-mail-messages · search-mail · get-mail-message · send-mail · create-draft-mail · reply-mail · reply-all-mail · create-reply-draft · create-reply-all-draft · delete-mail-message · move-mail-message

Calendar

list-calendars · list-calendar-events · search-calendar-events · find-meeting-times · get-calendar-event · get-calendar-view · create-calendar-event · update-calendar-event · delete-calendar-event

Configuration

Variable Default Description
MS365_MCP_CLIENT_ID required Azure AD client ID
MS365_MCP_CLIENT_SECRET - Client secret (optional)
MS365_MCP_TENANT_ID common Tenant ID
MS365_MCP_PORT 3000 Server port
MS365_MCP_READ_ONLY_MODE false Disable write operations
MS365_MCP_ENABLED_TOOLS all Comma-separated tool allowlist
MS365_MCP_CORS_ORIGIN * CORS origins
MS365_MCP_RATE_LIMIT_REQUESTS 30 Requests per window
MS365_MCP_RATE_LIMIT_WINDOW_MS 60000 Window size (ms)
MS365_MCP_ALLOWED_TENANTS - Restrict to specific tenants

Docker

From GitHub Container Registry:

docker run -p 3000:3000 \
  -e MS365_MCP_CLIENT_ID=xxx \
  -e MS365_MCP_CLIENT_SECRET=xxx \
  -e MS365_MCP_TENANT_ID=xxx \
  ghcr.io/Leonine-Studios/useful-outlook-mcp:latest

Or build locally:

docker build -t useful-outlook-mcp .
docker run -p 3000:3000 \
  -e MS365_MCP_CLIENT_ID=xxx \
  -e MS365_MCP_CLIENT_SECRET=xxx \
  -e MS365_MCP_TENANT_ID=xxx \
  useful-outlook-mcp

Endpoints

Endpoint Description
POST /mcp MCP protocol
GET /health Health check
GET /.well-known/oauth-protected-resource RFC 9728
GET /.well-known/oauth-authorization-server RFC 8414
GET /authorize OAuth (proxies to Microsoft)
POST /token Token exchange (proxies to Microsoft)
POST /register Dynamic client registration

Testing

npm run dev
npx @modelcontextprotocol/inspector  # Connect to http://localhost:3000/mcp

Design Notes

<details> <summary>Why another Outlook MCP server?</summary>

Problems with existing servers

  1. Legacy architecture: Built as stdio with HTTP bolted on. This is HTTP-native.

  2. OAuth done wrong: Most servers store tokens server-side. This server is stateless—tokens passed per-request via Authorization header, never stored.

  3. Tools without thought: Typical servers map API endpoints 1:1 without guidance. Agents fail in practical use because they don't know API quirks or multi-step workflows.

What's different

Every tool includes:

  • When to use it vs alternatives
  • Known Graph API quirks (there are many)
  • Workflow guidance for multi-step tasks
  • Parameter combinations that fail

Example: find-meeting-times explains that email addresses are required (names don't work), how to find emails from names using search-mail, what OrganizerUnavailable means, and that isOrganizerOptional=true needs user confirmation.

Known Graph API quirks

  • Mail sender filtering: eq on from/emailAddress/address is unreliable—uses startswith()
  • Mail recipient filtering: Can't filter to/cc/bcc with $filter—must use $search
  • Calendar organizer filtering: $filter on organizer email returns 500—filtered client-side
  • Concurrency: Parallel calls can return MailboxConcurrency errors
  • Search + sort: $search can't combine with $orderby

</details>

License

MIT

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选