Skip to main content

SharePoint Model Context Protocol (MCP) server for LLM applications

Project description

MseeP.ai Security Assessment Badge

License: MIT Python 3.10+ MCP

SharePoint MCP Server

DISCLAIMER: This project is not affiliated with, endorsed by, or related to Microsoft Corporation. SharePoint and Microsoft Graph API are trademarks of Microsoft Corporation. This is an independent, community-driven project.

SharePoint Model Context Protocol (MCP) server acts as a bridge that enables LLM applications (like Claude) to access content from your SharePoint site. With this project, you can use natural language to query documents, lists, and other content in your SharePoint site.

Features

  • Browse Document Libraries: View contents of SharePoint document libraries
  • Access List Data: Retrieve and manipulate SharePoint list data
  • Retrieve Document Content: Access content from specific documents
  • SharePoint Search: Search across your entire site
  • Create List Items: Add new items to SharePoint lists

Prerequisites

  • Python 3.10 or higher
  • Access to a SharePoint site
  • Microsoft Azure AD application registration (for authentication)

Quickstart

Follow these steps to get the SharePoint MCP Server up and running quickly:

  1. Prerequisites

    • Ensure you have Python 3.10+ installed
    • An Azure AD application with proper permissions (see docs/auth_guide.md)
  2. Installation

    # Install from GitHub
    pip install git+https://github.com/DEmodoriGatsuO/sharepoint-mcp.git
    
    # Or install in development mode
    git clone https://github.com/DEmodoriGatsuO/sharepoint-mcp.git
    cd sharepoint-mcp
    pip install -e .
    
  3. Configuration

    # Copy the example configuration
    cp .env.example .env
    
    # Edit the .env file with your details
    nano .env
    
  4. Run the Diagnostic Tools

    # Check your configuration
    python config_checker.py
    
    # Test authentication
    python auth-diagnostic.py
    
  5. Start the Server

    python server.py
    

Installation

  1. Clone the repository:
git clone https://github.com/DEmodoriGatsuO/sharepoint-mcp.git
cd sharepoint-mcp
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up environment variables:
cp .env.example .env
# Edit the .env file with your authentication details

Configuration

  1. Register an application in Azure AD and grant necessary permissions (see docs/auth_guide.md)
  2. Configure your authentication information and SharePoint site URL in the .env file

Usage

Run in Development Mode

mcp dev server.py

Install in Claude Desktop

mcp install server.py --name "SharePoint Assistant"

Run Directly

python server.py

Advanced Usage

Handling Document Content

# Example of retrieving document content
import requests

# Get document content
response = requests.get(
    "http://localhost:8080/sharepoint-mcp/document/Shared%20Documents/report.docx", 
    headers={"X-MCP-Auth": "your_auth_token"}
)

# Process content
if response.status_code == 200:
    document_content = response.json()
    print(f"Document name: {document_content['name']}")
    print(f"Size: {document_content['size']} bytes")

Working with SharePoint Lists

# Example of retrieving list data
import requests
import json

# Get list items
response = requests.get(
    "http://localhost:8080/sharepoint-mcp/list/Tasks", 
    headers={"X-MCP-Auth": "your_auth_token"}
)

# Create a new list item
new_item = {
    "Title": "Review quarterly report",
    "Status": "Not Started",
    "DueDate": "2025-05-01"
}

create_response = requests.post(
    "http://localhost:8080/sharepoint-mcp/list/Tasks", 
    headers={
        "X-MCP-Auth": "your_auth_token",
        "Content-Type": "application/json"
    },
    data=json.dumps(new_item)
)

Integrating with Claude

See the documentation in docs/usage.md for detailed examples of how to use this server with Claude and other LLM applications.

Monitoring and Troubleshooting

Logs

The server logs to stdout by default. Set DEBUG=True in your .env file to enable verbose logging.

Common Issues

  • Authentication Failures: Run python auth-diagnostic.py to diagnose issues
  • Permission Errors: Make sure your Azure AD app has the required permissions
  • Token Issues: Use python token-decoder.py to analyze your token's claims

License

This project is released under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome. Please open an issue first to discuss what you would like to change before making major modifications. See CONTRIBUTING.md for guidelines.

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

Built Distribution

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

File details

Details for the file iflow_mcp_demodorigatsuo_sharepoint_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: iflow_mcp_demodorigatsuo_sharepoint_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 30.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_demodorigatsuo_sharepoint_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 54d6bceaeb6a7caa8b9b9c753f5321d0072b36bfcf248cd256f2ad0cd7759280
MD5 c24a390c5146b8f70595c4e25b98c1cb
BLAKE2b-256 88b0b3c5904aa7d4f8d0f48829c7f1a49ccb00bf60c704f25bde58db2f7fea61

See more details on using hashes here.

File details

Details for the file iflow_mcp_demodorigatsuo_sharepoint_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_demodorigatsuo_sharepoint_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_demodorigatsuo_sharepoint_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e770eb4aa544bad26455ff62b819940ce2fd16e84bc629b40d90ab11c34751bf
MD5 f04d055c335f264da52310b4b80a80b1
BLAKE2b-256 0827820b14ce43a87001932e1dd0144ea01b1b39b17b48c4d3dbb34a3e4b4cc5

See more details on using hashes here.

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