FM

ftaricano/mcp-onedrive-sharepoint

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

8 stars 9 forks 品質 81 トレンド 36MIT

MCP server and CLI for OneDrive and SharePoint document libraries via Microsoft Graph, with app-only auth and a small default tool set

概要

Give AI agents (over MCP) and shell scripts (through the ods CLI) access to OneDrive and SharePoint document libraries via Microsoft Graph, with app-only authentication and a small default tool set. Real CLI output against a mocked Microsoft Graph with fictional data (the Acme site on contoso.sharepoint.com). - the MCP server and the CLI share the same tools, auth and handlers. - the core profile has 10 everyday tools; delete, share, permission, list-item and raw Graph tools are opt-in. - request URLs are checked against https://graph.microsoft.com before the token is attached, and local file access is confined to one root directory. - tool results are JSON, so jq and friends just work. You need Node.js 20+ and a Microsoft Entra ID app registration with the Files.ReadWrite.All and Sites.ReadWrite.All Application permissions and admin consent (see Requirements). Prefer injecting the secret from your secret manager over typing it into the shell.

README

以下は原文 README の抜粋です。原文を見る。

MCP OneDrive/SharePoint Server

Give AI agents (over MCP) and shell scripts (through the ods CLI) access to OneDrive and SharePoint document libraries via Microsoft Graph, with app-only authentication and a small default tool set.

Real CLI output against a mocked Microsoft Graph with fictional data (the Acme site on contoso.sharepoint.com).

  • One core, two front ends: the MCP server and the CLI share the same tools, auth and handlers.
  • Small default surface: the core profile has 10 everyday tools; delete, share, permission, list-item and raw Graph tools are opt-in.
  • Guarded requests: request URLs are checked against https://graph.microsoft.com before the token is attached, and local file access is confined to one root directory.
  • Script friendly: tool results are JSON, so jq and friends just work.

Quickstart

You need Node.js 20+ and a Microsoft Entra ID app registration with the Files.ReadWrite.All and Sites.ReadWrite.All Application permissions and admin consent (see Requirements).

git clone https://github.com/ftaricano/mcp-onedrive-sharepoint.git
cd mcp-onedrive-sharepoint
npm ci && npm run build
export MICROSOFT_GRAPH_TENANT_ID=
export MICROSOFT_GRAPH_CLIENT_ID=
export MICROSOFT_GRAPH_CLIENT_SECRET=
node build/cli.js list
node build/cli.js list_files --siteUrl=https://contoso.sharepoint.com/sites/Docs --path=/

Prefer injecting the secret from your secret manager over typing it into the shell. To use the MCP server, point your MCP client at node /absolute/path/to/mcp-onedrive-sharepoint/build/index.js with the same three variables in its environment (see MCP stdio snippet).

Example

List a folder of a SharePoint site and keep only the fields you need:

node build/cli.js list_files --siteUrl=https://contoso.sharepoint.com/sites/Acme --path=/Reports \
  | jq -c '.items[] | {name, type, size}'
{"name":"2026-Q2","type":"folder","size":0}
{"name":"Quarterly report Q1.pdf","type":"file","size":482133}
{"name":"Sales pipeline.xlsx","type":"file","size":91520}
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "sharepoint": { "command": "node", "args": ["/absolute/path/to/mcp-onedrive-sharepoint/build/index.js"], "env": { "MICROSOFT_GRAPH_TENANT_ID": "<tenant-uuid>", "MICROSOFT_GRAPH_CLIENT_ID": "<application-client-id>", "MICROSOFT_GRAPH_CLIENT_SECRET": "<client-secret>" } } } }