Labsco
ravikant1918 logo

sharepoint-mcp

β˜… 9

from ravikant1918

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

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredAdvanced setup

πŸ—‚οΈ sharepoint-mcp

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

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-mcpWith sharepoint-mcp
🀷 Agent guesses or hallucinatesAgent reads the actual document
πŸ“‹ You copy-paste content manuallyAgent fetches files automatically
πŸ”’ Knowledge locked in SharePointKnowledge flows into your AI workflow
🐌 Static, one-shot answersAgent 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
You: "What files are in the Legal/Contracts folder?"
Agent: β†’ List_SharePoint_Documents("Legal/Contracts")

πŸ“Š Supported File Formats

πŸ“„ FormatπŸ€– What the Agent Gets
PDFFull text from every page
Word .docx .docComplete document content
Excel .xlsx .xlsAll sheets as structured text
Text, JSON, Markdown, HTML, YAML, PythonRaw content as-is
Images, ZIP, binariesFile type + Base64

✨ Features

FeatureDescription
πŸ”€Dual API SupportChoose Office365 REST or Microsoft Graph API
πŸ“Folder ManagementList, create, delete, get full recursive tree
πŸ“„Document ManagementUpload, download, update, delete, search, read content
🏷️Metadata ManagementRead and update SharePoint list-item fields
πŸ”Smart ParsingAuto-detects PDF / Word / Excel / text
πŸ”ŽKQL SearchNative SharePoint KQL search for semantic file finding
πŸ“‚Flexible Library ScopeScope to a subfolder or access the entire library root
πŸ”Auto-RetryExponential backoff on SharePoint 429/503 throttling
πŸš€Dual Transportstdio for desktop Β· http for Docker/remote
πŸͺ΅Structured LoggingJSON in production Β· coloured console in dev
🐳Docker-ReadySingle command: docker compose up -d
πŸ›‘οΈNon-Root ContainerRuns as unprivileged user inside Docker
🩺Health CheckLive /health endpoint with real SharePoint check
πŸ€–CI/CDTested on Python 3.10 Β· 3.11 Β· 3.12 Β· 3.13

🐳 Docker

The fastest way to deploy for remote or cloud use.

πŸ“‹ Usage Scenarios

Use this for production deployments with the latest stable release:

# Step 1: Clone repository
git clone https://github.com/ravikant1918/sharepoint-mcp.git
cd sharepoint-mcp

# Step 2: Create .env file with your SharePoint credentials
cp .env.example .env
# Edit .env and fill in:
# SHP_ID_APP=your-app-id
# SHP_ID_APP_SECRET=your-secret
# SHP_TENANT_ID=your-tenant-id
# SHP_SITE_URL=https://yourcompany.sharepoint.com/sites/yoursite

# Step 3: Start container (pulls from DockerHub automatically)
docker compose up -d

# Step 4: Verify it's running
docker compose ps
curl http://localhost:8000/health

# View logs
docker compose logs -f

# Stop container
docker compose down

What happens: Pulls ravikant1918/sharepoint-mcp:latest from DockerHub with automatic architecture detection (Intel/ARM).


Scenario B: Use Specific Version

Lock to a specific version for stability or testing:

# Step 1: Set version via environment variable
SHAREPOINT_MCP_VERSION=v1.0.1 docker compose up -d

# Or add to .env file
echo "SHAREPOINT_MCP_VERSION=v1.0.1" >> .env
docker compose up -d

What happens: Pulls ravikant1918/sharepoint-mcp:v1.0.1 instead of latest.


Scenario C: Build Locally from Source

Use this for development or when you've made local code changes:

# Step 1: Clone and setup
git clone https://github.com/ravikant1918/sharepoint-mcp.git
cd sharepoint-mcp
cp .env.example .env
# Edit .env with your credentials

# Step 2: Build from local Dockerfile and start
docker compose up -d --build

# Step 3: Rebuild after code changes
docker compose down
docker compose up -d --build

What happens: Builds image from local Dockerfile, tags as ravikant1918/sharepoint-mcp:latest, and starts container.


Scenario D: Use Custom Image/Fork

If you've forked the repo and published to your own DockerHub:

# Use your custom image
SHAREPOINT_MCP_IMAGE=myusername/sharepoint-mcp \
SHAREPOINT_MCP_VERSION=dev \
docker compose up -d

# Or add to .env
echo "SHAREPOINT_MCP_IMAGE=myusername/sharepoint-mcp" >> .env
echo "SHAREPOINT_MCP_VERSION=dev" >> .env
docker compose up -d

What happens: Pulls from your custom registry/repository.


πŸ”§ Common Commands

# Start in detached mode
docker compose up -d

# Start with live logs
docker compose up

# View logs
docker compose logs -f

# Stop container
docker compose down

# Restart container
docker compose restart

# Pull latest image
docker compose pull

# Rebuild and restart
docker compose up -d --build

# Remove everything (including volumes)
docker compose down -v

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

Docker Environment Variables

VariableDefaultDescription
TRANSPORThttpstdio or http
HTTP_HOST0.0.0.0Bind address
HTTP_PORT8000Port
LOG_FORMATjsonjson or console

πŸ”Œ Transport Modes

ModeBest ForSet With
stdioClaude Desktop, Cursor, MCP InspectorTRANSPORT=stdio (default)
httpDocker, remote agents, VS Code Copilot, REST clientsTRANSPORT=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": "my-subfolder"
      }
    }
  }
}

πŸ’‘ Omit SHP_DOC_LIBRARY to access the full library root. If your org uses Office365 REST API and renamed the default library, also set SHP_LIBRARY_NAME.

πŸ’» 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 14 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 14 Tools

πŸ“ Folder Management

ToolWhat 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

ToolWhat It Does
List_SharePoint_DocumentsπŸ“‹ List all files with metadata
Search_SharePointπŸ”Ž Search documents using KQL queries
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

ToolWhat It Does
Get_File_MetadataπŸ” Get all SharePoint list-item fields
Update_File_Metadata✏️ Update metadata fields

πŸ§ͺ 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 StartedFull setup guide
βš™οΈ ConfigurationAll environment variables
πŸ› οΈ Tools ReferenceDetailed tool parameters
πŸ›οΈ ArchitectureDesign and layer diagram
πŸ”‘ Azure SetupAzure AD app registration guide
πŸ—ΊοΈ RoadmapPlanned features
πŸ“… ChangelogVersion 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!