Skip to main content

Production-grade MCP Server for Microsoft SharePoint โ€” manage folders, documents, and metadata with any MCP-compatible AI agent.

Project description

๐Ÿ—‚๏ธ sharepoint-mcp

The MCP Server that gives your AI agent a brain for Microsoft SharePoint

CI PyPI version Python License: MIT Docker MCP

A production-grade Model Context Protocol (MCP) server for Microsoft SharePoint.
Connect Claude Desktop, VS Code Copilot, Cursor, Continue, or any MCP-compatible AI agent
to your SharePoint โ€” read files, manage folders, and reason over your organisation's knowledge.

๐Ÿ“š Docs ยท ๐Ÿ—บ๏ธ Roadmap ยท ๐Ÿ› Bugs ยท ๐Ÿ’ก Features


๐Ÿ“‘ Table of Contents


๐Ÿง  Why sharepoint-mcp?

Most AI agents only know what's in their training data.
sharepoint-mcp gives your agent live access to your organisation's real knowledge.

Without sharepoint-mcp With sharepoint-mcp
๐Ÿคท Agent guesses or hallucinates Agent reads the actual document
๐Ÿ“‹ You copy-paste content manually Agent fetches files automatically
๐Ÿ”’ Knowledge locked in SharePoint Knowledge flows into your AI workflow
๐ŸŒ Static, one-shot answers Agent reasons, rewrites, and saves back

๐Ÿš€ What Your Agent Can Do

๐Ÿ“– Understand Any Document

You: "Summarise the Q3 report in the Finance folder"
Agent: โ†’ Get_Document_Content("Finance", "Q3_Report.pdf")
       โ†’ Reads full extracted text
       โ†’ Returns a sharp, accurate summary

โœ๏ธ Read โ†’ Reason โ†’ Write

You: "Translate the proposal to French and save it"
Agent: โ†’ Get_Document_Content โ†’ translate โ†’ Upload_Document

๐Ÿ—‚๏ธ Navigate Your Library

You: "What files are in the Legal/Contracts folder?"
Agent: โ†’ List_SharePoint_Documents("Legal/Contracts")

๐Ÿ“Š Supported File Formats

๐Ÿ“„ Format ๐Ÿค– What the Agent Gets
PDF Full text from every page
Word .docx .doc Complete document content
Excel .xlsx .xls All sheets as structured text
Text, JSON, Markdown, HTML, YAML, Python Raw content as-is
Images, ZIP, binaries File type + Base64

โœจ Features

Feature Description
๐Ÿ“ Folder Management List, create, delete, get full recursive tree
๐Ÿ“„ Document Management Upload, download, update, delete, read content
๐Ÿท๏ธ Metadata Management Read and update SharePoint list-item fields
๐Ÿ” Smart Parsing Auto-detects PDF / Word / Excel / text
๐Ÿ” Auto-Retry Exponential backoff on SharePoint 429/503 throttling
๐Ÿš€ Dual Transport stdio for desktop ยท http for Docker/remote
๐Ÿชต Structured Logging JSON in production ยท coloured console in dev
๐Ÿณ Docker-Ready Single command: docker compose up -d
๐Ÿ›ก๏ธ Non-Root Container Runs as unprivileged user inside Docker
๐Ÿค– CI/CD Tested on Python 3.10 ยท 3.11 ยท 3.12 ยท 3.13

โšก Quickstart

1๏ธโƒฃ Install

pip install sharepoint-mcp

Or from source:

git clone https://github.com/ravikant1918/sharepoint-mcp.git
cd sharepoint-mcp && pip install -e .

2๏ธโƒฃ Configure

cp .env.example .env
# Open .env and fill in your Azure AD credentials
SHP_ID_APP=your-azure-app-client-id
SHP_ID_APP_SECRET=your-azure-app-secret
SHP_TENANT_ID=your-tenant-id
SHP_SITE_URL=https://your-tenant.sharepoint.com/sites/your-site

๐Ÿ”‘ New to Azure AD? Follow the step-by-step guide โ†’

3๏ธโƒฃ Run

# ๐Ÿ” Interactive testing with MCP Inspector
npx @modelcontextprotocol/inspector -- sharepoint-mcp

# โ–ถ๏ธ Run directly
sharepoint-mcp

๐Ÿณ Docker

The fastest way to deploy for remote or cloud use:

cp .env.example .env        # fill in your credentials
docker compose up -d        # start HTTP server on port 8000

Using Podman? Just replace docker with podman โ€” fully compatible.

Docker Environment Variables

Variable Default Description
TRANSPORT http stdio or http
HTTP_HOST 0.0.0.0 Bind address
HTTP_PORT 8000 Port
LOG_FORMAT json json or console

๐Ÿ”Œ Transport Modes

Mode Best For Set With
stdio Claude Desktop, Cursor, MCP Inspector TRANSPORT=stdio (default)
http Docker, remote agents, VS Code Copilot, REST clients TRANSPORT=http

๐Ÿ”— Integrations

๐Ÿค– Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "sharepoint": {
      "command": "sharepoint-mcp",
      "env": {
        "SHP_ID_APP": "your-app-id",
        "SHP_ID_APP_SECRET": "your-app-secret",
        "SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",
        "SHP_TENANT_ID": "your-tenant-id",
        "SHP_DOC_LIBRARY": "Shared Documents/your-folder"
      }
    }
  }
}

๐Ÿ’ป VS Code Copilot (Agent Mode)

  1. Start the server via Docker or TRANSPORT=http sharepoint-mcp
  2. Create .vscode/mcp.json in your workspace:
{
  "servers": {
    "sharepoint": {
      "url": "http://localhost:8000/mcp/",
      "type": "http"
    }
  }
}
  1. Open Copilot Chat โ†’ switch to Agent mode โ†’ your 13 SharePoint tools are available.

โš ๏ธ Trailing slash matters โ€” the URL must end with /mcp/ (not /mcp).

โŒจ๏ธ Cursor / Continue

Add to your MCP config (uses stdio transport):

{
  "mcpServers": {
    "sharepoint": {
      "command": "sharepoint-mcp",
      "env": {
        "SHP_ID_APP": "your-app-id",
        "SHP_ID_APP_SECRET": "your-app-secret",
        "SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",
        "SHP_TENANT_ID": "your-tenant-id"
      }
    }
  }
}

๐Ÿ› ๏ธ All 13 Tools

๐Ÿ“ Folder Management

Tool What It Does
List_SharePoint_Folders ๐Ÿ“‹ List all sub-folders in a directory
Get_SharePoint_Tree ๐ŸŒณ Get full recursive folder + file tree
Create_Folder โž• Create a new folder
Delete_Folder ๐Ÿ—‘๏ธ Delete an empty folder

๐Ÿ“„ Document Management

Tool What It Does
List_SharePoint_Documents ๐Ÿ“‹ List all files with metadata
Get_Document_Content ๐Ÿ“– Read & parse file content (PDF/Word/Excel/text)
Upload_Document โฌ†๏ธ Upload file as string or Base64
Upload_Document_From_Path ๐Ÿ“‚ Upload a local file directly
Update_Document โœ๏ธ Overwrite existing file content
Delete_Document ๐Ÿ—‘๏ธ Permanently delete a file
Download_Document โฌ‡๏ธ Download file to local filesystem

๐Ÿท๏ธ Metadata Management

Tool What It Does
Get_File_Metadata ๐Ÿ” Get all SharePoint list-item fields
Update_File_Metadata โœ๏ธ Update metadata fields

โš™๏ธ Full Configuration Reference

Variable Required Default Description
SHP_ID_APP 12345678-1234-1234-1234-123456789012 Azure AD app client ID
SHP_ID_APP_SECRET your-app-secret Azure AD client secret
SHP_TENANT_ID your-tenant-id Microsoft tenant ID
SHP_SITE_URL https://your-tenant.sharepoint.com/sites/your-site SharePoint site URL
SHP_DOC_LIBRARY Shared Documents/mcp_server Library path
SHP_MAX_DEPTH 15 Max tree depth
SHP_MAX_FOLDERS_PER_LEVEL 100 Folders per batch
SHP_LEVEL_DELAY 0.5 Delay (s) between tree levels
TRANSPORT stdio stdio or http
HTTP_HOST 0.0.0.0 HTTP bind host
HTTP_PORT 8000 HTTP port
LOG_LEVEL INFO DEBUG INFO WARNING ERROR
LOG_FORMAT console console or json

โš ๏ธ Limitations

Limitation Details
Single site Connects to one SharePoint site per server instance (multi-site planned for v2.0)
Sync client Uses synchronous SharePoint REST API calls (async client planned for v1.3)
No search Full-text search not yet available (planned for v1.1)
No sharing Cannot create sharing links yet (planned for v1.1)
Large files Very large files may hit memory limits during content extraction
Rate limits SharePoint throttling (429/503) is handled with auto-retry, but sustained bulk operations may be slow

๐Ÿ”ง Troubleshooting

Authentication Errors

Problem: Missing or invalid SharePoint credentials
Solution: Verify all 4 required environment variables are set:

echo $SHP_ID_APP $SHP_ID_APP_SECRET $SHP_TENANT_ID $SHP_SITE_URL

Connection Issues (HTTP Transport)

Problem: Agent can't connect to the MCP server
Solution:

  1. Ensure the server is running: curl http://localhost:8000/mcp/
  2. Check the URL ends with /mcp/ (trailing slash required)
  3. Verify the port is not blocked by a firewall

Docker Container Unhealthy

Problem: podman ps / docker ps shows (unhealthy)
Solution: Check container logs for errors:

docker logs sharepoint-mcp

Debug Logging

Enable verbose output by setting LOG_LEVEL=DEBUG:

LOG_LEVEL=DEBUG sharepoint-mcp

For Docker, add to your .env file or docker-compose.yml:

LOG_LEVEL=DEBUG
LOG_FORMAT=console

Permission Errors

Problem: Access denied from SharePoint
Solution:

  1. Verify the Azure AD app has the required API permissions
  2. Ensure admin consent has been granted (if required by your org)
  3. Confirm SHP_SITE_URL points to a site your app has access to

๐Ÿงช Development

git clone https://github.com/ravikant1918/sharepoint-mcp.git
cd sharepoint-mcp
pip install -e ".[dev]"

make test      # run all tests
make inspect   # ๐Ÿ” launch MCP Inspector
make check     # quick import sanity check
make clean     # ๐Ÿงน remove caches

๐Ÿ“š Documentation

๐Ÿ“„ Doc ๐Ÿ“ Description
โšก Getting Started Full setup guide
โš™๏ธ Configuration All environment variables
๐Ÿ› ๏ธ Tools Reference Detailed tool parameters
๐Ÿ›๏ธ Architecture Design and layer diagram
๐Ÿ”‘ Azure Setup Azure AD app registration guide
๐Ÿ—บ๏ธ Roadmap Planned features
๐Ÿ“… Changelog Version history

๐Ÿค Contributing

Contributions are welcome! Please read docs/contributing.md and our Code of Conduct.

  1. ๐Ÿด Fork the repo
  2. ๐ŸŒฟ Create a branch: git checkout -b feat/my-tool
  3. โœ… Add tests: make test
  4. ๐Ÿ“ฌ Open a Pull Request

๐Ÿ”’ Security

Found a vulnerability? Please do not open a public issue.
Report privately via GitHub Security Advisories or see SECURITY.md.


MIT License ยฉ 2026 Ravi Kant

โญ If this project helps you, please star it on GitHub!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sharepoint_mcp-1.0.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sharepoint_mcp-1.0.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file sharepoint_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: sharepoint_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sharepoint_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 179f4573dc3bf0d7d08e32f4ecb333f01c005799b8d8b7423af125f1cbdd16f2
MD5 762301d7074ecfc2822fe85996458567
BLAKE2b-256 7eb303a2baf507fbc9e139e84aaf6baa54e2de992d6fd7ed1b93aafca6a7dffe

See more details on using hashes here.

Provenance

The following attestation bundles were made for sharepoint_mcp-1.0.0.tar.gz:

Publisher: publish-pypi.yml on ravikant1918/sharepoint-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sharepoint_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sharepoint_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sharepoint_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf2d398416f760dbe513b28f974a245f9f33a8f2c85f39b2e3bf238bf25d0368
MD5 dcd8853c5a70c17969f77006999e6537
BLAKE2b-256 bb4a233eba80a40b5c7d7f4dfcdab6ff99c1013527c375daf8dd2e5ab5883e6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sharepoint_mcp-1.0.0-py3-none-any.whl:

Publisher: publish-pypi.yml on ravikant1918/sharepoint-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page