Outlook Assistant
MCP server for Claude to access Outlook data via Microsoft Graph API
README
<div align="center">
<a href="https://glama.ai/mcp/servers/@titanzero/outlook-mcp"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@titanzero/outlook-mcp/badge" alt="Outlook MCP on Glama" /> </a>
Outlook MCP Server
Let AI manage your Outlook inbox, calendar, and rules — through natural language.
Built on Model Context Protocol · Powered by Microsoft Graph API
</div>
What is this?
This MCP server turns Claude into a full-featured Outlook assistant. Instead of clicking through the Outlook UI, just ask Claude:
"Show me unread emails from this week" "Schedule a meeting with Alice tomorrow at 3pm" "Create a rule to move all GitHub notifications to a folder"
Claude handles authentication, API calls, pagination, filtering — everything. You just talk.
Capabilities
| Area | What Claude can do |
|---|---|
| List, search, read (preview or full body), send, mark read/unread | |
| Calendar | List upcoming events, create, accept, decline, cancel, delete |
| Folders | List folder hierarchy, create folders, move emails between folders |
| Rules | List inbox rules, create new rules, change rule execution order |
| Auth | OAuth 2.0 with automatic token refresh — authenticate once, use forever |
Quick Start
# 1. Clone and install
git clone https://github.com/titanzero/outlook-mcp.git
cd outlook-mcp
npm install
# 2. Configure (see Azure Setup below)
cp .env.example .env
# Edit .env with your Azure credentials
# 3. Start the OAuth server and authenticate
npm run auth-server
# 4. Add to Claude Desktop config and start using!
Azure App Setup
You need an Azure app registration to connect to Microsoft Graph.
<details> <summary><strong>1. Register the App</strong></summary>
- Open Azure Portal → App registrations
- Click New registration
- Name:
Outlook MCP Server(or anything you like) - Account type: Accounts in any organizational directory and personal Microsoft accounts
- Redirect URI: Web →
http://localhost:3333/auth/callback - Click Register
- Copy the Application (client) ID → this is your
OUTLOOK_CLIENT_ID
</details>
<details> <summary><strong>2. Set API Permissions</strong></summary>
Go to API permissions → Add a permission → Microsoft Graph → Delegated permissions, then add:
offline_accessUser.ReadMail.ReadMail.SendCalendars.ReadCalendars.ReadWriteContacts.Read
</details>
<details> <summary><strong>3. Generate Client Secret</strong></summary>
- Go to Certificates & secrets → Client secrets → New client secret
- Set description and longest expiration
- Copy the secret VALUE (not the Secret ID!)
- This is your
OUTLOOK_CLIENT_SECRET
</details>
Configuration
Environment Variables
Create .env in the project root:
OUTLOOK_CLIENT_ID=your-application-client-id
OUTLOOK_CLIENT_SECRET=your-client-secret-VALUE
Important: Always use the secret VALUE from Azure, not the Secret ID.
Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"outlook-assistant": {
"command": "node",
"args": ["/absolute/path/to/outlook-mcp/index.js"],
"env": {
"OUTLOOK_CLIENT_ID": "your-client-id",
"OUTLOOK_CLIENT_SECRET": "your-client-secret"
}
}
}
}
Advanced
Edit config.js to customize server name, timezone, pagination limits, field selections, and response format (toon or text).
Authentication Flow
You ──ask Claude──▸ "authenticate"
│
Claude returns URL ◂────┘
│
You open URL in browser ▸ Microsoft login ▸ Grant permissions
│
┌───────────────────────────┘
▼
OAuth callback on localhost:3333
Tokens saved to ~/.outlook-mcp-tokens.json
✔ Auto-refresh — no re-auth needed
Step 1 — Start the auth server (must be running before authenticating):
npm run auth-server
Step 2 — Ask Claude to authenticate, open the URL, sign in, done.
Tokens persist in ~/.outlook-mcp-tokens.json and refresh automatically.
Project Structure
index.js ── MCP entry point
config.js ── centralized constants & settings
outlook-auth-server.js ── standalone OAuth server
auth/ ── authentication & token management
email/ ── list, search, read, send, mark-as-read
calendar/ ── list, create, accept, decline, cancel, delete
folder/ ── list, create, move
rules/ ── list, create, edit-rule-sequence
utils/
├── graph-client.js ── Graph SDK wrapper with pagination
├── response-formatter.js ── TOON / plain-text output toggle
└── response-helpers.js ── error detection & MCP response builders
scripts/ ── CLI utilities & debug helpers
Available Commands
| Command | Description |
|---|---|
npm install |
Install dependencies |
npm start |
Start the MCP server (stdio) |
npm run auth-server |
Start OAuth server on port 3333 |
npm run inspect |
Launch MCP Inspector for interactive testing |
npm test |
Run Jest test suite |
npm run debug |
Print env vars and start server |
npx kill-port 3333 |
Free port 3333 if occupied |
Troubleshooting
<details> <summary><strong>Cannot find module '@modelcontextprotocol/sdk'</strong></summary>
Run npm install first.
</details>
<details> <summary><strong>EADDRINUSE: port 3333 already in use</strong></summary>
npx kill-port 3333
npm run auth-server
</details>
<details> <summary><strong>Invalid client secret (AADSTS7000215)</strong></summary>
You're using the Secret ID instead of the Secret Value. Go to Azure Portal → Certificates & secrets → copy the Value column.
</details>
<details> <summary><strong>Auth URL doesn't load / "site can't be reached"</strong></summary>
The auth server isn't running. Start it first with npm run auth-server, then retry.
</details>
<details> <summary><strong>"Authentication required" after setup</strong></summary>
Token may be expired or corrupted. Delete ~/.outlook-mcp-tokens.json and re-authenticate.
</details>
<details> <summary><strong>Server doesn't start in Claude Desktop</strong></summary>
- Verify the absolute path to
index.jsin your Claude Desktop config - Ensure
OUTLOOK_CLIENT_IDandOUTLOOK_CLIENT_SECRETare set - Restart Claude Desktop after config changes
</details>
Extending the Server
Adding a new tool is straightforward:
- Create a handler file in the appropriate module directory
- Export
{ name, description, inputSchema, handler } - Add it to the module's
index.jsexports - It's automatically registered via
index.jsat the root
See .cursor/rules/new-tool.mdc for the full checklist.
License
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。