SharePoint MCP Server
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_APPDirectory (tenant) ID →
SHP_TENANT_ID
Certificates & secrets → New client secret
Save the Value immediately (you won't see it again) →
SHP_ID_APP_SECRET
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
Get your SharePoint site URL (e.g.
https://contoso.sharepoint.com/sites/yoursite) →SHP_SITE_URLDo 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
Related MCP server: SharePoint MCP Server
Installation
pip install mcp-sharepoint-usOr 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, legacyCertificate-based authentication (optional)
SHP_AUTH_METHOD=certificate
SHP_CERT_PATH=/path/to/certificate.pem
SHP_CERT_THUMBPRINT=your-cert-thumbprintClaude 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 |
| Verify authentication and connection |
| List documents in a folder |
| Read document content (supports .docx, .pptx, .xlsx, .pdf) |
| Upload a new document |
| Update an existing document |
| Delete a document |
| List folders |
| Create a new folder |
| Delete an empty folder |
| Get recursive folder structure |
| Create a formatted .docx and upload to SharePoint |
| Find/replace or section-replace content in a .docx |
| 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
.envfileThe 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:8080License
MIT License
Available Tools
13 toolsCreate_FolderC
Create a new folder in SharePoint
Inputs: folder_path (required), folder_name (required).
Create_PowerPointB
Create a formatted PowerPoint presentation (.pptx) with multiple slide layouts, text boxes, bullet points, images, tables, shapes, and rich formatting. Upload directly to SharePoint.
Inputs: file_name (required), content (required), folder_path.
Create_Word_DocumentA
Create a formatted Word document (.docx) with headings, paragraphs, tables, lists, images, hyperlinks, horizontal rules, and page breaks. Supports rich formatting including colors, highlighting, and spacing. Upload directly to SharePoint.
Inputs: file_name (required), content (required), folder_path.
Delete_DocumentB
Delete a document from SharePoint
Inputs: file_path (required).
Delete_FolderB
Delete an empty folder from SharePoint
Inputs: folder_path (required).
Edit_Word_DocumentA
Edit an existing Word document (.docx) with find/replace operations and SECTION REPLACEMENT for monthly status reports. Preserves all formatting.
SIMPLE REPLACEMENT: Replace individual placeholders ({{company_name}} -> 'Acme Corp')
SECTION REPLACEMENT FOR MONTHLY REPORTS: Replace entire sections (8 bullets, tables) in one operation.
Perfect for monthly status reports where sections need to be updated each month
Use section markers: {{section:name}} ... {{/section:name}}
Replace all content between markers with fresh bullet points or table rows
Preserves formatting and list styles
USE CASES:
Monthly status reports: Replace {{section:status_bullets}} with 8 new status items
Metrics tables: Replace {{section:metrics}} with updated monthly data
Template filling: Replace {{company_name}} and other placeholders with actual values
Inputs: file_path (required), replacements (required), output_file_path.
Get_Document_ContentC
Get the content of a document (supports text extraction from PDF, Word, Excel, and text files)
Inputs: file_path (required).
Test_ConnectionA
Test the SharePoint connection and authentication
Inputs: no named parameters.
Update_DocumentB
Update the content of an existing document
Inputs: file_path (required), content (required), is_binary.
Upload_DocumentC
Upload a new document to SharePoint
Inputs: folder_path (required), file_name (required), content (required), is_binary.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Most tools have distinctly clear purposes, but 'Edit_Word_Document' and 'Update_Document' could be confused (both modify a document), and 'Upload_Document' overlaps partially with 'Create_Word_Document' and 'Create_PowerPoint'. However, detailed descriptions help differentiate them.
Tool names follow a verb_noun pattern, but the nouns vary in specificity (e.g., 'Create_PowerPoint' vs. 'Create_Word_Document', and 'List_SharePoint_Documents' vs. 'Get_Document_Content'). The mix of 'Get_', 'List_', 'Create_', 'Delete_', 'Edit_', 'Update_', 'Upload_', and 'Test_' is acceptable but lacks full consistency.
With 13 tools covering folder and document operations, plus connection testing and tree view, the count is well-scoped for a SharePoint integration. It provides essential functionality without being bloated or too sparse.
The tool set covers CRUD for folders and documents, with specialized creation for Word and PowerPoint. Gaps include inability to delete non-empty folders, lack of rename/move operations, and no search or permission management. These are minor but notable.
Maintenance
Related MCP Connectors
Convert, create and edit Word, PowerPoint, Excel and PDF documents from any AI agent.
Create and manage documents, spreadsheets, and presentations from your AI assistant.
File tools for your AI chat: PDF tables to Excel, merge PDFs, images to PDF, fill PDF forms.
Online office suite for AI agents: edit docs, sheets, slides and PDFs in browser or via MCP.
Related MCP Servers
- AlicenseDqualityDmaintenanceProvides access to organizational Sharepoint documents through the Microsoft Graph API, enabling search and retrieval of Sharepoint content for AI assistants.115 npm21ISC
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Microsoft SharePoint sites, document libraries, and files through the Microsoft Graph API. Supports browsing, searching, uploading/downloading files, managing lists, and creating sharing links with secure OAuth authentication.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables browsing and interacting with Microsoft SharePoint sites and documents through Microsoft Graph API, supporting file search, site listing, document library browsing, and file content retrieval with OAuth2 authentication.56 npm11MIT
- AlicenseAqualityDmaintenanceProvides Claude with access to Microsoft SharePoint via the Microsoft Graph API, enabling folder management, document operations (upload, download, read, update, delete), and metadata management with secure OAuth 2.0 authentication.161MIT