Skip to main content

Add your description here

Project description

MCP Server - Microsoft 365 File Search (SharePoint & OneDrive)

Overview

A Model Context Protocol (MCP) server implementation that provides advanced file search capabilities within Microsoft 365. This server enables efficient file discovery, metadata analysis, and integration with business workflows by making available the content from SharePoint/OneDrive.

https://github.com/user-attachments/assets/bbe63c02-f6d9-4c9b-8f98-36fc22a081cc

Components

Tools

The server offers 2 core tools:

  • search_m365_files
    Perform a file search within the M365 environment.
    Input:

    • query (string): The search term or criteria.
      Returns: Array of file metadata objects. Metadata includes the file content summary, drive ID, and file ID, among other details.
  • get_file_content
    Retrieve content from a specific file.
    Input:

    • driveid (string): The unique identifier of the parent drive.
    • fileid (string): The unique identifier of the file.
      Returns: File content as a binary stream.
      Note: Uses a local cache to speed up repeat access.

Caching

To improve performance and reduce redundant API calls, the server caches downloaded files locally. This is particularly useful when working with large documents or frequently accessed files.

  • Cached files are stored in the ./src/mcp_m365_filesearch/.local/downloads directory (relative to the project root).
  • When a file is requested via get_file_content, the server first checks the cache.
  • If the file is already cached, it is returned directly from disk without a new API call.

This feature ensures faster response times and efficient use of API rate limits.

Usage with Claude Desktop

To integrate the server with Claude Desktop, update your claude_desktop_config.json:

"mcpServers": {
  "M365 File Search (SharePoint/OneDrive)": {
    "command": "uv",
    "args": [
      "--directory",
      "full_path_to_parent_directory",
      "run",
      ".\\src\\mcp_m365_filesearch\\server.py"
    ],
    "env": {
      "CLIENT_ID": "MSGraph Client ID",
      "CLIENT_SECRET": "MS Graph Client Secret",
      "TENANT_ID": "TENANT ID",
      "REGION": "SEARCH REGION"
    }
  }
}

Microsoft Graph App Registration

To use this server, you'll need to register an application in the Azure Portal:

  1. Register a new application.
  2. Note down the Client ID and Tenant ID.
  3. Create a Client Secret under Certificates & Secrets.
  4. Under API permissions, add the following delegated or application permissions:
    • Sites.Read.All
    • Files.Read.All
  5. Click Grant admin consent for these permissions.

Ensure these values are correctly set in your env configuration for the MCP server.

License

This project is licensed under the MIT License.
You are free to use, modify, and distribute it with proper attribution.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_godwin3737_mcp_m365_filesearch-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_godwin3737_mcp_m365_filesearch-0.1.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_godwin3737_mcp_m365_filesearch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 411419d732462e77cc82e1e520f6d372baf3761fde0de7c8d978a05112db9f40
MD5 68a5244976323b3066dedc19a06dab94
BLAKE2b-256 536ee32ea42fdaf1f8c5682bb1c8c5a50928748e42dd16ebb315f1a74be9dfc4

See more details on using hashes here.

File details

Details for the file iflow_mcp_godwin3737_mcp_m365_filesearch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_godwin3737_mcp_m365_filesearch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_godwin3737_mcp_m365_filesearch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8abd7725461269b3cd6bc705b90ed77a161f28155f885cf6a27a29b3870209c
MD5 b160cae56c70107ca9f3d926ccf756b6
BLAKE2b-256 207f9140fd02e1e1ce9c58d54a83e7328974d58a559a12c079557ca1900fbc9c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page