SharePoint MCP Server (Certificate Auth)
A comprehensive MCP Server for seamless integration with Microsoft SharePoint using certificate-based authentication. Enables MCP clients to interact with documents, folders and other SharePoint resources securely without client secrets.
Quick Start
1. Install
Using uvx (recommended):
Or install with uv:
2. Run Interactive Setup
The setup wizard will:
Generate a certificate for authentication
Guide you through Azure configuration
Collect your Azure app details
Ask which AI assistant you use (Claude Desktop, Claude Code, Cursor, Windsurf)
Output an AI-ready prompt that you paste into your assistant to finish configuration
The wizard generates INSTALL_WITH_AI.md - just paste it into your AI assistant and let it configure everything for you!
3. Configure Azure (One-time setup)
Go to Azure Portal → App registrations → New registration
Name it (e.g.,
mcp-sharepoint), click RegisterSave the Application (client) ID and Directory (tenant) ID
Go to Certificates & secrets → Certificates → Upload certificate
Upload the
certs/sharepoint.crtfile generated by the setup command
Go to API permissions → Add permission → SharePoint → Application permissions
Add
Sites.FullControl.All(orSites.ReadWrite.Allfor read/write only)Click Grant admin consent
4. Configure Your AI Assistant
The setup wizard outputs INSTALL_WITH_AI.md - paste this into your AI assistant (Claude, Cursor, etc.) and it will configure the MCP server for you automatically.
Or configure manually - create a .env file:
5. Run (Standalone)
You should see:
Claude Desktop Integration
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Available Tools
The server provides 14 tools for complete SharePoint management:
Folder Management
List_SharePoint_Folders- List folders in a directoryCreate_Folder- Create new foldersDelete_Folder- Delete empty foldersGet_SharePoint_Tree- Get recursive folder structure
Document Management
List_SharePoint_Documents- List documents with metadataGet_Document_Content- Read document content (supports PDF, Word, Excel)Upload_Document- Upload new documents (text or binary)Upload_Document_From_Path- Upload from local filesystemUpdate_Document- Update existing documentsDelete_Document- Remove documentsDownload_Document- Download to local filesystem
Metadata Operations
Get_File_Metadata- Get file metadata fieldsUpdate_File_Metadata- Update file metadata
Content Processing
Intelligent content extraction for common file types:
PDF - Full text extraction via PyMuPDF
Word (.docx) - Paragraphs and tables
Excel (.xlsx) - All sheets, first 50 rows each
Text files - JSON, XML, HTML, MD, code files
Binary - Base64 encoding for other types
Environment Variables
Required
Variable | Description |
| Azure AD application client ID |
| Microsoft tenant ID |
| SharePoint site URL |
| Document library path (default: |
| Path to certificate PEM file |
| Certificate thumbprint (SHA1) |
Optional
Variable | Default | Description |
| 15 | Max folder depth for tree operations |
| 100 | Max folders per level |
| 0.5 | Delay between levels (seconds) |
| 0.1 | Delay between batches (seconds) |
Development
Requirements
Python 3.12+
Setup
Run Locally
Code Quality
Debugging with MCP Inspector
Troubleshooting
"Authentication failed" (401)
Verify certificate is uploaded to Azure AD
Check thumbprint matches
Ensure certificate hasn't expired
"Access denied" (403)
Grant admin consent for API permissions
Verify
Sites.FullControl.AllorSites.ReadWrite.Allis granted
"Site not found" (404)
Check
SHP_SITE_URLis correctVerify site exists and is accessible
License
MIT License - see LICENSE for details.
Copyright (c) 2025 Chieji Mofor