Skip to main content
Glama

Microsoft 365 MCP Server

by pnp

Microsoft 365 MCP 服务器的 CLI

💡 描述

目前,这是一项正在进行的工作,更多的是 POC,而不是解决方案。

📦先决条件

  • Node.js 20.x 或更高版本

🚀 如何构建和运行

首先运行npm install来安装所有依赖项。

然后为了构建项目运行:

npm run build

此 MCP 服务器使用全局安装的Microsoft 365 CLI ,您需要使用npm i -g @pnp/cli-microsoft365全局安装。

MCP 服务器不会为您执行任何身份验证。您需要先使用m365 login命令通过 Microsoft 365 的 CLI 进行身份验证。身份验证通过后,MCP 服务器在运行任何工具时都会使用相同的身份验证上下文。

使用检查器运行 MCP

测试 Microsoft 365 MCP 服务器 CLI 的方法之一是使用MCP 检查器。首先使用以下命令启动 MCP 服务器:

npm run start

现在,为了运行 MCP 服务器的检查器,您需要在 repo 根文件夹位置运行以下命令:

npx @modelcontextprotocol/inspector node dist/index.js

之后等待检查器启动并在浏览器中打开它。您应该看到 MCP 服务器正在运行,并且能够查询工具并在本地执行它们。

检查员

在 VS Code 中运行 MCP

您也可以在 VS Code 中从本地构建运行 MCP 服务器,以便 GitHub Copilot Agent 可以使用它。首先使用以下命令启动 Microsoft 365 MCP 服务器的 CLI:

npm run start

现在进入 VS Code GitHub Copilot Agent 模式,点击工具图标,选择Add more tools 。然后选择“ Add MCP server ,再选择Command (stdio) ,并输入以下命令:

node FULL_PATH_TO_YOUR_PROJECT/dist/index.js

点击 Enter 并随意命名。建议将其添加到workspace范围进行测试。之后,打开.vscode/mcp.json文件并修改它,以便传递身份验证所需的环境变量。

{ "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 ] } } }

点击“开始”,您将看到 358 个新工具添加到您的 GitHub Copilot Agent。快来测试一下吧。为了获得最佳效果,建议使用Claude 3.5 Sonnet作为 AI 模型。

vs 代码

🔗 资源

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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 服务进行交互。

  1. 💡 描述
    1. 📦先决条件
      1. 🚀 如何构建和运行
        1. 使用检查器运行 MCP
        2. 在 VS Code 中运行 MCP
      2. 🔗 资源

        Related MCP Servers

        • A
          security
          F
          license
          A
          quality
          The 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 -
          21
          42
          6
          TypeScript
        • A
          security
          F
          license
          A
          quality
          An 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 -
          8
          2
          3
          TypeScript
        • -
          security
          A
          license
          -
          quality
          An 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 -
          3
          TypeScript
          MIT License
          • Linux
          • Apple
        • A
          security
          F
          license
          A
          quality
          A 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 -
          20
          8
          Python
          • Apple

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/pnp/cli-microsoft365-mcp-server'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server