微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📧

企业级 Microsoft 365 智能办公中枢

m365-mcp · v1.0.7
入口已确认,内容待校验 文件树里有 SKILL.md,但正文还没采回,frontmatter 未核对。
办公 安全 A 级 作者 sam2kb 公开目录收录
448 下载 0 安装 1.9k 收藏 5 浏览

简介

基于官方 Microsoft Graph API 构建的生产级 MCP 服务,支持 44 种邮件、日历、Teams 等企业级办公操作,采用设备码 OAuth 授权保障数据安全。

原始描述

Production-grade Microsoft 365 MCP server with delegated OAuth, multi-account support, pagination, rate limiting, and 44 tools covering email, calendar, contacts, OneDrive, Teams, tasks, and users.

通过你的 Agent 添加

安装目录:m365-mcp/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/m365-mcp/
Codex CLI~/.codex/skills/m365-mcp/
DeepSeek Harness~/.agents/skills/m365-mcp/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

m365-mcp 是一款面向企业用户的专业级 Microsoft 365 MCP 服务器,通过 MCP 协议将 Microsoft 365 的全套办公能力封装为 44 个标准化工具。用户需先通过 Azure Entra ID 注册应用并配置 delegated OAuth 权限,使用 m365-mcp-auth 命令行工具完成账户绑定和设备码登录后,即可在兼容的 AI 客户端中直接调用邮件收发、日程管理、文件操作、Teams 沟通等企业级功能。

该技能采用多账户架构设计,支持通过 M365_ACCOUNT 环境变量切换不同企业身份,同时内置 M365_MCP_READ_ONLY 只读模式,可一键禁用所有数据修改类操作。工具集按功能域划分为七大模块:邮件管理(9 项)、日历日程(7 项)、联系人管理(12 项)、OneDrive 文件(5 项)、Teams 沟通(3 项)、任务待办(5 项)及组织用户查询(3 项),覆盖现代办公的核心场景。

显著优点

企业级安全架构:采用设备码 OAuth 流程,完全避免客户端凭证泄露风险,所有数据交互仅限于用户授权范围,支持强制只读模式实现最小权限原则。

功能完整度高:整合邮件全生命周期管理、智能日程冲突检测、联系人智能搜索(People API)、Teams 消息收发、OneDrive 文件操作等 44 项能力,相比单一功能插件具备显著的集成优势。

生产环境就绪:内置分页处理、速率限制、重试逻辑等工程化特性,采用 TypeScript 全栈开发确保类型安全,支持多账户并发与跨租户场景。

权限粒度精细:工具层面标注 read-only、destructive、idempotent 等 MCP 标准注解,兼容客户端实现差异化确认策略,降低误操作风险。

潜在缺点与局限性

部署门槛较高:需用户自行完成 Azure 应用注册、权限配置、租户管理员同意等流程,对非技术背景用户存在明显学习曲线。

仅限 delegated 权限:不支持 client-credentials 模式,无法用于服务账户或后台自动化场景,所有操作均以用户身份执行。

Token 本地存储风险:刷新令牌以明文 JSON 形式存储于本地目录(~/.m365-mcp/auth/),虽设置 0600/0700 文件权限,但仍依赖本地系统安全,设备丢失或入侵可能导致令牌泄露。

部分功能受限:Private Outlook Contact Lists 及其成员信息无法通过 Microsoft Graph 暴露,Teams 工具仅支持聊天消息操作而不含频道管理,OneDrive 暂不支持文件上传/下载的二进制流传输。

适合的目标群体

  • 企业知识工作者:需高频处理邮件、日程、文档协同的办公室白领
  • 远程协作团队:依赖 Teams、Outlook、OneDrive 进行分布式办公的项目组
  • Microsoft 365 深度用户:已订阅商业版/企业版服务,追求 AI 增强办公效率
  • 技术型管理员:具备 Azure AD 配置能力,需为团队搭建安全可控的 AI 办公基础设施

使用风险

授权与合规风险:read 类工具可暴露私密邮件、文件、聊天记录等敏感数据,mutating 工具会直接修改生产数据,建议在 MCP 客户端启用显式确认策略。

Token 生命周期管理:长期有效的刷新令牌一旦泄露,攻击者可持续访问用户 Microsoft 365 数据直至手动撤销授权,需配合设备管理和定期审计。

API 依赖与速率限制:重度使用可能触发 Microsoft Graph 的 throttling 限制,大附件或批量操作存在性能瓶颈。

功能边界认知:AI 代理无法区分"可访问"与"应访问"的数据范围,需用户明确设置只读模式或人工审核关键操作。

技能正文


name: m365-mcp description: Production-grade Microsoft 365 MCP server with delegated OAuth, multi-account support, pagination, rate limiting, and 44 tools covering email, calendar, contacts, OneDrive, Teams, tasks, and users. metadata: openclaw: homepage: https://github.com/sam2kb/m365-mcp#readme requires: bins: - m365-mcp - m365-mcp-auth envVars: - name: M365_ACCOUNT required: false description: Optional account name selected from the local account store. - name: M365_TIMEZONE required: false description: Optional IANA timezone for calendar operations; defaults to UTC. - name: M365_MCP_AUTH_DIR required: false description: Optional absolute path for the local OAuth account and token store. - name: M365_MCP_READ_ONLY required: false description: Set true to request read-only scopes and disable all mutating tools. install: - kind: node package: "@sam2kb/m365-mcp" bins: - m365-mcp - m365-mcp-auth

m365-mcp

Production-grade Microsoft 365 MCP server combining the best of office365-connector (delegated OAuth, multi-account) and mcp-microsoft365 (MCP protocol, full scope), with production-ready features: pagination, rate limiting, retry logic, and full TypeScript.

Requirements

  • Node.js 18+
  • Azure Entra ID App Registration with delegated Microsoft Graph permissions
  • Device code OAuth (no client-credentials, no tenant-wide access)

Capabilities

Email (9 tools)

  • List, read, send, reply, search, move, delete, mark read/unread, list folders

Calendar (7 tools)

  • List events, today view, week view, create (with Teams meeting), update, delete, free/busy

Contacts (12 tools)

  • Rich contact CRUD, exact category assignment and any/all filtering, category enumeration, folder-scoped contacts, contact-folder CRUD, and relevance-ranked People API recipient search across mailbox and optional directory sources. People results support fuzzy search, identity-type filters, relevance scores, and optional profile details. Private Outlook Contact Lists and their membership are not exposed by Microsoft Graph.

OneDrive (5 tools)

  • List files, search, read content, metadata, create folders

Teams (3 tools)

  • List chats, read messages, send messages

Tasks (5 tools)

  • List lists, list tasks, create, update, delete

Users (3 tools)

  • List org users, profile lookup, manager lookup

Security and consent

  • The server contacts only Microsoft's OAuth and Graph services: login.microsoftonline.com and graph.microsoft.com.
  • Device-code OAuth grants delegated access as the signed-in user. Read tools can expose private mail, files, calendars, contacts, Teams chats, tasks, and user data.
  • Send, reply, move, create, update, and delete tools change real Microsoft 365 data. Configure the MCP client to require explicit user approval for those tools.
  • Tools publish standard MCP read-only, destructive, idempotent, and open-world annotations so compatible clients can apply confirmation policies.
  • Set M365_MCP_READ_ONLY=true for an enforced least-privilege mode. It requests read-only OAuth scopes, omits mutating tools from discovery, and rejects direct calls to them.
  • Refresh and access tokens are stored as plaintext JSON under ~/.m365-mcp/auth/ (or M365_MCP_AUTH_DIR), protected with directory mode 0700 and file mode 0600 where supported. Protect that directory and revoke the app's Microsoft account consent if a token or device is compromised.

Setup

ClawHub installs the prebuilt npm package automatically. For a manual install:

npm install --global @sam2kb/m365-mcp

# Add account
m365-mcp-auth add work <tenantId> <clientId> you@company.com

# Authenticate
m365-mcp-auth login --account=work

Then configure m365-mcp as a stdio MCP server in your client.

See the project README for the full Azure setup guide.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

officeproductivityapidocsproject-program-managementautomationbackend

同类 Skill