SharePoint MCP Server
SharePoint MCP Server
A Model Context Protocol (MCP) server that provides Claude with access to Microsoft SharePoint via the Microsoft Graph API.
Features
Folder Management: List, create, delete folders and view folder tree structure
Document Operations: Upload, download, read, update, and delete documents
Metadata Support: Get and update file metadata fields
OAuth 2.0 Authentication: Secure user-based authentication via browser flow
Consistent Architecture: Same modular pattern as Outlook MCP for easy maintenance
Related MCP server: SharePoint Online MCP Server
Quick Start
1. Install Dependencies
cd sharepoint-mcp
npm install2. Azure AD Setup
Go to Azure Portal > App registrations > New registration
Name:
sharepoint-mcp(or your preferred name)Supported account types: "Accounts in this organizational directory only"
Redirect URI:
Web>http://localhost:3334/auth/callbackClick Register
After registration:
Copy the Application (client) ID
Copy the Directory (tenant) ID
Go to Certificates & secrets > New client secret
Copy the Value (not the Secret ID!)
Go to API permissions > Add a permission > Microsoft Graph > Delegated permissions
Add:
Sites.ReadWrite.All,Files.ReadWrite.All
Click Grant admin consent (requires admin)
3. Configure Environment
Create a .env file:
SHAREPOINT_CLIENT_ID=your-client-id
SHAREPOINT_CLIENT_SECRET=your-client-secret-value
SHAREPOINT_TENANT_ID=your-tenant-id
SHAREPOINT_SITE_URL=https://your-tenant.sharepoint.com/sites/your-site
SHAREPOINT_DOC_LIBRARY=Shared Documents4. Authenticate
# Start the auth server
npm run auth-server
# Open http://localhost:3334 in your browser and complete authentication5. Run the Server
npm startClaude Desktop Integration
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"sharepoint-assistant": {
"command": "node",
"args": ["/path/to/sharepoint-mcp/index.js"],
"env": {
"SHAREPOINT_CLIENT_ID": "your-client-id",
"SHAREPOINT_CLIENT_SECRET": "your-client-secret",
"SHAREPOINT_TENANT_ID": "your-tenant-id",
"SHAREPOINT_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",
"SHAREPOINT_DOC_LIBRARY": "Shared Documents"
}
}
}
}Available Tools
Authentication
Tool | Description |
| Start the OAuth authentication flow |
| Check current authentication status |
| Clear stored tokens |
Folder Operations
Tool | Description |
| List folders in a directory |
| Create a new folder |
| Delete an empty folder |
| Get recursive folder structure |
Document Operations
Tool | Description |
| List documents in a folder |
| Read document content |
| Upload content as a new document |
| Upload a local file |
| Update an existing document |
| Delete a document |
| Download to local filesystem |
| Get file metadata fields |
| Update metadata fields |
Development
# Run with MCP Inspector for testing
npm run inspect
# Run in test mode (mock data)
npm run test-mode
# Run tests
npm testArchitecture
sharepoint-mcp/
├── index.js # Main MCP server entry point
├── config.js # Configuration settings
├── sharepoint-auth-server.js # OAuth callback server
├── auth/ # Authentication module
│ ├── index.js
│ ├── token-manager.js # Token storage & refresh
│ └── tools.js # Auth tools
├── folder/ # Folder operations
│ ├── index.js
│ └── tools.js
├── document/ # Document operations
│ ├── index.js
│ └── tools.js
└── utils/ # Shared utilities
├── index.js
└── graph-api.js # Graph API clientTroubleshooting
"Authentication required" error
Ensure you've run the auth server and completed browser authentication
Check that tokens are stored in
~/.sharepoint-mcp-tokens.json
"AADSTS7000215" error
You're using the Secret ID instead of the Secret Value
Go back to Azure and copy the actual secret value
"Access denied" error
Ensure admin consent was granted for the API permissions
Verify the site URL is correct
Port 3334 in use
npx kill-port 3334License
MIT
Available Tools
16 toolsauthenticateA
Start the SharePoint authentication process. Returns a URL that the user must open in a browser to authenticate. The auth server must be running first (npm run auth-server).
Inputs: no named parameters.
check_auth_statusB
Check the current SharePoint authentication status
Inputs: no named parameters.
create_folderC
Create a new folder in SharePoint
Inputs: folder_name (required), parent_folder.
delete_documentC
Delete a document from SharePoint
Inputs: file_name (required), folder_path.
delete_folderA
Delete a folder from SharePoint. The folder must be empty.
Inputs: folder_path (required).
download_documentC
Download a document from SharePoint to the local filesystem
Inputs: file_name (required), local_path (required), folder_path.
get_document_contentB
Get the content of a document from SharePoint. Works best with text-based files (txt, json, md, etc).
Inputs: file_name (required), folder_path.
get_file_metadataC
Get metadata fields for a SharePoint file
Inputs: file_name (required), folder_path.
get_folder_treeB
Get a recursive tree view of folders in SharePoint. Useful for understanding folder structure.
Inputs: parent_folder, max_depth.
list_documentsB
List all documents (files) in a specified SharePoint folder. Returns file names, sizes, and metadata.
Inputs: folder_path.
list_foldersB
List all folders in a specified SharePoint directory. Returns folder names, IDs, and metadata.
Inputs: parent_folder.
logoutB
Clear SharePoint authentication tokens and log out
Inputs: no named parameters.
update_documentC
Update an existing document in SharePoint with new content
Inputs: file_name (required), content (required), folder_path, is_base64.
update_file_metadataC
Update metadata fields for a SharePoint file
Inputs: file_name (required), metadata (required), folder_path.
upload_documentC
Upload a new document to SharePoint. For text content, provide the content directly. For binary files, provide base64-encoded content.
Inputs: file_name (required), content (required), folder_path, is_base64.
upload_document_from_pathC
Upload a file from the local filesystem to SharePoint
Inputs: local_path (required), folder_path, new_file_name.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool has a clearly distinct purpose with no significant overlap. For example, list_documents and list_folders handle different resource types, while upload_document and upload_document_from_path offer distinct input methods. The authentication tools (authenticate, check_auth_status, logout) are also well-separated from document/folder operations.
All tool names follow a consistent verb_noun pattern with snake_case throughout. Examples include create_folder, delete_document, get_document_content, and update_file_metadata. This predictability makes it easy for agents to understand and select tools.
With 16 tools, this server provides comprehensive coverage for SharePoint operations without being overwhelming. The count aligns well with the domain's scope, covering authentication, folder management, document CRUD operations, and metadata handling, which is appropriate for a SharePoint integration.
The tool set offers complete CRUD/lifecycle coverage for SharePoint documents and folders, including create, read, update, delete, and list operations. It also handles authentication, metadata management, and file upload/download, leaving no obvious gaps for core SharePoint workflows.
Maintenance
Related MCP Connectors
Give Claude only the Google Drive files you choose. Every action logged.
Give Claude a second brain for your notes, tasks and contacts. OAuth; it can't delete anything.
1Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
Connect Claude to your Platform7n workspaces: chat, links, work and decks. One-click OAuth.
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 gradedqualityDmaintenanceAllows Claude to interact with SharePoint Online using the REST API, enabling users to query site information, lists, and list items through natural language commands.8 npm37MIT
- 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