Skip to main content

SharePoint MCP Server (Certificate Auth)

PyPI version CI codecov Python 3.12+ Ruff License: MIT

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):

uvx mcp-sharepoint-cert

Or install with uv:

uv pip install mcp-sharepoint-cert

2. Run Interactive Setup

uvx mcp-sharepoint-cert-setup

The setup wizard will:

  1. Generate a certificate for authentication
  2. Guide you through Azure configuration
  3. Collect your Azure app details
  4. Ask which AI assistant you use (Claude Desktop, Claude Code, Cursor, Windsurf)
  5. 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)

  1. Go to Azure Portal → App registrations → New registration
  2. Name it (e.g., mcp-sharepoint), click Register
  3. Save the Application (client) ID and Directory (tenant) ID
  4. Go to Certificates & secrets → Certificates → Upload certificate
    • Upload the certs/sharepoint.crt file generated by the setup command
  5. Go to API permissions → Add permission → SharePoint → Application permissions
    • Add Sites.FullControl.All (or Sites.ReadWrite.All for 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:

SHP_ID_APP=your-application-client-id
SHP_TENANT_ID=your-directory-tenant-id
SHP_SITE_URL=https://your-tenant.sharepoint.com/sites/your-site
SHP_DOC_LIBRARY=Shared Documents
SHP_CERT_PATH=certs/sharepoint.pem
SHP_CERT_THUMBPRINT=your-certificate-thumbprint

5. Run (Standalone)

mcp-sharepoint-cert

You should see:

Connected to SharePoint: YourSiteName
MCP server ready - waiting for connections...

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

{
  "mcpServers": {
    "sharepoint": {
      "command": "uvx",
      "args": ["mcp-sharepoint-cert"],
      "env": {
        "SHP_ID_APP": "your-app-id",
        "SHP_TENANT_ID": "your-tenant-id",
        "SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",
        "SHP_DOC_LIBRARY": "Shared Documents",
        "SHP_CERT_PATH": "/path/to/certs/sharepoint.pem",
        "SHP_CERT_THUMBPRINT": "your-thumbprint"
      }
    }
  }
}

Available Tools

The server provides 14 tools for complete SharePoint management:

Folder Management

  • List_SharePoint_Folders - List folders in a directory
  • Create_Folder - Create new folders
  • Delete_Folder - Delete empty folders
  • Get_SharePoint_Tree - Get recursive folder structure

Document Management

  • List_SharePoint_Documents - List documents with metadata
  • Get_Document_Content - Read document content (supports PDF, Word, Excel)
  • Upload_Document - Upload new documents (text or binary)
  • Upload_Document_From_Path - Upload from local filesystem
  • Update_Document - Update existing documents
  • Delete_Document - Remove documents
  • Download_Document - Download to local filesystem

Metadata Operations

  • Get_File_Metadata - Get file metadata fields
  • Update_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
SHP_ID_APP Azure AD application client ID
SHP_TENANT_ID Microsoft tenant ID
SHP_SITE_URL SharePoint site URL
SHP_DOC_LIBRARY Document library path (default: Shared Documents)
SHP_CERT_PATH Path to certificate PEM file
SHP_CERT_THUMBPRINT Certificate thumbprint (SHA1)

Optional

Variable Default Description
SHP_MAX_DEPTH 15 Max folder depth for tree operations
SHP_MAX_FOLDERS_PER_LEVEL 100 Max folders per level
SHP_LEVEL_DELAY 0.5 Delay between levels (seconds)
SHP_BATCH_DELAY 0.1 Delay between batches (seconds)

Development

Requirements

  • Python 3.12+
  • uv

Setup

git clone https://github.com/peacockery-studio/mcp-sharepoint-cert.git
cd mcp-sharepoint-cert
uv sync --group dev

Run Locally

uv run mcp-sharepoint-cert

Code Quality

uv run ruff check src/    # Lint
uv run ruff format src/   # Format
uv run ty check src/      # Type check
uv run pytest             # Tests

Debugging with MCP Inspector

npx @modelcontextprotocol/inspector -- uv run mcp-sharepoint-cert

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.All or Sites.ReadWrite.All is granted

"Site not found" (404)

  • Check SHP_SITE_URL is correct
  • Verify site exists and is accessible

License

MIT License - see LICENSE for details.

Copyright (c) 2025 Chieji Mofor

Metadata

Release files for mcp-sharepoint-cert 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-sharepoint-cert 0.3.0
File Size Uploaded Provenance
mcp_sharepoint_cert-0.3.0.tar.gz 96.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-sharepoint-cert 0.3.0
File Interpreter ABI Platform
mcp_sharepoint_cert-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 118.1 kB

Release files / mcp_sharepoint_cert-0.3.0.tar.gz

Download URL mcp_sharepoint_cert-0.3.0.tar.gz
Size 96.8 kB
Tags Source
SHA-256 checksum
How to use checksums
390d98c8ce713d579b43b477358e9a293a61e65cf84370a853897ab96533a919
BLAKE2b-256 checksum
How to use checksums
89a6a586b1ed54415a8700d7793855878ad7d75dc6ad5198b293ca590c0bf485
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / mcp_sharepoint_cert-0.3.0-py3-none-any.whl

Download URL mcp_sharepoint_cert-0.3.0-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b834307e6e8bbd52c808089fd6f1c6216aa653a575c4fce8101a73653837659b
BLAKE2b-256 checksum
How to use checksums
8d8e6d91e1b8bc02e6cee5ec381fbd63a64228e5bb03cc40bd45e5a1e3da812e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for mcp-sharepoint-cert 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page