
Claude 的 MCP 服务器,通过 Microsoft Graph API 访问 Outlook 数据
概览
这是一个全面的MCP(模型上下文协议)服务器,通过Microsoft Graph API和Power Automate API将Claude与Microsoft 365服务连接起来。 - - 电子邮件、日历、文件夹和规则 - - 文件、文件夹、搜索和共享 - - 流程、环境和运行历史 - :通过 Microsoft Graph API 实现 OAuth 2.0 认证(+ Power Automate 的 Flow API)- : 列出、搜索、阅读、发送和组织邮件 - : 列表、创建、接受、拒绝和删除日历事件 - : 列表、搜索、上传、下载和共享文件 - : 列出环境/流程、触发流程、查看运行历史 - : 为维护性清晰分离关注点 - : 用于测试而无需真实 API 调用的模拟响应 1. : npm 安装 2.: 在 Azure 门户注册应用(详见下文详细步骤) 3.: 将 .env.example 复制到 .env 并添加你的 Azure 凭证 4.: 更新你的 Claude 桌面配置,包含服务器路径 5.: npm 运行 auth-server 6.: 使用 Claude 中的认证工具获取 OAuth URL 7.
概述(AI 翻译)
这是一个全面的MCP(模型上下文协议)服务器,通过Microsoft Graph API和Power Automate API将Claude与Microsoft 365服务连接起来。
支持服务
- Outlook - 电子邮件、日历、文件夹和规则
- OneDrive - 文件、文件夹、搜索和共享
- Power Automate - 流程、环境和运行历史
目录结构
特色
- 认证:使用Microsoft Graph API(+ Power Automate的Flow API)进行OAuth 2.0认证
- 电子邮件管理:列出、搜索、阅读、发送和组织电子邮件
- 日历管理:列出、创建、接受、拒绝和删除日历事件
- OneDrive 集成:列表、搜索、上传、下载和分享文件
- Power Automate:列出环境/流程、触发流程、查看运行历史
- 模块化结构:可维护性方面清晰分离
- 测试模式:模拟响应,无需真实API调用即可测试
可用工具
Outlook(电子邮件和日历)
| 工具 | 描述 |
|---|---|
list-emails |
列出收件箱中的最近邮件 |
search-emails |
带筛选功能的邮件搜索 |
read-email |
阅读邮件内容 |
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
M365 Assistant MCP Server
A comprehensive MCP (Model Context Protocol) server that connects Claude with Microsoft 365 services through the Microsoft Graph API and Power Automate API.
Supported Services
- Outlook - Email, calendar, folders, and rules
- OneDrive - Files, folders, search, and sharing
- Power Automate - Flows, environments, and run history
Directory Structure
├── index.js # Main entry point
├── config.js # Configuration settings
├── auth/ # Authentication modules
│ ├── index.js # Authentication exports
│ ├── token-manager.js # Token storage and refresh (Graph + Flow)
│ └── tools.js # Auth-related tools
├── calendar/ # Calendar functionality
│ ├── index.js # Calendar exports
│ ├── list.js # List events
│ ├── create.js # Create event
│ ├── delete.js # Delete event
│ ├── cancel.js # Cancel event
│ ├── accept.js # Accept event
│ └── decline.js # Decline event
├── email/ # Email functionality
│ ├── index.js # Email exports
│ ├── list.js # List emails
│ ├── search.js # Search emails
│ ├── read.js # Read email
│ ├── send.js # Send email
│ └── mark-as-read.js # Mark email read/unread
├── folder/ # Folder functionality
│ ├── index.js # Folder exports
│ ├── list.js # List folders
│ ├── create.js # Create folder
│ └── move.js # Move emails
├── rules/ # Email rules functionality
│ ├── index.js # Rules exports
│ ├── list.js # List rules
│ └── create.js # Create rule
├── onedrive/ # OneDrive functionality
│ ├── index.js # OneDrive exports
│ ├── list.js # List files/folders
│ ├── search.js # Search files
│ ├── download.js # Get download URL
│ ├── upload.js # Simple upload (<4MB)
│ ├── upload-large.js # Chunked upload (>4MB)
│ ├── share.js # Create sharing link
│ └── folder.js # Create/delete folders
├── power-automate/ # Power Automate functionality
│ ├── index.js # Power Automate exports
│ ├── flow-api.js # Flow API client
│ ├── list-environments.js # List environments
│ ├── list-flows.js # List flows
│ ├── run-flow.js # Trigger flow
│ ├── list-runs.js # Run history
│ └── toggle-flow.js # Enable/disable flow
└── utils/ # Utility functions
├── graph-api.js # Microsoft Graph API helper
├── odata-helpers.js # OData query building
安装
npx kill-port 3333配置
{
"mcpServers": {
"m365-assistant": {
"command": "node",
"args": ["/path/to/outlook-mcp/index.js"],
"env": {
"USE_TEST_MODE": "false",
"OUTLOOK_CLIENT_ID": "your-client-id",
"OUTLOOK_CLIENT_SECRET": "your-client-secret"
}
}
}
}