Skip to main content
Glama
SharePoint Docs MCP Server

SharePoint Docs MCP Server

by ncdcdev

SharePoint Docs MCP Server

πŸ‡―πŸ‡΅ ζ—₯本θͺžη‰ˆγ―こけら

A Model Context Protocol (MCP) server that provides SharePoint document search functionality. Supports both stdio and HTTP transports.

Authentication Methods

Two authentication methods are supported:

  • Certificate Authentication (Application Permissions)

    • Uses Azure AD certificate-based authentication

    • Supports both stdio and HTTP transports

    • Recommended for server applications and automation

  • OAuth Authentication (User Permissions)

    • Uses OAuth 2.0 Authorization Code Flow with PKCE

    • HTTP transport only (browser-based authentication required)

    • Recommended for user-delegated access scenarios

Related MCP server: excel-o365

Features

SharePoint Features

  • sharepoint_docs_search

    • Document search by keywords

    • Support for both SharePoint sites and OneDrive

    • Multiple search targets (sites, OneDrive folders, or mixed)

    • File extension filtering (pdf, docx, xlsx, etc.)

    • Response format options (detailed/compact) for token efficiency

  • sharepoint_docs_download

    • File download from search results

    • Automatic method selection for SharePoint vs OneDrive files

  • sharepoint_excel

    • Read or search Excel files in SharePoint

    • Search mode: find cells containing specific text with query parameter

    • Read mode: get data from specific sheets/ranges with sheet and cell_range parameters

    • Automatic header inclusion: when cell_range is specified, frozen rows (headers) are automatically included by default

      • Set include_frozen_rows=False to get only the specified range

      • For sheets with frozen_rows=0, use expand_axis_range=True to include row 1 (for columns) or column A (for rows)

    • Cell style information (optional): set include_cell_styles=True to get background colors, column widths, and row heights

      • Default is False to minimize token usage

      • Useful for identifying highlighted cells, colored headers, or visually emphasized content

    • Response includes cell data in rows (value and coordinate) and structural information when available

    • Structural info: sheet name, dimensions, frozen_rows, frozen_cols, freeze_panes (when present), merged_ranges (when merged cells exist)

    • No Excel Services dependency - uses direct file download + openpyxl parsing

OneDrive Support

This server supports searching both SharePoint sites and OneDrive content with flexible configuration:

  • OneDrive Integration: Search specific users' OneDrive content

  • Folder-level targeting: Search specific folders within OneDrive

  • Mixed search: Combine SharePoint sites and OneDrive in a single search

  • Flexible configuration: Simple environment variable setup

Requirements

  • Python 3.12

  • uv (package manager)

Quick Start

1. Installation

# Run directly from GitHub without cloning
uvx --from git+https://github.com/ncdcdev/sharepoint-docs-mcp sharepoint-docs-mcp --transport stdio

2. Configuration

Create a .env file with your SharePoint credentials:

# Basic configuration
SHAREPOINT_BASE_URL=https://yourcompany.sharepoint.com
SHAREPOINT_TENANT_ID=your-tenant-id-here
SHAREPOINT_CLIENT_ID=your-client-id-here
SHAREPOINT_SITE_NAME=yoursite

# For certificate authentication
SHAREPOINT_CERTIFICATE_PATH=path/to/certificate.pem
SHAREPOINT_PRIVATE_KEY_PATH=path/to/private_key.pem

# For OAuth authentication (HTTP transport only)
# SHAREPOINT_AUTH_MODE=oauth
# SHAREPOINT_OAUTH_CLIENT_SECRET=your-oauth-client-secret-here
# SHAREPOINT_OAUTH_SERVER_BASE_URL=https://your-server.com
# If not set: all URIs allowed (dev). If set: only specified patterns (production recommended)
# SHAREPOINT_OAUTH_ALLOWED_REDIRECT_URIS=https://claude.ai/*,https://*.anthropic.com/*

See Setup Guide for detailed configuration instructions.

3. Run the Server

# stdio mode (for Claude Desktop)
uv run sharepoint-docs-mcp --transport stdio

# HTTP mode (for network services)
uv run sharepoint-docs-mcp --transport http --host 127.0.0.1 --port 8000

Documentation

License

MIT License - See LICENSE file for details.

Available Tools

3 tools
sharepoint_docs_downloadC

Download a file from SharePoint

Inputs: file_path (required). Returns: result

sharepoint_excelA

ALWAYS start by reading 'A1:Z5' to understand column structure (required for both modes). Two modes: 1) Search mode (query parameter) finds cells containing text and returns locations with optional row data. 2) Read mode (sheet + cell_range) retrieves specific sections. Key parameters: - include_frozen_rows (default: true): Auto-includes frozen header rows even if outside specified range. frozen_rows = header row count - include_cell_styles (default: false): Adds background colors and sizes (20% more tokens) - use for color-coded data only - expand_axis_range (default: false): When frozen_rows=0, auto-expands ranges to include row 1/column A for headers - include_row_data (default: false): Search mode - returns entire matched rows (headers excluded). Best for <200 matches. Recommended workflow: 1. Read 'A1:Z5' for headers (NOT 'A1:Z50') - MANDATORY 2. Search with query to locate data 3. Read specific range if needed (frozen headers auto-included) 4. If frozen_rows=0 and context unclear, retry with expand_axis_range=true. Response: rows (value + coordinate), sheet info (dimensions, frozen_rows/cols, freeze_panes/merged_ranges).

Inputs: file_path (required), query, sheet, cell_range, +4 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 3 tools

    Disambiguation4/5

    The three tools target distinct operations: finding documents, downloading files, and reading Excel cells. However, sharepoint_excel bundles its own 'search mode' alongside sharepoint_docs_search, creating mild overlap in the word 'search' and a two-mode tool that requires careful reading to use correctly.

    Naming Consistency4/5

    All names use the sharepoint_ prefix with snake_case, which is predictable. The one deviation is sharepoint_excel, which names a resource rather than following the verb_noun pattern used by sharepoint_docs_search and sharepoint_docs_download.

    Tool Count3/5

    Three tools is borderline thin for a document platform server; search, download, and Excel reading are useful but leave little room for anything else. The Excel tool in particular carries a very large description, suggesting it is overstuffed relative to the small surface.

    Completeness3/5

    The server covers discovery, retrieval, and spreadsheet reading, but has notable gaps: no upload/write, no listing of sites, libraries, or folders, and no metadata retrieval beyond search results. Agents can perform read-only document workflows but will hit dead ends for common SharePoint operations.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables managing Excel files in Microsoft 365 (OneDrive/SharePoint) through Microsoft Graph API, including creating workbooks, adding worksheets, creating tables, and reading or adding table rows via MCP tools.
      6
      Apache 2.0
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables semantic search and retrieval over SharePoint documents such as PPTX, DOCX, and PDF files through MCP tools.
      1
      Apache 2.0