Get the FREE Ultimate OpenClaw Setup Guide →

sharepoint

A Model Context Protocol server for browsing and interacting with Microsoft SharePoint sites and documents

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio sekops-ch-sharepoint-mcp-server node /path/to/sharepoint-mcp-server/build/index.js \
  --env CLIENT_ID="your-azure-app-client-id" \
  --env TENANT_ID="your-azure-tenant-id" \
  --env CLIENT_SECRET="your-azure-app-client-secret" \
  --env SHAREPOINT_URL="https://yourtenant.sharepoint.com"

How to use

This MCP server provides programmatic access to SharePoint sites and documents via a set of MCP tools and resources. It exposes resources for listing SharePoint sites and their metadata, and tools to search files, browse document libraries, and retrieve file contents (text files). Authentication is handled via OAuth2 client credentials with automatic token management, so the server can operate in headless scenarios where a service principal is used. You can interact with the server using the MCP Inspector during development or integrate it into Claude Desktop by configuring the MCP server in your environment to point to the built server binary or entry point.

The available tools include: search_files to query across SharePoint documents using Microsoft Graph, list_sites to enumerate accessible SharePoint sites, get_site_info for detailed site metadata, list_site_drives to enumerate document libraries, list_drive_items to browse items within a library, and get_file_content to fetch the contents of text files. Each tool accepts parameters such as siteUrl, driveId, folderPath, and query strings as described in the README, enabling you to compose rich MCP requests for browsing and retrieving SharePoint data.

How to install

Prerequisites:

  • Node.js and npm installed (Node 14+ recommended)
  • Access to Microsoft Graph with the required permissions and a registered Azure AD application (Sites.Read.All and Files.Read.All as application permissions)
  • Network access to Microsoft Graph API endpoints

Installation steps:

  1. Clone the repository or download the package for the SharePoint MCP server
  2. Install dependencies:
npm install
  1. Build the TypeScript project:
npm run build
  1. (Optional for development) Run in watch mode to auto-rebuild on changes:
npm run watch
  1. Prepare environment variables for authentication (example):
export SHAREPOINT_URL=https://yourtenant.sharepoint.com
export TENANT_ID=your-azure-tenant-id
export CLIENT_ID=your-azure-app-client-id
export CLIENT_SECRET=your-azure-app-client-secret
  1. Run the server (pointing to the built entry):
node build/index.js
  1. (Optional) Run the MCP Inspector to test tools:
npm run inspector

For Claude Desktop integration, configure your client with the appropriate command and arguments to start the server, as shown in the Installation section of the README.

Additional notes

Tips and notes:

  • Ensure the Azure AD application has Sites.Read.All and Files.Read.All application permissions and admin consent has been granted.
  • Store client secrets securely; avoid committing them to version control.
  • If you rotate client secrets, update the environment variables and restart the server.
  • The server uses OAuth2 client credentials flow, so it is best suited for service or automation scenarios rather than user-interactive logins.
  • When debugging, you can enable verbose logs by setting DEBUG=sharepoint-mcp-server to aid in troubleshooting authentication or Graph API calls.
  • In production, consider deploying behind a reverse proxy with TLS termination and rotating credentials periodically.

Related MCP Servers

Sponsor this space

Reach thousands of developers