Skip to main content
Glama
SharePoint MCP Server

SharePoint MCP Server

by Sofias-ai

SharePoint MCP サーバー

ライセンス: MIT

Microsoft SharePointとのシームレスな統合を実現する軽量MCPサーバー。MCPクライアントがドキュメント、フォルダー、その他のSharePointリソースを操作できるようになります。sofias techによって開発されました。

特徴

このサーバーは、モデル コンテキスト プロトコル (MCP) を通じて SharePoint リソースへのクリーンなインターフェイスを提供し、ドキュメント管理用に最適化された操作を提供します。

ツール

サーバーは次のツールを実装します。

  • List_SharePoint_Folders : 指定されたディレクトリまたはルート内のすべてのフォルダを一覧表示します

  • List_SharePoint_Documents : 指定されたフォルダ内のすべてのドキュメントを取得します

  • Get_Document_Content : ドキュメントのコンテンツを取得します(テキストまたはbase64エンコードされたバイナリとして)

  • Create_Folder : 指定されたディレクトリまたはルートに新しいフォルダを作成します

  • Upload_Document : 指定されたフォルダに新しいドキュメントをアップロードします

  • Upload_Document : パスから大きなドキュメントをアップロードします。

  • Update_Document : 既存のドキュメントの内容を更新します

  • Delete_Document : 指定されたフォルダからドキュメントを削除します

  • Delete_Folder : SharePoint から空のフォルダーを削除します

Related MCP server: MCP Server

建築

サーバーはリソース効率を考慮して構築されています。

  • 選択的なプロパティの読み込みによる SharePoint API の効率的な使用

  • デコレータによるエラー処理でよりきれいなコードを実現

  • リソース管理とツール実装の明確な分離

  • テキストファイルとバイナリファイルの両方に対して最適化されたコンテンツ処理

設定

  1. 適切な SharePoint 権限を使用して Azure AD にアプリを登録する

  2. 登録したアプリのクライアントIDとクライアントシークレットを取得する

  3. SharePoint サイトの URL と操作するドキュメント ライブラリのパスを特定します。

環境変数

サーバーには次の環境変数が必要です:

  • SHP_ID_APP : Azure AD アプリケーション クライアント ID

  • SHP_ID_APP_SECRET : Azure AD アプリケーション クライアント シークレット

  • SHP_SITE_URL : SharePoint サイトの URL

  • SHP_DOC_LIBRARY : ドキュメントライブラリへのパス (デフォルト: "Shared Documents/mcp_server")

  • SHP_TENANT_ID : Microsoft テナント ID

クイックスタート

インストール

pip install -e .

または、公開されたら PyPI からインストールします。

pip install mcp-sharepoint-server

uvの使用:

uv pip install mcp-sharepoint-server

クロードデスクトップ統合

Claude Desktop と統合するには、構成ファイルを更新します。

Windows の場合: %APPDATA%/Claude/claude_desktop_config.json macOS の場合: ~/Library/Application\ Support/Claude/claude_desktop_config.json

標準統合

"mcpServers": {
  "sharepoint": {
    "command": "mcp-sharepoint",
    "env": {
      "SHP_ID_APP": "your-app-id",
      "SHP_ID_APP_SECRET": "your-app-secret",
      "SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",
      "SHP_DOC_LIBRARY": "Shared Documents/your-folder",
      "SHP_TENANT_ID": "your-tenant-id"
    }
  }
}

uvxの使用

"mcpServers": {
  "sharepoint": {
    "command": "uvx",
    "args": [
      "mcp-sharepoint"
    ],
    "env": {
      "SHP_ID_APP": "your-app-id",
      "SHP_ID_APP_SECRET": "your-app-secret",
      "SHP_SITE_URL": "https://your-tenant.sharepoint.com/sites/your-site",
      "SHP_DOC_LIBRARY": "Shared Documents/your-folder",
      "SHP_TENANT_ID": "your-tenant-id"
    }
  }
}

発達

要件

  • Python 3.10以上

  • requirements.txtとpyproject.tomlにリストされている依存関係

地域開発

  1. リポジトリをクローンする

  2. 仮想環境を作成します。

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  3. 開発依存関係をインストールします。

    pip install -e .
  4. SharePoint 資格情報を使用して.envファイルを作成します。

    SHP_ID_APP=your-app-id
    SHP_ID_APP_SECRET=your-app-secret
    SHP_SITE_URL=https://your-tenant.sharepoint.com/sites/your-site
    SHP_DOC_LIBRARY=Shared Documents/your-folder
    SHP_TENANT_ID=your-tenant-id
  5. サーバーを実行します。

    python -m mcp_sharepoint

デバッグ

MCP サーバーをデバッグするには、 MCP Inspector を使用できます。

npx @modelcontextprotocol/inspector -- python -m mcp_sharepoint

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

Copyright (c) 2025 ソフィアステック

Available Tools

9 tools
Create_FolderC

Create a new folder in the specified directory or root if not specified

Inputs: folder_name (required), parent_folder.

Delete_DocumentC

Delete a document from a SharePoint directory

Inputs: file_name (required), folder_name (required).

Delete_FolderC

Delete an empty folder from SharePoint

Inputs: folder_path (required).

Get_Document_ContentC

Get content of a document in SharePoint

Inputs: file_name (required), folder_name (required).

List_SharePoint_DocumentsC

List all documents in a specified SharePoint folder

Inputs: folder_name (required).

List_SharePoint_FoldersB

List folders in the specified SharePoint directory or root if not specified

Inputs: parent_folder.

Update_DocumentC

Update an existing document in a SharePoint directory

Inputs: content (required), file_name (required), folder_name (required), is_base64.

Upload_DocumentC

Upload a new file to a SharePoint directory

Inputs: content (required), file_name (required), folder_name (required), is_base64.

Upload_Document_From_PathC

Upload a file directly from a file path to SharePoint

Inputs: file_path (required), folder_name (required), new_file_name.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools have distinct purposes, but 'Upload_Document' and 'Upload_Document_From_Path' could cause confusion as they both handle document uploads with only a slight difference in source specification. The other tools clearly target different operations like creation, deletion, listing, and updating.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with underscores, such as 'Create_Folder', 'Delete_Document', and 'List_SharePoint_Documents'. This uniformity makes the set predictable and easy to navigate for an agent.

    Tool Count5/5

    With 9 tools, the server is well-scoped for managing SharePoint documents and folders. It covers essential operations without being overly complex, making it appropriate for typical file management tasks in this domain.

    Completeness4/5

    The toolset provides strong coverage for document and folder management, including CRUD operations like create, read, update, and delete. A minor gap is the lack of a tool for moving or renaming items, which might require workarounds, but core workflows are well-supported.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.
      39 npm
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP Server provides a simpler API to interact with the Model Context Protocol by allowing users to define custom tools and services to streamline workflows and processes.
      26 npm
      3
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server that provides tools to interact with Folderr's API, specifically for managing and communicating with Folderr Assistants.
      7
      17 npm
      3
      MIT