SharePoint MCP Server
Enables AI assistants to manage Microsoft SharePoint documents and folders through natural language, supporting operations like listing, reading, uploading, updating, deleting, and creating Office files.
README
SharePoint MCP Server
MCP Server for Microsoft SharePoint using modern Azure AD (MSAL) authentication.
Prerequisites
Azure AD App Registration
-
Go to Azure Portal → Azure Active Directory → App registrations → New registration
- Name: anything you like
- Supported account types: "Accounts in this organizational directory only"
- Redirect URI: leave empty
-
From the Overview page, note:
- Application (client) ID →
SHP_ID_APP - Directory (tenant) ID →
SHP_TENANT_ID
- Application (client) ID →
-
Certificates & secrets → New client secret
- Save the Value immediately (you won't see it again) →
SHP_ID_APP_SECRET
- Save the Value immediately (you won't see it again) →
-
API permissions → Add a permission → SharePoint → Application permissions
- Add
Sites.ReadWrite.All(orSites.Read.Allfor read-only) - Click Grant admin consent — the status must show a green checkmark
- Add
-
Get your SharePoint site URL (e.g.
https://contoso.sharepoint.com/sites/yoursite) →SHP_SITE_URL- Do NOT include a trailing slash
Security Best Practices
- Use
Sites.Read.Allif you only need read access (principle of least privilege) - Set a calendar reminder to rotate client secrets before expiry
- Never commit
.envfiles to Git — use environment variables or a secrets manager
Installation
pip install mcp-sharepoint-us
Or from source:
git clone https://github.com/mdev26/mcp-sharepoint-us.git
cd mcp-sharepoint-us
pip install -e .
Configuration
# Required
SHP_TENANT_ID=your-tenant-id-guid
SHP_ID_APP=your-client-id-guid
SHP_ID_APP_SECRET=your-client-secret
SHP_SITE_URL=https://your-tenant.sharepoint.com/sites/your-site
# Optional
SHP_DOC_LIBRARY=Shared Documents # default
SHP_AUTH_METHOD=msal # options: msal (default), certificate, legacy
Certificate-based authentication (optional)
SHP_AUTH_METHOD=certificate
SHP_CERT_PATH=/path/to/certificate.pem
SHP_CERT_THUMBPRINT=your-cert-thumbprint
Claude Desktop Integration
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"sharepoint": {
"command": "python",
"args": ["-m", "mcp_sharepoint"],
"env": {
"SHP_TENANT_ID": "your-tenant-id",
"SHP_ID_APP": "your-client-id",
"SHP_ID_APP_SECRET": "your-client-secret",
"SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",
"SHP_AUTH_METHOD": "msal"
}
}
}
}
Using uvx
{
"mcpServers": {
"sharepoint": {
"command": "uvx",
"args": ["mcp-sharepoint-us"],
"env": {
"SHP_TENANT_ID": "your-tenant-id",
"SHP_ID_APP": "your-client-id",
"SHP_ID_APP_SECRET": "your-client-secret",
"SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site"
}
}
}
}
Available Tools
| Tool | Description |
|---|---|
Test_Connection |
Verify authentication and connection |
List_SharePoint_Documents |
List documents in a folder |
Get_Document_Content |
Read document content (supports .docx, .pptx, .xlsx, .pdf) |
Upload_Document |
Upload a new document |
Update_Document |
Update an existing document |
Delete_Document |
Delete a document |
List_SharePoint_Folders |
List folders |
Create_Folder |
Create a new folder |
Delete_Folder |
Delete an empty folder |
Get_SharePoint_Tree |
Get recursive folder structure |
Create_Word_Document |
Create a formatted .docx and upload to SharePoint |
Edit_Word_Document |
Find/replace or section-replace content in a .docx |
Create_PowerPoint |
Create a .pptx and upload to SharePoint |
Troubleshooting
Enable debug logging
LOGLEVEL=DEBUG python -m mcp_sharepoint
"Acquire app-only access token failed"
- Ensure
SHP_TENANT_IDis set and correct (Azure Portal → Azure AD → Overview → Tenant ID) - Ensure
SHP_AUTH_METHOD=msal(or leave unset — msal is the default) - Verify admin consent is granted in Azure Portal (green checkmarks on API permissions)
- After granting permissions, wait 5–10 minutes for propagation
"403 Forbidden" / "Access denied"
- Permissions must be Application permissions, not Delegated
- Admin consent must be granted
- The site URL must exactly match the SharePoint site (no trailing slash)
"Invalid client secret"
- Copy the secret Value, not the secret ID
- Check for extra spaces in your
.envfile - The secret may have expired — create a new one
Connection reset / firewall issues
If authentication succeeds but Graph API calls fail (connection reset during TLS), the endpoint graph.microsoft.us (US Government) or graph.microsoft.com (commercial) may be blocked by a firewall using deep packet inspection. Ask your network team to whitelist the endpoint on port 443. For proxy environments:
export HTTPS_PROXY=http://proxy.company.com:8080
License
MIT License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。