SharePoint MCP server

Integrates with SharePoint through Microsoft Graph API to enable direct access, search, and analysis of organizational documents, folders, and sites without leaving your assistant interface.
Back to servers
Provider
Brian Cusack
Release date
Mar 24, 2025
Language
TypeScript
Stats
13 stars

The Sharepoint MCP server provides access to your organization's Sharepoint resources through the Model Context Protocol, allowing AI assistants to interact with your Sharepoint content, including sites, drives, and documents.

Installation

Setting Up Environment Variables

  1. Create your environment configuration file:

    cp .env.example .env
    
  2. Fill in the required fields in the .env file with your Sharepoint credentials:

    • TENANT_ID: Your Microsoft 365 tenant ID
    • CLIENT_ID: Your registered application's client ID
    • CLIENT_SECRET: Your registered application's client secret
    • SITE_ID: The Sharepoint site ID
    • DRIVE_ID: The Sharepoint drive ID

Usage

Running with Inspector

You can run the server with the MCP inspector to debug and test functionality:

npx @modelcontextprotocol/inspector -e TENANT_ID=your_tenant_id -e CLIENT_ID=your_client_id -e CLIENT_SECRET=your_client_secret -e SITE_ID=your_site_id -e DRIVE_ID=your_drive_id -- node dist/index.js

Running with Claude Desktop

You can integrate this MCP server with Claude Desktop in two ways:

Docker Method

  1. Build and tag the Docker image:

    docker build -t mcp/sharepoint .
    
  2. Add the following configuration to the "mcpServers" section of your claude_desktop_config.json:

    {
      "mcpServers": {
        "sharepoint": {
          "command": "docker",
          "args": [
            "run", 
            "-i", 
            "--rm", 
            "--init", 
            "-e", "DOCKER_CONTAINER=true",
            "-e", "TENANT_ID=your-tenant-id",
            "-e", "CLIENT_ID=your-client-id",
            "-e", "CLIENT_SECRET=your-client-secret",
            "-e", "SITE_ID=your-site-id",
            "-e", "DRIVE_ID=your-drive-id",
            "mcp/sharepoint"
          ]
        }
      }
    }
    

Direct Node.js Method

  1. Build the application:

    pnpm run build
    
  2. Add the following configuration to your claude_desktop_config.json:

    {
      "mcpServers": {
        "sharepoint": {
          "command": "node",
          "args": ["run", "start"],
          "env": {
            "TENANT_ID": "your-tenant-id",
            "CLIENT_ID": "your-client-id",
            "CLIENT_SECRET": "your-client-secret",
            "SITE_ID": "your-site-id",
            "DRIVE_ID": "your-drive-id"
          }
        }
      }
    }
    

Supported Features

The server currently supports the following operations:

Sites

  • List Sites

Drives

  • Search Folders (as a Tool)
  • Read File
  • List Items (as a Dynamic Resource)
  • Download File (as a Tool)

Available Prompts

  • document-summary
  • find-relevant-documents
  • explore-folder

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later