SharePoint MCP Server

io.github.ravikant1918由 GitHub 账号 ravikant1918 发布v1.1.1更新于 Oct 27, 2026

MCP server for Microsoft SharePoint — manage folders, documents, and metadata.

已验证STDIO仅桌面文件与存储知识与记忆

概览

AI 生成的概览

本地运行的 MCP 服务器,将 AI 助手连接到单个 Microsoft SharePoint 站点,用于浏览文件夹、读写文档和编辑元数据。

可以做什么
  • 列出文件夹与文件、获取完整递归目录树、创建文件夹并删除空文件夹
  • 使用 KQL 搜索文档,并读取 PDF、Word、Excel、文本等文件的解析内容
  • 以字符串、Base64 或本地路径上传文件,覆盖已有内容、下载文件并删除文档
  • 读取和更新 SharePoint 列表项元数据字段
适用场景
当助手需要直接处理公司 SharePoint 站点中已有的文档时适用,例如总结报告、翻译后回存文件,或按文件夹和搜索查找文档,而不必手动粘贴内容。
运行要求
以本地 Python 包(pip 或 uvx)或 Docker 运行;默认 stdio,可选 HTTP 传输。需要注册 Azure AD 应用并授予 SharePoint API 权限(必要时需管理员同意),并设置环境变量 SHP_ID_APP、SHP_ID_APP_SECRET、SHP_TENANT_ID 和 SHP_SITE_URL。每个实例只连接一个站点;可用 SHP_DOC_LIBRARY 限定到子文件夹。
安装前请注意
需要 Azure AD 客户端密钥 SHP_ID_APP_SECRET,它代表该应用的 SharePoint 访问权限,须妥善保管。相关工具可上传、覆盖、永久删除文档并修改元数据,助手操作会改动真实站点内容。未设置 SHP_DOC_LIBRARY 时默认作用于整个文档库根目录。HTTP 传输默认绑定 0.0.0.0,应限制暴露范围。

安装

在 SourceWeft 中

  1. 打开 控制台中的 SharePoint MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

🗂️ sharepoint-mcp

The MCP Server that gives your AI agent a brain for Microsoft SharePoint

[CI] [PyPI version] [Python] [License: MIT] [Docker] [MCP]

A production-grade Model Context Protocol (MCP) server for Microsoft SharePoint.
Connect Claude Desktop, VS Code Copilot, Cursor, Continue, or any MCP-compatible AI agent
to your SharePoint — read files, manage folders, and reason over your organisation's knowledge.

📚 Docs · 🗺️ Roadmap · 🐛 Bugs · 💡 Features


📑 Table of Contents


🧠 Why sharepoint-mcp?

Most AI agents only know what's in their training data.
sharepoint-mcp gives your agent live access to your organisation's real knowledge.

Without sharepoint-mcpWith sharepoint-mcp
🤷 Agent guesses or hallucinatesAgent reads the actual document
📋 You copy-paste content manuallyAgent fetches files automatically
🔒 Knowledge locked in SharePointKnowledge flows into your AI workflow
🐌 Static, one-shot answersAgent reasons, rewrites, and saves back

🚀 What Your Agent Can Do

📖 Understand Any Document

You: "Summarise the Q3 report in the Finance folder"Agent: → Get_Document_Content("Finance", "Q3_Report.pdf")       → Reads full extracted text       → Returns a sharp, accurate summary

✏️ Read → Reason → Write

You: "Translate the proposal to French and save it"Agent: → Get_Document_Content → translate → Upload_Document

🗂️ Navigate Your Library

You: "What files are in the Legal/Contracts folder?"Agent: → List_SharePoint_Documents("Legal/Contracts")

📊 Supported File Formats

📄 Format🤖 What the Agent Gets
PDFFull text from every page
Word .docx .docComplete document content
Excel .xlsx .xlsAll sheets as structured text
Text, JSON, Markdown, HTML, YAML, PythonRaw content as-is
Images, ZIP, binariesFile type + Base64

✨ Features

FeatureDescription
🔀Dual API SupportChoose Office365 REST or Microsoft Graph API
📁Folder ManagementList, create, delete, get full recursive tree
📄Document ManagementUpload, download, update, delete, search, read content
🏷️Metadata ManagementRead and update SharePoint list-item fields
🔍Smart ParsingAuto-detects PDF / Word / Excel / text
🔎KQL SearchNative SharePoint KQL search for semantic file finding
📂Flexible Library ScopeScope to a subfolder or access the entire library root
🔁Auto-RetryExponential backoff on SharePoint 429/503 throttling
🚀Dual Transportstdio for desktop · http for Docker/remote
🪵Structured LoggingJSON in production · coloured console in dev
🐳Docker-ReadySingle command: docker compose up -d
🛡️Non-Root ContainerRuns as unprivileged user inside Docker
🩺Health CheckLive /health endpoint with real SharePoint check
🤖CI/CDTested on Python 3.10 · 3.11 · 3.12 · 3.13

⚡ Quickstart

1️⃣ Install

bash
pip install sharepoint-mcp

Or from source:

bash
git clone https://github.com/ravikant1918/sharepoint-mcp.gitcd sharepoint-mcp && pip install -e .

2️⃣ Configure

bash
cp .env.example .env# Open .env and fill in your Azure AD credentials
env
SHP_ID_APP=your-azure-app-client-idSHP_ID_APP_SECRET=your-azure-app-secretSHP_TENANT_ID=your-tenant-idSHP_SITE_URL=https://your-tenant.sharepoint.com/sites/your-siteSHP_API_TYPE=office365   # or "graph" / "graphql" for Microsoft Graph API

🔑 New to Azure AD? Follow the step-by-step guide →
🔀 Choose Your API: SharePoint MCP supports both Office365 REST API (default) and Microsoft Graph API. See API Configuration Guide →

Optional: Scope to a subfolder

By default, the server accesses your entire document library root. To restrict operations to a specific subfolder:

env
# Only operate within this subfolder (omit for full library access)SHP_DOC_LIBRARY=mcp_server
# Library name (only needed if your org renamed "Shared Documents")# Graph API auto-detects the default drive — this is only for Office365 REST API# SHP_LIBRARY_NAME=Shared Documents

3️⃣ Run

bash
# 🔍 Interactive testing with MCP Inspectornpx @modelcontextprotocol/inspector -- sharepoint-mcp
# ▶️ Run directlysharepoint-mcp

🐳 Docker

The fastest way to deploy for remote or cloud use.

📋 Usage Scenarios

Scenario A: Pull Latest Version from DockerHub (Recommended)

Use this for production deployments with the latest stable release:

bash
# Step 1: Clone repositorygit clone https://github.com/ravikant1918/sharepoint-mcp.gitcd sharepoint-mcp
# Step 2: Create .env file with your SharePoint credentialscp .env.example .env# Edit .env and fill in:# SHP_ID_APP=your-app-id# SHP_ID_APP_SECRET=your-secret# SHP_TENANT_ID=your-tenant-id# SHP_SITE_URL=https://yourcompany.sharepoint.com/sites/yoursite
# Step 3: Start container (pulls from DockerHub automatically)docker compose up -d
# Step 4: Verify it's runningdocker compose pscurl http://localhost:8000/health
# View logsdocker compose logs -f
# Stop containerdocker compose down

What happens: Pulls ravikant1918/sharepoint-mcp:latest from DockerHub with automatic architecture detection (Intel/ARM).


Scenario B: Use Specific Version

Lock to a specific version for stability or testing:

bash
# Step 1: Set version via environment variableSHAREPOINT_MCP_VERSION=v1.0.1 docker compose up -d
# Or add to .env fileecho "SHAREPOINT_MCP_VERSION=v1.0.1" >> .envdocker compose up -d

What happens: Pulls ravikant1918/sharepoint-mcp:v1.0.1 instead of latest.


Scenario C: Build Locally from Source

Use this for development or when you've made local code changes:

bash
# Step 1: Clone and setupgit clone https://github.com/ravikant1918/sharepoint-mcp.gitcd sharepoint-mcpcp .env.example .env# Edit .env with your credentials
# Step 2: Build from local Dockerfile and startdocker compose up -d --build
# Step 3: Rebuild after code changesdocker compose downdocker compose up -d --build

What happens: Builds image from local Dockerfile, tags as ravikant1918/sharepoint-mcp:latest, and starts container.


Scenario D: Use Custom Image/Fork

If you've forked the repo and published to your own DockerHub:

bash
# Use your custom imageSHAREPOINT_MCP_IMAGE=myusername/sharepoint-mcp \SHAREPOINT_MCP_VERSION=dev \docker compose up -d
# Or add to .envecho "SHAREPOINT_MCP_IMAGE=myusername/sharepoint-mcp" >> .envecho "SHAREPOINT_MCP_VERSION=dev" >> .envdocker compose up -d

What happens: Pulls from your custom registry/repository.


🔧 Common Commands

bash
# Start in detached modedocker compose up -d
# Start with live logsdocker compose up
# View logsdocker compose logs -f
# Stop containerdocker compose down
# Restart containerdocker compose restart
# Pull latest imagedocker compose pull
# Rebuild and restartdocker compose up -d --build
# Remove everything (including volumes)docker compose down -v

Using Podman? Just replace docker with podman — fully compatible.

Docker Environment Variables

VariableDefaultDescription
TRANSPORThttpstdio or http
HTTP_HOST0.0.0.0Bind address
HTTP_PORT8000Port
LOG_FORMATjsonjson or console

🔌 Transport Modes

ModeBest ForSet With
stdioClaude Desktop, Cursor, MCP InspectorTRANSPORT=stdio (default)
httpDocker, remote agents, VS Code Copilot, REST clientsTRANSPORT=http

🔗 Integrations

🤖 Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "sharepoint": {      "command": "sharepoint-mcp",      "env": {        "SHP_ID_APP": "your-app-id",        "SHP_ID_APP_SECRET": "your-app-secret",        "SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",        "SHP_TENANT_ID": "your-tenant-id",        "SHP_DOC_LIBRARY": "my-subfolder"      }    }  }}

💡 Omit SHP_DOC_LIBRARY to access the full library root. If your org uses Office365 REST API and renamed the default library, also set SHP_LIBRARY_NAME.

💻 VS Code Copilot (Agent Mode)

  1. Start the server via Docker or TRANSPORT=http sharepoint-mcp
  2. Create .vscode/mcp.json in your workspace:
json
{  "servers": {    "sharepoint": {      "url": "http://localhost:8000/mcp/",      "type": "http"    }  }}
  1. Open Copilot Chat → switch to Agent mode → your 14 SharePoint tools are available.

⚠️ Trailing slash matters — the URL must end with /mcp/ (not /mcp).

⌨️ Cursor / Continue

Add to your MCP config (uses stdio transport):

json
{  "mcpServers": {    "sharepoint": {      "command": "sharepoint-mcp",      "env": {        "SHP_ID_APP": "your-app-id",        "SHP_ID_APP_SECRET": "your-app-secret",        "SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",        "SHP_TENANT_ID": "your-tenant-id"      }    }  }}

🛠️ All 14 Tools

📁 Folder Management

ToolWhat It Does
List_SharePoint_Folders📋 List all sub-folders in a directory
Get_SharePoint_Tree🌳 Get full recursive folder + file tree
Create_Folder➕ Create a new folder
Delete_Folder🗑️ Delete an empty folder

📄 Document Management

ToolWhat It Does
List_SharePoint_Documents📋 List all files with metadata
Search_SharePoint🔎 Search documents using KQL queries
Get_Document_Content📖 Read & parse file content (PDF/Word/Excel/text)
Upload_Document⬆️ Upload file as string or Base64
Upload_Document_From_Path📂 Upload a local file directly
Update_Document✏️ Overwrite existing file content
Delete_Document🗑️ Permanently delete a file
Download_Document⬇️ Download file to local filesystem

🏷️ Metadata Management

ToolWhat It Does
Get_File_Metadata🔍 Get all SharePoint list-item fields
Update_File_Metadata✏️ Update metadata fields

⚙️ Full Configuration Reference

VariableRequiredDefaultDescription
SHP_ID_APP✅Azure AD app client ID
SHP_ID_APP_SECRET✅Azure AD client secret
SHP_TENANT_ID✅Microsoft tenant ID
SHP_SITE_URL✅SharePoint site URL
SHP_API_TYPEoffice365office365, graph, or graphql
SHP_LIBRARY_NAMEShared DocumentsLibrary name (Office365 REST only; Graph auto-detects)
SHP_DOC_LIBRARY(empty = full library)Subfolder scope (e.g. mcp_server). Empty = entire library
SHP_MAX_DEPTH15Max tree depth
SHP_MAX_FOLDERS_PER_LEVEL100Folders per batch
SHP_LEVEL_DELAY0.5Delay (s) between tree levels
TRANSPORTstdiostdio or http
HTTP_HOST0.0.0.0HTTP bind host
HTTP_PORT8000HTTP port
LOG_LEVELINFODEBUG INFO WARNING ERROR
LOG_FORMATconsoleconsole or json

⚠️ Limitations

LimitationDetails
Single siteConnects to one SharePoint site per server instance (multi-site planned for v2.0)
Sync clientUses synchronous SharePoint REST API calls (async client planned for v1.3)
No sharingCannot create sharing links yet (planned for v1.1)
Large filesVery large files may hit memory limits during content extraction
Rate limitsSharePoint throttling (429/503) is handled with auto-retry, but sustained bulk operations may be slow

🔧 Troubleshooting

Authentication Errors

Problem: Missing or invalid SharePoint credentials
Solution: Verify all 4 required environment variables are set:

bash
echo $SHP_ID_APP $SHP_ID_APP_SECRET $SHP_TENANT_ID $SHP_SITE_URL

Connection Issues (HTTP Transport)

Problem: Agent can't connect to the MCP server
Solution:

  1. Ensure the server is running: curl http://localhost:8000/mcp/
  2. Check the URL ends with /mcp/ (trailing slash required)
  3. Verify the port is not blocked by a firewall

Docker Container Unhealthy

Problem: podman ps / docker ps shows (unhealthy)
Solution: Check container logs for errors:

bash
docker logs sharepoint-mcp

Debug Logging

Enable verbose output by setting LOG_LEVEL=DEBUG:

bash
LOG_LEVEL=DEBUG sharepoint-mcp

For Docker, add to your .env file or docker-compose.yml:

env
LOG_LEVEL=DEBUGLOG_FORMAT=console

Permission Errors

Problem: Access denied from SharePoint
Solution:

  1. Verify the Azure AD app has the required API permissions
  2. Ensure admin consent has been granted (if required by your org)
  3. Confirm SHP_SITE_URL points to a site your app has access to

🧪 Development

bash
git clone https://github.com/ravikant1918/sharepoint-mcp.gitcd sharepoint-mcppip install -e ".[dev]"
make test      # run all testsmake inspect   # 🔍 launch MCP Inspectormake check     # quick import sanity checkmake clean     # 🧹 remove caches

📚 Documentation

📄 Doc📝 Description
⚡ Getting StartedFull setup guide
⚙️ ConfigurationAll environment variables
🛠️ Tools ReferenceDetailed tool parameters
🏛️ ArchitectureDesign and layer diagram
🔑 Azure SetupAzure AD app registration guide
🗺️ RoadmapPlanned features
📅 ChangelogVersion history

🤝 Contributing

Contributions are welcome! Please read docs/contributing.md and our Code of Conduct.

  1. 🍴 Fork the repo
  2. 🌿 Create a branch: git checkout -b feat/my-tool
  3. ✅ Add tests: make test
  4. 📬 Open a Pull Request

🔒 Security

Found a vulnerability? Please do not open a public issue.
Report privately via GitHub Security Advisories or see SECURITY.md.


MIT License © 2026 Ravi Kant

⭐ If this project helps you, please star it on GitHub!

来源:README.md,提交 986fcfa

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分