MS 365-21V MCP Server logo

MS 365-21V MCP Server

Community
mdwsk88

Policy-aware OAuth 2.1 MCP gateway for Microsoft 365 operated by 21Vianet

Publishermdwsk88
Repositoryms-365-21v-mcp-server
LanguageTypeScript
Forks
6
Stars
99
Available tools
0
Transport typestreamable-http
Categories
LicenseApache-2.0
Links
  • Connect tools to AI workflows

    MS 365-21V MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    99 stars and 6 forks from the linked repository.

MS 365-21V MCP Server

让支持 MCP 的 AI 客户端,以你的身份使用世纪互联 Microsoft 365。

查询邮件、安排日程、检索 OneDrive 和 SharePoint,连接 Microsoft Graph 中国区;保留用户权限、操作确认和审计边界。

CI License: Apache-2.0 Release

快速上手 · 完整部署 · 使用场景 · 工具目录 · English

非 Microsoft 或 21Vianet 官方产品。需要世纪互联租户和管理员授权,不适用于直接连接全球版 Microsoft 365 或个人 Outlook 账号。本文中的业务示例需要对应模块与权限,初始配置只开放个人资料查询。

先看它能帮你做什么

你对 AI 说能力启用条件
“获取我的个人资料,确认当前登录账号。”验证 OAuth → Graph 链路快速上手的默认场景
“列出最近 5 封邮件,只显示主题和发件人。”邮件读取Mail 模块、Mail.Read、mcp.mail
“检查明天的会议是否有时间冲突。”日程冲突分析Calendar + Smart 模块、对应权限与角色
“在我的 OneDrive 中查找项目计划。”文件检索OneDrive 模块、Files.Read、mcp.drive
“整理回复内容,发送前让我确认。”邮件写入与确认额外写权限;保持 MCP_SEND_MODE=confirm

工具会返回数据供 AI 客户端使用,不会因为接入 MCP 而授予用户原本没有的数据权限。完整角色、scope 和工具映射见工具目录。

为什么专门做一个 21V 版本

  • 中国区身份与数据端点:围绕 21V Entra 和 Microsoft Graph 中国区设计,而不是只替换全球版服务的域名。
  • 客户端接入更统一:Streamable HTTP + OAuth bridge,通过一个 MCP 地址连接;服务端使用当前用户的 delegated permissions / OBO。
  • 可控制的工具与写操作:App Roles、按模块与 scope 过滤、常用工具直达/长尾工具发现,以及确认与脱敏审计。

覆盖邮件、日历、OneDrive、SharePoint、Teams、联系人、组织用户、Microsoft Search 和智能聚合。代码中实现了工具,不等于你的租户已授权,也不等于每个全球云 API 都在 21V 可用。

快速开始

只使用别人已经部署好的服务?

不需要克隆仓库,也不需要自己创建 Entra 应用。向管理员获取 HTTPS MCP 地址及使用权限,在支持 Streamable HTTP 和 OAuth 的客户端添加它,然后登录。参见用户使用说明。

第一次部署?从“读取我的资料”开始

准备 Node.js 22+、Git,以及能配置 Entra 应用、同意权限并分配角色的管理员。先按快速上手完成单应用配置,再运行:

bash
git clone https://github.com/mdwsk88/ms-365-21v-mcp-server.git
cd ms-365-21v-mcp-server
npm run setup

向导只询问 Tenant ID、API Client ID 和服务地址。它生成最小 .env,不会覆盖已有文件,也不会要求你把 client secret 放进命令行。编辑 .env 中的 MS_CLIENT_SECRET,使用 secret 的 Value,不是 Secret ID,然后运行:

bash
npm run doctor
npm ci
npm run build
npm run start:http

本机桌面客户端连接 http://localhost:3000/mcp。远程或云端客户端需要能够访问的 HTTPS 地址;云端客户端的 localhost 不是你的电脑。

成功标准: 在客户端完成登录,调用 auth_status,再成功执行 graph_get_me。健康检查通过或能看到工具,都不等于 Graph 权限已经配置成功。

初始配置保持 OAuth、App Roles、审计和操作确认开启,只加载个人资料模块。后续按需启用邮件、日历等功能,不用一次申请全部权限。逐步启用只读邮件

已有部署请先运行 npm run doctor,不要重新生成或覆盖 .env。Docker、双应用、反向代理和生产检查见完整部署说明。

使用已发布的 Docker 镜像

配置好 Entra 和 .env 后,可以直接使用镜像,无需在本机编译:

bash
docker compose -f docker-compose.release.yml pull
docker compose -f docker-compose.release.yml up -d

默认镜像为 ghcr.io/mdwsk88/ms-365-21v-mcp-server:v0.1.0,支持 Linux amd64 / arm64。配置文件下载、首次启动和升级回退见 Docker 镜像说明,更新记录见 Releases。

配置错了,从哪里查?

bash
npm run doctor
npm run --silent doctor -- --json

离线检查会提示缺失或占位凭据、错误的云端点、地址覆盖、端口格式和单/双应用凭据不匹配等常见问题。它不打印配置值、不访问网络,也不修改 Entra。检查通过不代表管理员同意、Conditional Access 或真实 OAuth/Graph 调用已经验证。

常见问题与检查边界

客户端兼容性

仓库此前记录 WorkBuddy、Qoder Work、Codex 和 Dify 已完成远程连接、OAuth、工具发现与调用验证;这不是本次维护对这些客户端最新版的重新认证。详细记录保留在完整部署说明。

其他客户端需要支持 Streamable HTTP、OAuth 资源元数据/授权服务器发现、浏览器回调和 Bearer token。客户端能打开登录页面,也仍可能被租户 MFA、设备合规或用户分配策略拦截。

安全边界

远程服务使用 HTTPS;生产凭据放入 Secret Manager;只授予实际需要的 Graph delegated permissions 和 App Roles。不要为解决登录问题关闭认证或直接开放全部模块。

使用中国区 Graph 不自动保证端到端数据不出境:工具结果还会发送给你选择的 AI 客户端/模型服务。上线前需审核客户端数据流、日志留存、模型供应商及组织合规要求。详见威胁模型和安全策略。

文档与参与

目标入口
首次跑通、检查配置、逐步启用功能快速上手
Docker、双应用、角色、生产部署完整部署
实际使用方式与提示词用户使用说明
工具及所需权限工具目录
回调、设备策略与登录问题Entra 登录排障
后续维护优先级与发布记录维护路线 · Changelog

项目解决了你的 21V 接入问题,欢迎点一个 Star,也欢迎提交脱敏的使用反馈或客户端兼容性记录。贡献前请阅读 CONTRIBUTING.md;安全漏洞不要公开提交 Issue。

License

Apache License 2.0。Microsoft、Microsoft 365、Microsoft Entra、Microsoft Graph 等名称属于各自商标权利人,参见 TRADEMARKS.md。

Use MS 365-21V MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once MS 365-21V MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP connects through a hosted MCP server URL in TypingMind.

Add an MCP server URL

Use this when MS 365-21V MCP Server is already hosted remotely or your team wants one shared connector that multiple users can access.

1

Open MCP connectors

In TypingMind, go to Plugins, open MCP connectors, then choose Add URL.

  1. Open TypingMind in your browser.
  2. Go to Plugins.
  3. Open MCP connectors.
  4. Click Add URL.
TypingMind Add Custom MCP Server URL form
2

Paste the server URL

Enter the MCP server URL from the provider in the Server URL field. Add a connection name, description, icon, custom HTTP headers, or OAuth client settings if the server requires them.

  1. Paste the MCP server URL from the provider into the Server URL field.
  2. Enter a connection name for MS 365-21V MCP Server.
  3. Add a description and icon if you want it to be easier to identify.
  4. Add custom HTTP headers or OAuth client details if the server requires authentication.
3

Create the connection

Click Create connection, then return to the Plugins list and confirm the new MCP connection is active.

  1. Click Create connection.
  2. Return to the MCP connectors list.
  3. Confirm the MS 365-21V MCP Server connection appears as active.
  4. Refresh the plugin list if the connection does not appear immediately.
4

Switch models without reconnecting

Start a chat with your preferred model, enable the MS 365-21V MCP Server tools from Plugins, and switch to another model whenever needed. The MCP connection stays available to the TypingMind workspace.

  1. Start a new chat in TypingMind.
  2. Select the AI model you want to use.
  3. Enable the MS 365-21V MCP Server tools from Plugins.
  4. Ask the model to use the tool when needed.
  5. Switch to another AI model and reuse the same MCP connection.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use MS 365-21V MCP Server to help me with this task?
MS 365-21V MCP Server
Sure. I read it.
Here is what I found using MS 365-21V MCP Server.

Frequently asked questions

What is the MS 365-21V MCP Server MCP server used for?

MS 365-21V MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use MS 365-21V MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use MS 365-21V MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use MS 365-21V MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With MS 365-21V MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect MS 365-21V MCP Server MCP to TypingMind?

MS 365-21V MCP Server can be connected in TypingMind by adding its hosted MCP server URL. This is useful when you want a remote MCP connection that is available from your TypingMind workspace.

What tools does MS 365-21V MCP Server MCP provide in TypingMind?

MS 365-21V MCP Server exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use MS 365-21V MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If MS 365-21V MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇