连接器指南阅读约 7 分钟29 个 MCP 工具7 种语言

将 SharePoint MCP 连接到 Microsoft Copilot

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。

HC作者:HelpCode 团队更新于 7 分钟阅读 在 GitHub 开源

无需信用卡 · 7 天试用 · 提供自托管方案

SharePoint (Microsoft 365)

SharePoint (Microsoft 365)

Let your AI work in SharePoint: find sites, browse and search document libraries, see file details and who has access, read, create and update list items, create lists, folders and text files, read site pages, and search everything with Microsoft Search. Microsoft 365 through Microsoft Graph, signed in with your work account.

个工具

29

区域

INTL

类别

文件存储

身份验证

OAuth 2.0

所需环境变量

MICROSOFT_CLIENT_IDMICROSOFT_CLIENT_SECRETMICROSOFT_TENANT_ID
在 Cloud 上一键安装

7 天免费试用 · 无需信用卡

  • 7 天免费试用
    无需信用卡
  • 符合 GDPR,SOC 2 就绪
    数据驻留欧盟,审计日志
  • 在 GitHub 开源
    开源 · AGPL-3.0
  • 支持 ChatGPT、Claude、Gemini
    任何兼容 MCP 的客户端

摘要

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。

引导式设置

2 分钟将 SharePoint 连接到 Microsoft Copilot

开始 AnythingMCP Cloud 免费试用,在引导式设置中连接 SharePoint,再把你的 MCP URL 添加到 Microsoft Copilot。无需代码,也无需自行运行服务器。

无需信用卡 · 7 天试用 · 提供自托管方案

试试这样问

SharePoint (Microsoft 365) 的示例提示

点击任意提示即可复制,然后粘贴到 Claude、ChatGPT、Cursor、Gemini、Copilot 或 OpenClaw 中,在该连接器上运行。

SharePoint (Microsoft 365) · 通过 MCP 实时
分享
Opus 4.7

Claude 是 AI,可能会出错。请核对回答。

💡 无需安装? 直接使用 cloud.anythingmcp.com。 登录、点击 Connectors → SharePoint (Microsoft 365)、粘贴凭证、生成 MCP API key,即可完成。无 Docker、无 git clone、无本地服务器。

Microsoft SharePoint + Microsoft Copilot

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。

前提条件

完整的设置说明已内置在连接器中 (在 store 中选择连接器时可见)。所需环境变量:

MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET, MICROSOFT_TENANT_ID

步骤 1 — 获取凭证

  1. 打开 Microsoft Entra 管理中心(entra.microsoft.com)或 Azure 门户,进入 Applications → App registrations → New registration。

  2. 为应用命名(例如 "AnythingMCP Microsoft 365"),并选择 Supported account types。这一选择决定 MICROSOFT_TENANT_ID 填什么:

    • Accounts in this organizational directory only(单租户):只有你组织内的用户可以登录。填写应用 Overview 页面上的 Directory (tenant) ID(一个 GUID),或你的域名,例如 contoso.onmicrosoft.com。
    • Accounts in any organizational directory(多租户):填写 organizations。
    • Accounts in any organizational directory and personal Microsoft accounts:填写 common。个人 Microsoft 账户没有 SharePoint,因此它们可以登录,但获取不到任何数据。

    如果该值与账户类型不符,Microsoft 会拒绝登录(AADSTS50194 或 AADSTS50020)。

  3. 在 Redirect URI 下选择平台 Web,填写 https://cloud.anythingmcp.com/api/mcp-oauth/callback。如果你自行托管 AnythingMCP,则改为填写 https://your-anythingmcp-host/api/mcp-oauth/callback。URI 必须逐字符一致,否则 Microsoft 会返回 AADSTS50011。

  4. 打开 API permissions → Add a permission → Microsoft Graph → Delegated permissions,添加 offline_access、User.Read、Sites.ReadWrite.All 和 Files.ReadWrite.All。offline_access 让 Microsoft 签发刷新令牌;缺少它,连接器会在授权一小时后停止工作。

  5. 打开 Certificates & secrets → New client secret。复制密钥的 Value,而不是 Secret ID;它只显示一次。记下到期日期:密钥过期后,连接器会停止工作,直到你创建新密钥并填入。

  6. 将 Overview 页面上的 Application (client) ID 填入 MICROSOFT_CLIENT_ID,将密钥值填入 MICROSOFT_CLIENT_SECRET,将第 2 步中的租户值填入 MICROSOFT_TENANT_ID,然后安装连接器。

  7. 在连接器页面点击 Authorize with Provider,用 AI 要处理其 SharePoint 站点的工作账户登录。刷新令牌会加密保存,访问令牌(有效期约一小时)会自动续期。

  8. 先运行 sharepoint_get_root_site:它会显示你组织的根站点,并确认可以访问 SharePoint。

“.All” 的含义:在这些委托权限中,All 指的是“登录用户能打开的每个站点”。AI 获得的权限永远不会超过该用户自己的 SharePoint 访问权限。

一个 Entra 应用服务所有 Microsoft 连接器:你为 Outlook、OneDrive 或 Excel 连接器创建的应用注册在这里同样适用。打开它,在 API permissions 下添加第 4 步中的权限,保留相同的重定向 URI,并复用同一个客户端 ID、密钥和租户。每个连接器在授权时只请求它自己需要的权限:

  • Outlook:Mail.ReadWrite、Mail.Send、Calendars.ReadWrite
  • OneDrive:Files.ReadWrite
  • Excel:Files.ReadWrite(工作簿位于 SharePoint 中或由他人共享给你时,还需要 Files.ReadWrite.All)
  • SharePoint:Sites.ReadWrite.All 和 Files.ReadWrite.All

它们都还需要 offline_access 和 User.Read。

管理员同意:这些委托权限通常不需要管理员,但许多组织关闭了用户同意。如果登录时显示 "Need admin approval"(AADSTS65001 或 AADSTS90094),需要租户管理员打开一次应用注册,点击 API permissions → Grant admin consent 为整个组织授予同意。之后每个用户都可以授权。每个连接器仍然只能处理登录账户有权查看的内容。

只读设置:在应用注册中添加 Sites.Read.All 和 Files.Read.All,在连接器的 OAuth 设置中将 scopes 替换为 offline_access User.Read Sites.Read.All Files.Read.All,重新授权,并停用 sharepoint_create_list_item、sharepoint_update_list_item、sharepoint_create_list、sharepoint_create_folder、sharepoint_upload_text_file、sharepoint_rename_drive_item 和 sharepoint_move_drive_item。

安装时默认关闭:sharepoint_delete_list_item、sharepoint_delete_drive_item、sharepoint_create_sharing_link 和 sharepoint_invite。共享链接和邀请是有意关闭的:它们会让其他人访问你组织的文件,而 AI 读取的文档里可能含有要求它共享内容的文字。只有在 AI 确实需要时才打开某个工具。删除的项目会进入站点的回收站。

如何找到内容:AI 会按关键字或根据站点地址(例如 https://contoso.sharepoint.com/sites/Marketing)查找站点,然后打开它的文档库和列表。sharepoint_search 使用 Microsoft Search 搜索你能看到的所有站点、文件和列表项。现代站点页面可以读取;经典页面、新闻帖子和页面编辑不在支持范围内。

列表:列表值按每一列的内部名称存储,内部名称可能与你看到的名称不同(显示为 "Due date" 的列可能是 DueDate)。AI 会先用 sharepoint_list_columns 读取列。在超过 5,000 个项目的列表中,SharePoint 只能按已建立索引的列进行筛选和排序。

文件和内容:连接器不下载文件内容,AI 会改为给你文件的链接。它可以创建最大约 4 MB 的文本文件,并且默认从不覆盖已有文件。要处理文档库中 Excel 工作簿的单元格,请使用 Microsoft Excel 连接器。

常见错误:401 InvalidAuthenticationToken 表示授权已被撤销或客户端密钥已过期;如有需要填入新密钥,然后再次点击 Authorize with Provider。403 accessDenied 表示缺少第 4 步中的某个权限或该权限未获同意,或者你无权访问该站点、库或列表。404 itemNotFound 表示站点、库、列表或项目有误,或站点路径不存在;个人 Microsoft 账户的每次调用都会得到 404 或 400。列表项上的 400 invalidRequest 表示列名不是内部名称,或值与该列不匹配;"cannot be referenced in filter or orderby as it is not indexed" 表示需要在列表设置中为该列建立索引。409 nameAlreadyExists 表示文件夹中已有同名项目。

连接器不下载文件内容,不上传二进制文件,不创建站点或更改站点权限,不删除列表或列,不编辑页面,也不管理术语库和内容类型。

步骤 2 — 安装 adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

步骤 3 — 在 Microsoft Copilot 中添加连接器

你的服务器 URL: 在 AnythingMCP 中打开 MCP Servers → 此连接器所在的服务器,复制它的 URL(https://cloud.anythingmcp.com/mcp/…)。本指南中出现 YOUR_SERVER_ID 的地方都用它替换。

Microsoft Copilot 通过在 Copilot Studio 中构建的智能体使用 MCP 服务器:把 AnythingMCP 作为工具添加到智能体,然后把智能体发布到 Microsoft 365 Copilot 和 Teams。Copilot Studio 从 Microsoft 的云端通过 Streamable HTTP 连接,AnythingMCP 支持这种方式。

  1. 在 Copilot Studio 中打开你的智能体(或新建一个),进入 Tools,选择 Add a tool → New tool → Model Context Protocol。
  2. 填写 Server name(例如 AnythingMCP)、说明连接器用途的 Server description,以及 Server URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID。Copilot Studio 根据描述决定何时调用该服务器。
  3. 身份验证选择 API key,把 Type 设为 Header,请求头名称填 X-API-Key,然后选择 Create。
  4. 在 Add tool 中选择 Create a new connection,粘贴 AnythingMCP 的 MCP API 密钥(MCP Servers → 你的服务器 → API keys),然后选择 Add to agent。
  5. 在智能体的 Test 窗格中试一试:提出需要用到 Microsoft SharePoint 的工具的请求。
  6. 选择 Publish,然后进入 Channels → Microsoft 365 and Microsoft Teams,保持勾选 Make agent available in Microsoft Copilot,再选择 Add channel。See agent in Teams 会为你安装该智能体;在 Microsoft 365 Copilot 中输入 @ 并选择该智能体。

希望每个用户各自登录?请选择 OAuth 2.0 → Dynamic discovery 代替 API 密钥:每个用户会在智能体首次调用时登录 AnythingMCP。

自托管?请用你实例的公网 HTTPS 地址替换 https://cloud.anythingmcp.com。Copilot Studio 从 Microsoft 的云端连接,因此 localhost 无法使用。

可用工具

ToolWhat it does
sharepoint_get_root_siteGet the organisation's root SharePoint site (e.g. https://contoso.sharepoint.com): its id, name, displayName, webUrl and hostname…
sharepoint_search_sitesFind SharePoint sites the user can open by keyword in their name or description, e.g. "marketing". "*" lists all sites the user can reach
sharepoint_get_site_by_pathGet a site from its address: hostname plus server-relative path, as in https://contoso.sharepoint.com/sites/Marketing → hostname…
sharepoint_get_siteGet one site by id: name, displayName, description, webUrl, dates and hostname
sharepoint_list_subsitesList the subsites of a site: id, name, displayName, webUrl
sharepoint_list_drivesList the document libraries (drives) of a site, e.g. "Documents" (Shared Documents) and other libraries: id, name, description, driveType…
sharepoint_list_drive_rootList the files and folders at the top level of a document library: id, name, size, dates, last modifier, file mimeType or folder child…
sharepoint_list_folderList the files and folders inside one folder of a document library
sharepoint_search_driveSearch one document library for files and folders whose name, metadata or content matches the text
sharepoint_get_drive_itemGet one file's or folder's metadata in a document library: name, size, dates, creator and last modifier, parentReference, file mimeType or…
sharepoint_searchSearch everything the user can see across SharePoint and OneDrive with Microsoft Search: files (driveItem), list items (listItem), lists…
sharepoint_list_listsList the lists and libraries of a site: id, name, displayName, description, list.template (genericList, documentLibrary, events...)…
sharepoint_list_columnsList the columns of a list with their internal name (the key used in fields), displayName, type (text, number, dateTime, choice with its…
sharepoint_list_itemsList the items of a list with their column values (fields), id, dates, creator and last modifier, webUrl
sharepoint_get_list_itemGet one list item with all its column values (fields), id, dates, creator, last modifier and webUrl
sharepoint_create_list_itemCreate an item in a list, with values keyed by the internal column names from sharepoint_list_columns
sharepoint_update_list_itemChange column values of a list item; columns not named keep their values
sharepoint_delete_list_itemDelete a list item
sharepoint_create_listCreate a new list in a site, optionally with columns (every list has a Title column)
sharepoint_create_folderCreate a folder in a document library, inside a parent folder (default: the library's top level)
sharepoint_upload_text_fileCreate a new text file (.txt, .md, .csv, .json, .html, .xml...) with the given content in a folder of a document library, up to about 4 MB
sharepoint_rename_drive_itemRename a file or folder in a document library in place
sharepoint_move_drive_itemMove a file or folder to another folder of the same document library, optionally renaming it on the way
sharepoint_delete_drive_itemDelete a file or folder (with its contents) from a document library
sharepoint_list_permissionsList who has access to a file or folder in a document library: roles, people and groups (grantedToV2), sharing links (link.type…
sharepoint_create_sharing_linkCreate a sharing link for a file or folder in a document library: type "view" or "edit", scope "anonymous", "organization" or "users"
sharepoint_inviteGive people access to a file or folder in a document library by email address, with role "read" or "write", optionally emailing them
sharepoint_list_pagesList the modern pages of a site: id, name, title, webUrl, pageLayout, publishing state, dates and author
sharepoint_get_pageRead one modern page with its content: title, description and canvasLayout (sections, columns and web parts; text web parts carry innerHtml)

示例提示

  • “找到“市场营销”站点,列出它的“文档”库中本月改动过的文件。”
  • “在“项目”列表中,显示所有状态为“未完成”、在周五之前到期的条目。”
  • “在“采购申请”列表中添加一项:“为销售团队采购新笔记本电脑”,金额 4,800,状态为“待审批”。”
  • “在 SharePoint 中搜索最新的差旅政策,并告诉我它存放在哪里。”

FAQ

这适用于哪个 Copilot? 适用于工作中的 Microsoft 365 Copilot,通过 Copilot Studio 的智能体实现。面向个人账户的 Microsoft Copilot 应用无法添加自己的 MCP 服务器。

我需要什么? 一个可以使用 Copilot Studio 的工作账户(许可证或试用版),用于构建智能体。在 Microsoft 365 Copilot 或 Teams 中使用它的人需要拥有该智能体的访问权限:把它共享给他们,或请管理员为整个组织发布。如果你的组织对 Power Platform 连接器设置了数据策略,这些策略同样适用于 MCP 服务器。

智能体不调用工具。 检查请求头名称是否正好是 X-API-Key,密钥是否属于与 URL 相同的 MCP 服务器,并把 Server description 写得具体:Copilot Studio 根据它决定何时调用服务器。每次修改后重新发布智能体;在已打开的对话中输入 "start over" 即可使用新版本。

下一步

这份指南对你有帮助吗?

2 分钟将 SharePoint 连接到 Microsoft Copilot

开始 AnythingMCP Cloud 免费试用,在引导式设置中连接 SharePoint,再把你的 MCP URL 添加到 Microsoft Copilot。无需代码,也无需自行运行服务器。

相关指南

连接器

将 SharePoint MCP 连接到 ChatGPT:文件与列表

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。

连接器

将 SharePoint MCP 连接到 Claude:文件与列表

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。

连接器

将 SharePoint MCP 连接到 Cursor:文件与列表

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。

连接器

将 SharePoint MCP 连接到 Gemini CLI

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。

连接器

将 SharePoint MCP 连接到 Meta Muse

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。

连接器

SharePoint MCP 服务器:站点、文件与列表

让你的 AI 在 SharePoint 中工作:查找站点,浏览和搜索文档库,查看文件详情和有权访问的人,读取、创建和更新列表项,创建列表、文件夹和文本文件,读取站点页面,并用 Microsoft Search 搜索所有内容。通过 Microsoft Graph 支持 Microsoft 365,使用你的工作账户登录。