](https://mseep.ai/app/demodorigatsuo-sharepoint-mcp)
  
SharePoint MCP 服务器
免责声明这个项目与微软公司无任何隶属关系、无任何认可或关联。SharePoint和Microsoft Graph API是微软公司的商标。这是一个独立的、由社区驱动的项目。
SharePoint模型上下文协议(MCP)服务器充当桥梁,使大型语言模型(LLM)应用程序(如Claude)能够访问您SharePoint网站中的内容。借助此项目,您可以使用自然语言查询SharePoint网站中的文档、列表和其他内容。
特点/功能
- 浏览文档库查看SharePoint文档库中的内容
- 访问列表数据检索和操作SharePoint列表数据
- 检索文档内容访问特定文档中的内容
- SharePoint 搜索在整个网站中搜索
- 创建列表项向SharePoint列表中添加新项目
先决条件
- Python 3.10或更高版本
- 访问SharePoint网站
- Microsoft Azure AD 应用程序注册(用于身份验证)
快速入门
按照以下步骤快速启动并运行SharePoint MCP服务器:
- 先决条件
- 确保已安装 Python 3.10 或更高版本 - 一个具有适当权限的Azure AD应用程序(请参阅docs/auth_guide.md)
- 安装
# Install from GitHub
pip install git+https://github.com/DEmodoriGatsuO/sharepoint-mcp.git
# Or install in development mode
git clone https://github.com/DEmodoriGatsuO/sharepoint-mcp.git
cd sharepoint-mcp
pip install -e .- 配置
# Copy the example configuration
cp .env.example .env
# Edit the .env file with your details
nano .env- 运行诊断工具
# Check your configuration
python config_checker.py
# Test authentication
python auth-diagnostic.py- 启动服务器
python server.py安装
- 克隆仓库:
git clone https://github.com/DEmodoriGatsuO/sharepoint-mcp.git
cd sharepoint-mcp- 创建并激活虚拟环境:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- 安装依赖项:
pip install -r requirements.txt- 设置环境变量:
cp .env.example .env
# Edit the .env file with your authentication details配置
- 在 Azure AD 中注册一个应用程序并授予必要的权限(请参阅 docs/auth_guide.md)
- 在(相应位置)配置您的身份验证信息和SharePoint网站URL
.env文件
使用方法/用途
以开发模式运行
mcp dev server.py安装到Claude桌面版
mcp install server.py --name "SharePoint Assistant"直接运行
python server.py高级用法
处理文档内容
# Example of retrieving document content
import requests
# Get document content
response = requests.get(
"http://localhost:8080/sharepoint-mcp/document/Shared%20Documents/report.docx",
headers={"X-MCP-Auth": "your_auth_token"}
)
# Process content
if response.status_code == 200:
document_content = response.json()
print(f"Document name: {document_content['name']}")
print(f"Size: {document_content['size']} bytes")使用 SharePoint 列表
# Example of retrieving list data
import requests
import json
# Get list items
response = requests.get(
"http://localhost:8080/sharepoint-mcp/list/Tasks",
headers={"X-MCP-Auth": "your_auth_token"}
)
# Create a new list item
new_item = {
"Title": "Review quarterly report",
"Status": "Not Started",
"DueDate": "2025-05-01"
}
create_response = requests.post(
"http://localhost:8080/sharepoint-mcp/list/Tasks",
headers={
"X-MCP-Auth": "your_auth_token",
"Content-Type": "application/json"
},
data=json.dumps(new_item)
)与Claude集成
请参阅以下文档 docs/usage.md 翻译为中文是:文档/使用说明.md 以下是关于如何将此服务器与Claude及其他大型语言模型(LLM)应用程序一起使用的详细示例。
监控与故障排除
日志
服务器默认将日志输出到标准输出。设置 DEBUG=True 在你的 .env 启用详细日志记录的文件。
常见问题
- 认证失败跑
python auth-diagnostic.py诊断问题 - 权限错误确保您的 Azure AD 应用程序具有所需的权限
- 代币问题使用
python token-decoder.py分析你的代币的声明/主张
许可证
此项目遵循MIT许可证发布。详情请参见LICENSE文件。
做出贡献
欢迎贡献。在进行重大修改之前,请先提出一个问题以讨论您想要更改的内容。请参阅 \CONTRIBUTING.md\ 翻译成中文是“贡献指南.md”或“如何贡献.md”,其中“md”表示这是Markdown格式的文件 作为指南。
