OneDrive Connector (data-connectors-ai)

Read-only MCP server for OneDrive: list files/folders via Microsoft Graph API.

Documentation

OneDrive MCP Server

Read-only MCP server exposing OneDriveClient to AI agents: list files/folders via the Microsoft Graph API.

Tools

ToolDescription
list_items(path: str | None = None) -> list[str]List item names in a folder (default: configured ONEDRIVE_DIRECTORY)
read_object_text(remote_path: str, max_bytes: int = 1_000_000) -> strRead a file's content as UTF-8 text. Refuses (raises) files larger than max_bytes rather than truncating.

OneDriveClient's other methods (download(), sync_files_and_folders()) write to a local filesystem path, which an agent doesn't have, so they aren't wrapped.

Environment Variables

VariableRequiredDefaultNotes
ONEDRIVE_CLIENT_IDyesAzure AD app client ID
ONEDRIVE_CLIENT_SECRETyesAzure AD app client secret
ONEDRIVE_TENANT_IDyesAzure AD tenant ID
ONEDRIVE_SITE_IDyesSharePoint site ID backing the OneDrive drive
ONEDRIVE_DIRECTORYno"" (drive root)Default folder path to list
ONEDRIVE_HOSTnoyourcompany.sharepoint.com

local_directory (a required constructor arg on the underlying client) is defaulted internally to /tmp/onedrive-mcp — it's only read by the download/sync methods this server doesn't expose, so it isn't surfaced as configuration here.

Run locally

pip install "data-connectors-ai[onedrive,mcp]"
data-connectors-onedrive-mcp

Use with an MCP client

{
  "mcpServers": {
    "onedrive": {
      "command": "uvx",
      "args": ["--from", "data-connectors-ai[onedrive,mcp]", "data-connectors-onedrive-mcp"],
      "env": {
        "ONEDRIVE_CLIENT_ID": "...",
        "ONEDRIVE_CLIENT_SECRET": "...",
        "ONEDRIVE_TENANT_ID": "...",
        "ONEDRIVE_SITE_ID": "..."
      }
    }
  }
}

Registry

Published at io.github.nagarjunr/data-connectors-onedrive on the official MCP registry.