一个全面的MCP服务器,用于与Microsoft SharePoint无缝集成,使MCP客户端能够与文档、文件夹和其他SharePoint资源进行交互。该服务器以高效和易用性为核心,支持文本和二进制文件操作。由Sofias tech开发。
<a href="https://glama.ai/mcp/servers/@Sofias-ai/mcp-sharepoint"> <img width="380" height="200" src="https://gips2.baidu.com/it/u=2848749928,2812171083&fm=3081&app=3081&f=PNG?w=760&h=400" alt="SharePoint Server MCP server" /> </a>此服务器通过模型上下文协议(MCP)提供了一个简洁高效的接口来访问SharePoint资源,并优化了文档管理和内容处理的操作。
服务器实现了10个全面的工具,用于完整的SharePoint管理:
List_SharePoint_Folders: 列出指定目录或根目录下的所有文件夹Create_Folder: 在指定目录下创建新文件夹Delete_Folder: 安全地从SharePoint中删除空文件夹Get_SharePoint_Tree: 获取SharePoint文件夹结构的递归树视图List_SharePoint_Documents: 获取指定文件夹内的所有文档及其元数据Get_Document_Content: 检索并处理文档内容(支持从PDF、Word、Excel中提取文本)Upload_Document: 将新文档上传到指定文件夹(支持文本和二进制内容)Upload_Document_From_Path: 直接从本地文件系统上传大文件Update_Document: 更新现有文档的内容Delete_Document: 从指定文件夹中删除文档服务器包括智能内容提取能力:
服务器设计考虑了资源效率和维护性:
服务器需要以下环境变量:
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租户IDSHP_MAX_DEPTH: 树形操作的最大文件夹深度(默认:15)SHP_MAX_FOLDERS_PER_LEVEL: 每级处理的最大文件夹数(默认:100)SHP_LEVEL_DELAY: 处理各级之间的延迟(秒,默认:0.5)pip install -e .
或者从PyPI安装:
pip install mcp-sharepoint-server
使用uv:
uv pip install mcp-sharepoint-server
要与Claude Desktop集成,请更新配置文件:
Windows: %APPDATA%/Claude/claude_desktop_config.json
macOS: ~/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": "Shared Documents/your-folder",
"SHP_TENANT_ID": "your-tenant-id",
"SHP_MAX_DEPTH": "15",
"SHP_MAX_FOLDERS_PER_LEVEL": "100",
"SHP_LEVEL_DELAY": "0.5"
}
}
}
"mcpServers": {
"sharepoint": {
"command": "uvx",
"args": [
"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": "Shared Documents/your-folder",
"SHP_TENANT_ID": "your-tenant-id",
"SHP_MAX_DEPTH": "15",
"SHP_MAX_FOLDERS_PER_LEVEL": "100",
"SHP_LEVEL_DELAY": "0.5"
}
}
}
requirements.txt 和 pyproject.toml 中列出的依赖项python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
.env文件,包含您的SharePoint凭据:
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=Shared Documents/your-folder
SHP_TENANT_ID=your-tenant-id
python -m mcp_sharepoint
对于调试MCP服务器,您可以使用MCP Inspector:
npx @modelcontextprotocol/inspector -- python -m mcp_sharepoint
本项目采用MIT许可证 - 查看LICENSE文件获取详情。
版权所有 © 2025 sofias tech