SC

sekops-ch/sharepoint-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

11 stars 5 forks 质量 58 趋势 18NOASSERTION

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

概览

A Model Context Protocol server for browsing and interacting with Microsoft SharePoint sites and documents. This TypeScript-based MCP server provides comprehensive SharePoint integration through Microsoft Graph API, enabling: - : Access SharePoint sites as MCP resources with structured metadata - : Search files, list sites, browse document libraries, and retrieve file content - : Secure OAuth2 client credentials flow with automatic token management - List SharePoint sites accessible to the application - Access individual site information via sharepoint://site/{siteId} URIs - JSON-formatted site metadata with display names and web URLs Search for files and documents across SharePoint using Microsoft Graph Search API - : - query (required): Search query string - limit (optional): Maximum results to return (default: 10) List SharePoint sites accessible to the application - : - search (optional): Filter sites by display name Get detailed information about a specific SharePoint site...

README

以下为原文 README 节选,完整内容请查看原文。

SharePoint MCP Server

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

This TypeScript-based MCP server provides comprehensive SharePoint integration through Microsoft Graph API, enabling:

  • Resources: Access SharePoint sites as MCP resources with structured metadata
  • Tools: Search files, list sites, browse document libraries, and retrieve file content
  • Authentication: Secure OAuth2 client credentials flow with automatic token management

Features

Resources

  • List SharePoint sites accessible to the application
  • Access individual site information via sharepoint://site/{siteId} URIs
  • JSON-formatted site metadata with display names and web URLs

Tools

search_files

Search for files and documents across SharePoint using Microsoft Graph Search API

  • Parameters:
    • query (required): Search query string
    • limit (optional): Maximum results to return (default: 10)

list_sites

List SharePoint sites accessible to the application

  • Parameters:
    • search (optional): Filter sites by display name

get_site_info

Get detailed information about a specific SharePoint site

list_site_drives

List document libraries (drives) in a SharePoint site

  • Parameters:
    • siteUrl (required): SharePoint site URL

list_drive_items

List files and folders in a SharePoint document library

  • Parameters:
    • siteUrl (required): SharePoint site URL
    • driveId (optional): Specific drive ID (uses default drive if not specified)
    • folderPath (optional): Folder path to list items from (default: root)

get_file_content

Get the content of a specific file from SharePoint (text files only)

  • Parameters:
    • siteUrl (required): SharePoint site URL
    • filePath (required): Path to the file
    • driveId (optional): Specific drive ID (uses default drive if not specified)

Prerequisites

Azure App Registration

  1. Register an application in Azure Active Directory
  2. Configure API permissions:
    • Microsoft Graph: Sites.Read.All (Application permission)
    • Microsoft Graph: Files.Read.All (Application permission)
  3. Grant admin consent for the permissions
  4. Create a client secret

Environment Variables

Set the following environment variables:

SHAREPOINT_URL=https://yourtenant.sharepoint.com
TENANT_ID=your-azure-tenant-id
CLIENT_ID=your-azure-app-client-id
CLIENT_SECRET=your-azure-app-client-secret

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Testing

Test the server using the MCP Inspector:

npm run inspector

The Inspector provides a web interface to test all available tools and resources.

Installation

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "sharepoint-mcp-server": { "command": "node", "args": ["/path/to/sharepoint-mcp-server/build/index.js"], "env": { "SHAREPOINT_URL": "https://yourtenant.sharepoint.com", "TENANT_ID": "your-azure-tenant-id", "CLIENT_ID": "your-azure-app-client-id", "CLIENT_SECRET": "your-azure-app-client-secret" } } } }