Skip to main content
Glama

SharePoint MCP Bridge

中文 · English

中文

一个可从 GitHub 下载的本地 MCP 项目:Chromium 扩展负责从已登录的 SharePoint Online 页面捕获会话上下文,Node.js MCP 服务负责通过 Microsoft Graph / SharePoint REST 提供受监督的 SharePoint 操作。

项目不要求注册 Entra 应用,也不把 token 上传到云端。MCP 服务、HTTP bridge 和运行时数据都在本机运行;bridge 只监听 http://127.0.0.1:17374。

Related MCP server: sharepoint-mcp

适合谁

  • 想在 Claude Desktop、Cursor、VS Code 或其他支持 stdio MCP 的客户端中操作 SharePoint Online 的普通用户。

  • 需要读取或维护列表、列表项、视图格式、权限、站点组、现代页面和文档库文件的用户。

  • 接受“浏览器登录 + 本地扩展 + 本地 MCP 服务”工作方式的团队。

SharePoint Server(本地部署)、租户管理、无人值守登录和任意 SPFx/DOM 编辑不在项目范围内。

5 分钟安装

1. 下载并构建

从 GitHub 选择 Code → Download ZIP,解压到一个不会被移动的目录;或者使用 git clone。需要 Node.js 20 或更高版本,以及 Chrome 或 Edge。

在项目目录运行:

npm install
npm run build
npm run doctor

npm run build 会生成 dist/server/index.js 和 dist/extension。不要直接加载源码目录,扩展必须加载构建后的目录。

2. 加载 Chromium 扩展

  1. 打开 edge://extensions 或 chrome://extensions。

  2. 开启 Developer mode。

  3. 选择 Load unpacked。

  4. 选择项目下的 dist/extension 文件夹。

  5. 打开或刷新目标 SharePoint Online 页面。

扩展需要读取 SharePoint/Graph 请求头,并把短期 token 发送给本机 bridge。首次安装前请确认代码来自你信任的 GitHub 仓库;权限原因见 安全说明。

3. 配置 MCP 客户端

MCP 客户端应启动构建后的 stdio 入口,而不是启动一个对外开放的 HTTP 服务。复制 Windows 配置示例,将路径替换成你的实际项目路径,再合并到客户端的 MCP 配置中。完整说明见 MCP 客户端配置。

Windows 配置的核心内容如下:

{
  "mcpServers": {
    "sharepoint-local": {
      "command": "node",
      "args": ["C:\\path\\to\\sharepoint-mcp\\dist\\server\\index.js"],
      "env": {
        "SHAREPOINT_MCP_DATA_DIR": "C:\\path\\to\\sharepoint-mcp\\data"
      }
    }
  }
}

配置保存后,重启 MCP 客户端。若客户端已经有旧配置,请确认它指向当前项目的 dist/server/index.js。

第一次使用

在 MCP 客户端中按以下顺序执行:

  1. get_health:确认本地服务和 token audience 状态。

  2. list_captured_sites:查看扩展捕获到的 SharePoint 站点。

  3. resolve_site:在有可用 Graph token 或 SharePoint REST token 时解析目标站点。

  4. set_active_site,或在当前标签页已解析成功时使用 set_active_site_from_tab。

  5. get_active_site:再次确认 siteId 和 siteUrl。

  6. 执行读取或写入工具。

每次写入前都要确认 active-site lock;删除、权限、更新和格式化操作必须先使用对应的 preview_* 工具,只能应用刚刚返回的 previewId。扩展弹窗还提供当前站点、连接状态、操作历史和可选的 token 自动刷新开关。

更新、停止和卸载

更新代码后:

git pull
npm install
npm run build

然后在扩展管理页对 dist/extension 点击 Reload,并重启 MCP 客户端。停止 MCP 客户端即可停止 stdio 服务;如果是手动运行 npm start,在对应终端按 Ctrl+C。

卸载时,先从 MCP 客户端删除 sharepoint-local 配置,再从 Chromium 扩展页 Remove。data/ 目录是本地会话和历史状态;如不再需要,可在确认备份后手动删除。

项目结构

extension/       Chromium MV3 扩展源码
server/          stdio MCP 服务、bridge、SharePoint API clients 和安全策略
scripts/         构建、诊断和真实站点测试脚本
tests/           单元测试和契约测试
skills/          SharePoint MCP 的安全使用说明与工具目录
docs/            面向用户和维护者的说明
examples/        MCP 客户端配置模板
data/            本地运行时数据(不会提交)
dist/            构建产物(不会提交)

Token、API 和本地数据

扩展只把浏览器当前捕获的 SharePoint 和 Graph bearer token 发给本机 bridge。token 会保存在本地运行时状态的 data/session.json 中;data/token-audit.json 和操作历史会去除 token 值,但整个 data/ 目录仍应按敏感数据处理,不能提交到 GitHub。

列表、列表项、列和现代页面优先使用 Graph token;在适用场景下可回退到 SharePoint REST v2。Drive/文件仍然只使用 Graph。站点组、权限、视图和格式化使用 SharePoint REST。SharePoint REST token 不会被冒充成 Graph token。

bridge 必须保持在 127.0.0.1,不要把端口转发、绑定到 0.0.0.0,也不要将 token 写入日志、Issue、截图或配置文件。

检查与真实站点测试

本地提交前运行:

npm run check

该命令包含 TypeScript 类型检查、测试和构建。真实站点脚本只用于维护者验证,会在 CN_BX_Site 创建带时间戳的持久测试对象,必须先获得明确的网站所有者批准:

$env:SHAREPOINT_MCP_REAL_SITE_SMOKE = 'true'
npm run test:real-site-list

Gallery 测试还需要明确批准的 SHAREPOINT_MCP_LIST_ID 和 SHAREPOINT_MCP_VIEW_ID。持久化 JSON 不等于 UI 已正确渲染,必须同时做 API readback 和 SharePoint UI 检查。

完整文档

Current Limits

  • SharePoint Server、租户管理、Microsoft 365 group administration、classic ASPX、custom SPFx 和 unattended authentication 不支持。

  • Modern-page 支持限制为 list、get、create、layout preview/apply 和 publish;不提供 page deletion 或 WebPart CRUD。

  • Gallery JSON formatting 可以持久化为 view property,但必须在 SharePoint UI 中确认实际渲染效果。


English

A local MCP project that can be downloaded from GitHub. The Chromium extension captures session context from a signed-in SharePoint Online page, while the Node.js MCP server exposes supervised SharePoint operations through Microsoft Graph and SharePoint REST.

The project does not require an Entra app registration and does not upload tokens to the cloud. The MCP server, HTTP bridge, and runtime data run locally; the bridge listens only on http://127.0.0.1:17374.

Who is this for?

  • Users who want to operate SharePoint Online from Claude Desktop, Cursor, VS Code, or another stdio-compatible MCP client.

  • Teams that need to read or maintain lists, list items, view formatting, permissions, site groups, modern pages, and document-library files.

  • Users who accept the local workflow of browser sign-in, a Chromium extension, and a local MCP server.

SharePoint Server (on-premises), tenant administration, unattended authentication, and arbitrary SPFx/DOM editing are out of scope.

5-minute installation

1. Download and build

On GitHub, choose Code → Download ZIP and extract it to a stable directory, or clone the repository with git clone. You need Node.js 20 or newer, plus Chrome or Edge.

From the project directory, run:

npm install
npm run build
npm run doctor

npm run build creates dist/server/index.js and dist/extension. Do not load the source directory directly; the extension must be loaded from the built directory.

2. Load the Chromium extension

  1. Open edge://extensions or chrome://extensions.

  2. Enable Developer mode.

  3. Choose Load unpacked.

  4. Select the project’s dist/extension folder.

  5. Open or refresh the target SharePoint Online page.

The extension reads SharePoint/Graph request headers and sends short-lived tokens to the local bridge. Before installing, make sure the code comes from a GitHub repository you trust; see Security for the permission rationale.

3. Configure the MCP client

Your MCP client should launch the built stdio entry point, not an externally exposed HTTP service. Copy the Windows configuration example, replace the paths with your actual project path, and merge it into the client’s MCP configuration. See MCP client configuration for the full guide.

The essential Windows configuration is:

{
  "mcpServers": {
    "sharepoint-local": {
      "command": "node",
      "args": ["C:\\path\\to\\sharepoint-mcp\\dist\\server\\index.js"],
      "env": {
        "SHAREPOINT_MCP_DATA_DIR": "C:\\path\\to\\sharepoint-mcp\\data"
      }
    }
  }
}

Save the configuration and restart the MCP client. If an older server entry already exists, make sure it points to the current project’s dist/server/index.js.

First use

Run these steps in your MCP client:

  1. get_health: confirm the local service and token-audience status.

  2. list_captured_sites: review the SharePoint sites captured by the extension.

  3. resolve_site: resolve the target site when a usable Graph or SharePoint REST token is available.

  4. set_active_site, or set_active_site_from_tab when the current tab has already been resolved.

  5. get_active_site: confirm the siteId and siteUrl again.

  6. Run the required read or write tool.

Confirm the active-site lock before every write. Deletes, permission changes, updates, and formatting changes must use the matching preview_* tool first and apply only the returned previewId. The extension popup also shows the current site, connection state, operation history, and an optional automatic token-refresh setting.

Update, stop, and uninstall

After updating the source:

git pull
npm install
npm run build

Click Reload for dist/extension in the extension-management page and restart the MCP client. Stopping the MCP client stops the stdio service; if you started it manually with npm start, press Ctrl+C in that terminal.

To uninstall, remove the sharepoint-local entry from the MCP client first, then click Remove on the Chromium extension page. The data/ directory contains local session and history state; if it is no longer needed, delete it manually after confirming that no backup is required.

Project structure

extension/       Chromium MV3 extension source
server/          stdio MCP server, bridge, SharePoint API clients, and safety rules
scripts/         build, diagnostics, and real-site test scripts
tests/           unit and contract tests
skills/          SharePoint MCP safety guidance and tool catalog
docs/            user and maintainer documentation
examples/        MCP client configuration templates
data/            local runtime data (not committed)
dist/            build output (not committed)

Tokens, APIs, and local data

The extension sends captured SharePoint and Graph bearer tokens only to the local bridge. Tokens are stored in the local runtime state file data/session.json; data/token-audit.json and operation history remove token values, but the entire data/ directory must still be treated as sensitive and must not be committed to GitHub.

Lists, list items, columns, and modern pages prefer a Graph token and can fall back to SharePoint REST v2 where applicable. Drives and files remain Graph-only. Site groups, permissions, views, and formatting use SharePoint REST. A SharePoint REST token is never used as a Graph token.

Keep the bridge bound to 127.0.0.1. Do not forward the port, bind it to 0.0.0.0, or write tokens to logs, issues, screenshots, or configuration files.

Checks and real-site tests

Run this before submitting local changes:

npm run check

This runs TypeScript type checking, tests, and the build. Real-site scripts are for maintainers only. They create timestamped persistent test objects in CN_BX_Site and require explicit approval from the site owner:

$env:SHAREPOINT_MCP_REAL_SITE_SMOKE = 'true'
npm run test:real-site-list

The Gallery test also requires explicitly approved SHAREPOINT_MCP_LIST_ID and SHAREPOINT_MCP_VIEW_ID values. Persisted JSON is not proof that the UI rendered correctly; verify both API readback and the SharePoint UI.

Full documentation

Current limits

  • SharePoint Server, tenant administration, Microsoft 365 group administration, classic ASPX, custom SPFx, and unattended authentication are unsupported.

  • Modern-page support is limited to list, get, create, layout preview/apply, and publish; page deletion and WebPart CRUD are not available.

  • Gallery JSON formatting can be persisted as a view property, but the rendered result must be confirmed in the SharePoint UI.

Available Tools

75 tools
add_group_userA

Add a user to a non-default group after explicit confirmation.

Inputs: userId (required), confirm (required), groupId (required).

apply_column_formatting_updateA

Apply a previously previewed column formatting update.

Inputs: previewId (required).

apply_column_updateA

Apply a previously previewed column update.

Inputs: previewId (required).

apply_group_updateB

Apply a previewed site group update.

Inputs: previewId (required).

apply_item_updateA

Apply a previously previewed item update.

Inputs: previewId (required).

apply_list_item_permission_updateB

Apply previewed permission changes to one list item.

Inputs: previewId (required).

apply_list_permission_updateB

Apply previewed list permission changes.

Inputs: previewId (required).

apply_list_updateC

Apply a previously previewed list update.

Inputs: previewId (required).

apply_page_layout_updateB

Apply a previewed page canvas layout update, preferring SharePoint REST by default.

Inputs: previewId (required), preferApi.

apply_view_formatting_updateA

Apply a previously previewed view formatting update.

Inputs: previewId (required).

apply_view_updateB

Apply a previously previewed view update.

Inputs: previewId (required).

copy_drive_itemC

Copy a drive item.

Inputs: itemId (required), driveId (required), parentId (required).

create_columnC

Create a column in a SharePoint list.

Inputs: listId (required), definition (required).

create_folderC

Create a drive folder.

Inputs: name (required), driveId (required), parentId (required).

create_groupC

Create a SharePoint site group.

Inputs: definition (required).

create_itemC

Create an item in a SharePoint list.

Inputs: fields (required), listId (required).

create_listC

Create a list in the active SharePoint site.

Inputs: definition (required).

create_pageC

Create a modern page, preferring SharePoint REST by default.

Inputs: definition (required), preferApi.

create_viewC

Create a view in a SharePoint list.

Inputs: listId (required), definition (required).

delete_columnA

Delete a column using a valid preview.

Inputs: previewId (required).

delete_drive_itemC

Delete a previewed drive item.

Inputs: previewId (required).

delete_groupA

Delete a non-default site group with explicit confirmation.

Inputs: confirm (required), groupId (required).

delete_itemB

Delete a list item using a valid preview.

Inputs: previewId (required).

delete_listA

Delete a list using a valid preview.

Inputs: previewId (required).

delete_viewB

Delete a view using a valid preview.

Inputs: previewId (required).

download_file_metadataC

Get Drive item metadata.

Inputs: itemId (required), driveId (required).

ensure_site_userD

Ensure a site user exists.

Inputs: logonName (required).

get_active_siteB

Return the explicitly locked active SharePoint site.

Inputs: no named parameters.

get_column_formattingC

Get JSON formatting for a SharePoint list column.

Inputs: listId (required), columnId (required).

get_contextA

Return active site, captured sites, and session health.

Inputs: no named parameters.

get_groupC

Get a SharePoint site group.

Inputs: groupId (required).

get_healthA

Return SharePoint MCP bridge and session health.

Inputs: no named parameters.

get_itemC

Get a SharePoint list item and its fields.

Inputs: itemId (required), listId (required).

get_listC

Get a list from the active SharePoint site.

Inputs: listId (required).

get_list_item_permissionsA

Get role assignments for one list item.

Inputs: itemId (required), listId (required).

get_list_permissionsB

Get role assignments for a list.

Inputs: listId (required).

get_pageC

Get a modern page.

Inputs: pageId (required).

get_view_formattingB

Get JSON formatting for a SharePoint list view.

Inputs: listId (required), viewId (required).

list_captured_sitesA

List SharePoint Online sites captured from open browser tabs.

Inputs: no named parameters.

list_columnsB

List columns in a SharePoint list.

Inputs: listId (required).

list_drive_itemsC

List drive items.

Inputs: driveId (required), itemId.

list_drivesA

List site drives.

Inputs: no named parameters.

list_groupsA

List SharePoint site groups.

Inputs: no named parameters.

list_group_usersC

List users in a site group.

Inputs: groupId (required).

list_itemsC

List items and fields in a SharePoint list.

Inputs: listId (required).

list_listsA

List lists in the active SharePoint site.

Inputs: no named parameters.

list_operation_historyA

List local MCP tool calls, including successes and failures. Token values and file content are redacted.

Inputs: limit.

list_pagesB

List modern pages.

Inputs: no named parameters.

list_recycle_binA

List site recycle-bin items.

Inputs: no named parameters.

list_role_definitionsB

List SharePoint role definitions.

Inputs: no named parameters.

list_viewsB

List views in a SharePoint list.

Inputs: listId (required).

move_drive_itemC

Move a drive item.

Inputs: itemId (required), driveId (required), parentId (required).

preview_column_formatting_updateC

Preview updating column JSON formatting.

Inputs: listId (required), columnId (required), formatting (required).

preview_column_updateC

Preview updating a SharePoint list column.

Inputs: listId (required), updates (required), columnId (required).

preview_delete_columnB

Preview deleting a SharePoint list column.

Inputs: listId (required), columnId (required).

preview_delete_drive_itemC

Preview deleting a drive item.

Inputs: name (required), itemId (required), driveId (required).

preview_delete_itemC

Preview deleting a list item.

Inputs: itemId (required), listId (required).

preview_delete_listD

Preview deleting a list.

Inputs: listId (required).

preview_delete_viewC

Preview deleting a SharePoint list view.

Inputs: listId (required), viewId (required).

preview_group_updateC

Preview a site group update.

Inputs: groupId (required), updates (required).

preview_item_updateC

Preview a list item field update.

Inputs: fields (required), itemId (required), listId (required).

preview_list_item_permission_updateB

Preview high-risk permission changes for one list item.

Inputs: itemId (required), listId (required), changes (required).

preview_list_permission_updateC

Preview high-risk list permission changes.

Inputs: listId (required), changes (required).

preview_list_updateD

Preview a list update.

Inputs: listId (required), updates (required).

preview_page_layout_updateC

Preview a page canvas layout update.

Inputs: pageId (required), afterCanvas (required).

preview_view_formatting_updateD

Preview updating view JSON formatting.

Inputs: listId (required), viewId (required), formatting (required).

preview_view_updateC

Preview updating a SharePoint list view.

Inputs: listId (required), viewId (required), updates (required).

publish_pageC

Publish a modern page.

Inputs: pageId (required).

remove_group_userA

Remove a user from a non-default group after explicit confirmation.

Inputs: userId (required), confirm (required), groupId (required).

reset_list_permission_inheritanceB

Reset list permission inheritance after explicit confirmation.

Inputs: listId (required), confirm (required).

resolve_siteA

Resolve a SharePoint Online URL through Graph or SharePoint REST without changing the active site.

Inputs: siteUrl (required).

search_site_usersC

Search site users by title.

Inputs: query (required).

set_active_siteC

Lock the MCP to a specific SharePoint Online site.

Inputs: siteId (required), siteUrl (required), title, hostname.

set_active_site_from_tabA

Lock the MCP to the currently captured SharePoint browser tab.

Inputs: no named parameters.

upload_fileB

Upload a base64-encoded file to a Drive folder.

Inputs: driveId (required), fileName (required), parentId (required), contentBase64 (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 75 tools

    Disambiguation4/5

    Tools are generally distinct by resource and action, with clear naming like list_lists vs get_list, and preview/apply pairs clearly separated. The large number of similar preview/apply operations across different resources (lists, items, columns, views, permissions, groups, pages) could cause some confusion, but descriptions and naming help disambiguate.

    Naming Consistency4/5

    The majority of tool names follow a consistent verb_noun snake_case pattern (e.g., list_items, create_column, apply_view_update). Minor deviations such as 'download_file_metadata' and 'ensure_site_user' break the pure verb_noun flow but are still readable and predictable. Overall the pattern is strong.

    Tool Count2/5

    With 75 tools, the count is well above the 25+ threshold, making the surface feel heavy. Many tools exist as preview/apply pairs, effectively doubling the count for a single logical operation. While the domain is broad, the tool count is excessive and could overwhelm agents.

    Completeness4/5

    The tool set covers CRUD for lists, items, columns, views, groups, and drives, plus permissions, pages, formatting, and site management. Minor gaps exist such as no page deletion, no drive file content download, and no site creation, but these are workable and do not force dead ends in typical workflows.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      F
      maintenance
      MCP server that provides read access to Microsoft Loop workspaces and pages by reusing your Loop web session, enabling listing, reading, and searching across Loop content without app registration.
      8
      18 npm
      3
      MIT
    • F
      license
      B
      quality
      C
      maintenance
      A MCP server based on Patchright that enables browser automation with session inheritance from local Chrome/Edge/Chromium browsers, including cross-platform cookie decryption.
      6
      3
      -