这是一个轻量级的MCP服务器,可与Microsoft SharePoint实现无缝集成,让MCP客户端能与文档、文件夹及其他SharePoint资源进行交互。该项目由sofias tech开发。
pip install -e .
或者在发布到PyPI后安装:
pip install mcp-sharepoint-server
使用uv:
uv pip install mcp-sharepoint-server
要与Claude Desktop集成,需更新配置文件:
%APPDATA%/Claude/claude_desktop_config.json~/Library/Application\ Support/Claude/claude_desktop_config.json"mcpServers": {
"sharepoint": {
"command": "mcp-sharepoint",
"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_DOC_LIBRARY": "Documents"
}
}
}
您还能通过以下环境变量进行额外配置:
SHP_API_VERSION:指定使用的SharePoint API版本(默认: "v1.0")SHP_AUTH_TYPE:指定身份验证类型(支持"AzureAD"和"Guest",默认: "AzureAD")此服务器通过Model Context Protocol (MCP) 提供对SharePoint资源的简洁接口,且针对文档管理进行了操作优化。
该服务器实现了以下工具:
List_SharePoint_Folders:列出指定目录或根目录下的所有文件夹List_SharePoint_Documents:获取指定文件夹内的所有文档Get_Document_Content:检索文档的内容(作为文本或Base64编码的二进制)Create_Folder:在指定目录或根目录下创建新文件夹Upload_Document:上传新文档到指定文件夹Update_Document:更新现有文档的内容Delete_Document:从指定文件夹中删除文档Delete_Folder:删除空的SharePoint文件夹该服务器以资源效率为设计理念:
服务器需要以下环境变量:
SHP_ID_APP:您的Azure AD应用程序客户端IDSHP_ID_APP_SECRET:您的Azure AD应用程序客户端秘密SHP_SITE_URL:您的SharePoint站点URLSHP_DOC_LIBRARY:文档库的路径(默认: "Shared Documents/mcp_server")SHP_TENANT_ID:您的Microsoft租户ID使用pip安装所需库:
pip install -r requirements.txt
git clone https://github.com/yourusername/mcp-sharepoint.git
cd mcp-sharepoint
python -m mcp_sharepoint
此项目根据MIT License授权,详情请参阅LICENSE文件。版权所有 (c) 2025 sofias tech。