Microsoft 365 MCP Server
An MCP server that enables running CLI for Microsoft 365 commands through GitHub Copilot Agent, allowing users to interact with Microsoft 365 services using natural language.
README
Microsoft 365 MCP Server
💡 Description
Currently this is a work in progress and more POC than a solution. The goal is to create a MCP server that will allow to run any kind of CLI for Microsoft 365 command.
📦 Prerequisites
- Node.js 20.x or higher
🚀 How to build and run
Before anything first run npm install to install all dependencies.
Then in order to build the project run:
npm run build
In order to test this tool you will need to create a Entra app req and a certificate so that this MCP server can authenticate against Microsoft 365 as an app. In order to create a certificate and the app req with needed scopes and added it to your tenant along with the certificate runt the createApp.ps1 script and follow along the instructions. Most of the things you may leave empty when creating the cert except the password. The password is needed. As the script uses CLI for Microsoft 365 to create the app req and other stuff you will first need to install CLI for Microsoft 365 globally using npm i -g @pnp/cli-microsoft365 and sign in to your tenant as admin. After you executed the script you should see a 'MCP Server Test' app reg on your Entra ID with the needed scopes and certificate. You should also see the certificate file and the exported base64 encoded certificate in the temp folder. YOu will need them later.
Running MCP using the inspector
One of the ways to test the M365 MCP server is using the MCP Inspector. First start the M365 MCP server using the command:
npm run start
Now in order to run the inspector for your MCP server also passing down the needed parameters as environment so that the MCP server may pick them up and use them to authenticate against Microsoft 365 you can run the following command:
npx @modelcontextprotocol/inspector -e CertificatePassword='YOUR_PASSOWRD' -e AppId='ENTRA_APP_REG_ID' -e TenantId='TENANT_ID' -e TenantUrl='TENANT_URL' -e CertificateBase64Encoded='BASE64_ENCODED_VALUE_OF_YOUR_CERT' node dist/index.js
After that wait for the inspector to start and open the inspector in your browser. You should see the MCP server running and you should be able to query the tools and execute them locally.

Running MCP in VS Code
It is also possible to run the MCP server in VS Code from your local build so that it may be used by GitHub Copilot Agent. As of now this is only supported in VS Code Insiders. First start the M365 MCP server using the command:
npm run start
Now go to VS Code GitHub Copilot Agent mode click on the tools icon and select Add more tools. Then select Add MCP server and then Command (stdio) and enter the following command:
node FULL_PATH_TO_YOUR_PROJECT/dist/index.js
Click enter and name it how ever you like. It is recommended to add it to workspace scope for testing. After that open up your .vscode/mcp.json file and modify it so pass the environment variables needed for auth.
{
"servers": {
"m365-mcp-server": {
"type": "stdio",
"command": "node",
"args": [
"FULL_PATH_TO_YOUR_PROJECT/dist/index.js" // e.g. C:/workspace/repo/microsoft-365-mcp-server/dist/index.js
],
"env": {
"CertificateBase64Encoded": "BASE64_ENCODED_VALUE_OF_YOUR_CERT",
"CertificatePassword": "YOUR_PASSOWRD",
"AppId": "ENTRA_APP_REG_ID",
"TenantId": "TENANT_ID",
"TenantUrl": "TENANT_URL" // e.g. https://tenanttocheck.sharepoint.com/
}
}
}
}
Click on start and you should see 4 new tools added to your GitHub Copilot Agent. Test them out.

🎬 Demo
👉 Movie 🎬
🔗 Resources
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。