Microsoft 365 MCP 服务器的 CLI
💡 描述
目前,这是一项正在进行的工作,更多的是 POC,而不是解决方案。
📦先决条件
- Node.js 20.x 或更高版本
🚀 如何构建和运行
首先运行npm install
来安装所有依赖项。
然后为了构建项目运行:
此 MCP 服务器使用全局安装的Microsoft 365 CLI ,您需要使用npm i -g @pnp/cli-microsoft365
全局安装。
MCP 服务器不会为您执行任何身份验证。您需要先使用m365 login
命令通过 Microsoft 365 的 CLI 进行身份验证。身份验证通过后,MCP 服务器在运行任何工具时都会使用相同的身份验证上下文。
使用检查器运行 MCP
测试 Microsoft 365 MCP 服务器 CLI 的方法之一是使用MCP 检查器。首先使用以下命令启动 MCP 服务器:
现在,为了运行 MCP 服务器的检查器,您需要在 repo 根文件夹位置运行以下命令:
之后等待检查器启动并在浏览器中打开它。您应该看到 MCP 服务器正在运行,并且能够查询工具并在本地执行它们。
在 VS Code 中运行 MCP
您也可以在 VS Code 中从本地构建运行 MCP 服务器,以便 GitHub Copilot Agent 可以使用它。首先使用以下命令启动 Microsoft 365 MCP 服务器的 CLI:
现在进入 VS Code GitHub Copilot Agent 模式,点击工具图标,选择Add more tools
。然后选择“ Add MCP server
,再选择Command (stdio)
,并输入以下命令:
点击 Enter 并随意命名。建议将其添加到workspace
范围进行测试。之后,打开.vscode/mcp.json
文件并修改它,以便传递身份验证所需的环境变量。
点击“开始”,您将看到 358 个新工具添加到您的 GitHub Copilot Agent。快来测试一下吧。为了获得最佳效果,建议使用Claude 3.5 Sonnet
作为 AI 模型。
🔗 资源
local-only server
The server can only run on the client's local machine because it depends on local resources.
一个 MCP 服务器,可通过 GitHub Copilot Agent 运行 Microsoft 365 命令的 CLI,允许用户使用自然语言与 Microsoft 365 服务进行交互。
Related MCP Servers
- AsecurityFlicenseAqualityThe Git MCP Server allows AI assistants to perform enhanced Git operations via the Model Context Protocol, supporting core Git functions, branch and tag management, GitHub integration, and more.Last updated -21426TypeScript
- AsecurityFlicenseAqualityAn MCP server that provides seamless interaction with Azure DevOps Git repositories, enabling users to manage repositories, branches, pull requests, and pipelines through natural language.Last updated -823TypeScript
- -securityAlicense-qualityAn MCP server that wraps around the GitHub CLI tool, allowing AI assistants to interact with GitHub repositories through commands for pull requests, issues, and repository operations.Last updated -3TypeScriptMIT License
- AsecurityFlicenseAqualityA powerful MCP server that enables AI assistants to interact with Microsoft Graph API for managing Outlook emails, Calendar events, OneDrive files, and Contacts through natural language commands.Last updated -208Python