Connector guide8-minute read19 MCP tools7 languages

How to Connect Microsoft OneDrive to Claude via MCP

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

HCBy HelpCode teamUpdated 8 min read Open-source on GitHub

No credit card · 7-day trial · Self-host alternative available

OneDrive (Microsoft 365)

OneDrive (Microsoft 365)

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

tools

19

Region

INTL

Category

File Storage

Authentication

OAuth 2.0

Required env vars

MICROSOFT_CLIENT_IDMICROSOFT_CLIENT_SECRETMICROSOFT_TENANT_ID
Install in one click on Cloud

7-day free trial · No credit card

  • 7-day free trial
    No credit card required
  • GDPR & SOC 2 ready
    EU data residency, audit logs
  • Open-source on GitHub
    Open source · AGPL-3.0
  • Works with ChatGPT, Claude, Gemini
    Any MCP-compatible client

Skip the install. Get this working in under 2 minutes.

Start a free trial on cloud.anythingmcp.com, add the OneDrive (Microsoft 365) in one click, then point your AI client (Claude, ChatGPT, Copilot or Cursor) at the generated MCP endpoint. No Docker, no git clone, zero engineering experience required.

Start free trial

AnythingMCP is listed in Claude's connector directory: add it to Claude in one click (opens in a new tab), then sign in and choose which MCP servers Claude may use.

Summary

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

Try asking

Example prompts for OneDrive (Microsoft 365)

Click any prompt to copy it. Paste into Claude, ChatGPT, Cursor, Gemini, Copilot or OpenClaw to run it against this connector.

OneDrive (Microsoft 365) · live via MCP
Share
Opus 4.7

Claude is AI and can make mistakes. Please double-check responses.

💡 No install? Use cloud.anythingmcp.com directly. Sign in, click Connectors → OneDrive (Microsoft 365), paste your credentials, mint an MCP API key and you're done. No Docker, no git clone, no local server.

Microsoft OneDrive + Claude

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

Prerequisites

See the full setup instructions baked into the connector (visible in the in-app store when you select the connector). The required environment variables for this connector are:

MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET, MICROSOFT_TENANT_ID

Step 1 — Get credentials

  1. Open the Microsoft Entra admin center (entra.microsoft.com) or the Azure portal and go to Applications → App registrations → New registration.

  2. Name the app (for example "AnythingMCP Microsoft 365") and choose the Supported account types. The choice decides what goes into MICROSOFT_TENANT_ID:

    • Accounts in this organizational directory only (single tenant): only users of your organisation can sign in. Use the Directory (tenant) ID from the app's Overview page (a GUID) or your domain, such as contoso.onmicrosoft.com.
    • Accounts in any organizational directory (multi-tenant): use organizations.
    • Accounts in any organizational directory and personal Microsoft accounts: use common (work, school and personal accounts) or consumers (personal accounts only).

    If the value does not match the account type, Microsoft refuses the sign-in (AADSTS50194 or AADSTS50020).

  3. Under Redirect URI, pick the platform Web and enter https://cloud.anythingmcp.com/api/mcp-oauth/callback. If you host AnythingMCP yourself, enter https://your-anythingmcp-host/api/mcp-oauth/callback instead. The URI must match character for character, otherwise Microsoft answers AADSTS50011.

  4. Open API permissions → Add a permission → Microsoft Graph → Delegated permissions and add offline_access, User.Read and Files.ReadWrite. offline_access is what makes Microsoft issue a refresh token; without it the connector stops an hour after you authorize it.

  5. Open Certificates & secrets → New client secret. Copy the secret Value, not the Secret ID; it is shown only once. Note the expiry date: when the secret expires, the connector stops working until you create a new one and paste it in.

  6. Paste the Application (client) ID from the Overview page into MICROSOFT_CLIENT_ID, the secret value into MICROSOFT_CLIENT_SECRET and the tenant value from step 2 into MICROSOFT_TENANT_ID, then install the connector.

  7. On the connector page, click Authorize with Provider and sign in with the account whose OneDrive the AI should work with. The refresh token is stored encrypted, and access tokens (valid for about an hour) are renewed automatically.

  8. Start with onedrive_get_drive: it shows which OneDrive the connector is signed in to and how much storage is left.

One Entra app for all Microsoft connectors: the app registration you made for the Outlook, SharePoint or Excel connector works here too. Open it, add the permission from step 4 under API permissions, keep the same redirect URI and reuse the same client ID, secret and tenant. Each connector asks only for its own permissions when you authorize it:

  • Outlook: Mail.ReadWrite, Mail.Send, Calendars.ReadWrite
  • OneDrive: Files.ReadWrite
  • Excel: Files.ReadWrite (plus Files.ReadWrite.All for workbooks in SharePoint or shared with you)
  • SharePoint: Sites.ReadWrite.All and Files.ReadWrite.All

All of them also need offline_access and User.Read.

Admin consent: these delegated permissions normally do not need an administrator, but many organisations turn off user consent. If the sign-in shows "Need admin approval" (AADSTS65001 or AADSTS90094), a tenant administrator opens the app registration once and clicks API permissions → Grant admin consent for the organisation. After that every user can authorize. Each connector still works only with what the account that signed in may see.

Files shared with you: Files.ReadWrite covers your own OneDrive. To open files that other people shared with you, add Files.ReadWrite.All to the app registration, replace Files.ReadWrite with it in the connector's OAuth settings and authorize again.

Read-only setup: replace the scopes in the connector's OAuth settings with offline_access User.Read Files.Read (or Files.Read.All), authorize again and disable onedrive_create_folder, onedrive_upload_text_file, onedrive_replace_file_content, onedrive_copy_item, onedrive_rename_item and onedrive_move_item.

Switched off at install: onedrive_delete_item, onedrive_create_sharing_link and onedrive_invite. Sharing links and invitations are off on purpose: they give other people access to your files, and a document the AI reads could contain text asking it to share something. Turn a tool on only if the AI really needs it. Deleted items go to the OneDrive recycle bin and can be restored from there.

Files and content: the connector lists, searches and describes files, but it does not download them: the AI gives you the file's link instead. It can create text files (.txt, .md, .csv, .json, .html, .xml) of up to about 4 MB and overwrite them; OneDrive keeps the previous content in the file's version history. For the cells of Excel workbooks, use the Microsoft Excel connector.

Common errors: 401 InvalidAuthenticationToken means the authorization was revoked or the client secret expired; paste a new secret if needed and click Authorize with Provider again. 403 accessDenied means a permission from step 4 is missing or was not consented, or you may not change that item. 404 itemNotFound means the id or path is wrong, the item was deleted or it lives in someone else's drive. 409 nameAlreadyExists means an item with that name is already in the folder. 423 resourceLocked means the file is open for editing or checked out.

The connector does not download file content, upload binary files or files over 4 MB, restore versions, empty the recycle bin or open other users' OneDrives and SharePoint libraries (the Microsoft SharePoint connector covers those).

Step 2 — Install the adapter

curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d

Step 3 — Add the connector in Claude

Your server URL: in AnythingMCP, open MCP Servers → the server this connector is on, and copy its URL (https://cloud.anythingmcp.com/mcp/…). Use it wherever this guide shows YOUR_SERVER_ID.

Recommended path: works on claude.ai web without editing any config file.

  1. In Claude, open Customize → Connectors.
  2. Click +, then Add custom connector.
  3. Enter a name, e.g. Microsoft OneDrive, and the remote MCP server URL https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID, then click Add.
  4. Click Connect and sign in to AnythingMCP (OAuth) to allow access.

All tools below appear in your chat: start typing prompts.

Available tools

ToolWhat it does
onedrive_get_driveGet the signed-in user's OneDrive: drive id, type (personal, business), owner, storage quota (total, used, remaining, deleted, state) and…
onedrive_list_rootList the files and folders at the top of the user's OneDrive: id, name, size, dates, who changed it last, folder child count or file…
onedrive_list_folderList the files and folders inside one folder, addressed by its id
onedrive_list_folder_by_pathList the files and folders inside a folder addressed by its path from the top of the OneDrive, e.g. "Documents/Reports"
onedrive_get_itemGet one file's or folder's metadata by id: name, size, dates, creator and last modifier, parent folder (parentReference with driveId, id…
onedrive_get_item_by_pathGet one file's or folder's metadata by its path from the top of the OneDrive, e.g. "Documents/Budget 2026.xlsx"
onedrive_get_shared_itemGet the metadata of an item in another drive, typically a file someone shared with the user: pass remoteItem.parentReference.driveId and…
onedrive_searchSearch the user's own OneDrive for files and folders whose name, metadata or content matches the text
onedrive_search_sharedSearch the user's OneDrive and the files other people shared with the user
onedrive_create_folderCreate a folder inside a parent folder (default: the top of the OneDrive)
onedrive_upload_text_fileCreate a new text file (.txt, .md, .csv, .json, .html, .xml...) with the given content in a folder, in one call, up to about 4 MB
onedrive_replace_file_contentOverwrite the content of an existing text file with new text (up to about 4 MB)
onedrive_copy_itemCopy a file or folder (with its contents) into a folder, optionally under a new name
onedrive_rename_itemRename a file or folder in place
onedrive_move_itemMove a file or folder into another folder of the same OneDrive, optionally renaming it on the way
onedrive_delete_itemDelete a file or folder (a folder with its contents)
onedrive_list_permissionsList who has access to a file or folder: each permission's id, roles (read, write, owner), the people or groups granted (grantedToV2…
onedrive_create_sharing_linkCreate a sharing link for a file or folder: type "view" or "edit", scope "anonymous" (anyone with the link, if the organisation allows it)…
onedrive_inviteGive people access to a file or folder by email address, with role "read" or "write", and optionally send them an invitation email with a…

Example prompts

  • "What's in my Documents/Reports 2026 folder, and which files changed this week?"
  • "Find the files about the Hamburg trade fair, including the ones colleagues shared with me."
  • "Create a folder Q4 Planning and save these meeting notes in it as notes.md."
  • "Who has access to the Contracts folder, and does it have any sharing links?"

FAQ

Does it work with Claude Code as well as Claude Desktop? Yes, point both at https://cloud.anythingmcp.com/mcp/YOUR_SERVER_ID.

Next steps

Was this guide helpful?

Your OneDrive agent is one click away.

Install the connector, paste the key, prompt Claude. Free for 7 days, no credit card.

Related guides

Connectors

How to Connect Microsoft OneDrive to ChatGPT via MCP

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

Connectors

How to Connect Microsoft OneDrive to Cursor via MCP

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

Connectors

How to Connect Microsoft OneDrive to Gemini via MCP

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

Connectors

How to Connect Microsoft OneDrive to Meta Muse via MCP

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

Connectors

Microsoft OneDrive to MCP: Drive Microsoft OneDrive from any AI Agent

Let your AI work in OneDrive: browse and search files and folders, see details and who has access, create folders, upload and update text files, copy, rename and move. OneDrive for work or school and personal OneDrive through Microsoft Graph, signed in with your Microsoft account.

Connectors

How to Connect Canva to Claude via MCP

Let your AI work in Canva: find and read designs, create new ones, export them to PDF, PNG, PowerPoint or video with download links, organise folders, upload images from a link, read brand templates and comment on designs.