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.
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.
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
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.
Setup
-
Open the Microsoft Entra admin center (entra.microsoft.com) or the Azure portal and go to Applications → App registrations → New registration.
-
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) orconsumers(personal accounts only).
If the value does not match the account type, Microsoft refuses the sign-in (AADSTS50194 or AADSTS50020).
- 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
-
Under Redirect URI, pick the platform Web and enter
https://cloud.anythingmcp.com/api/mcp-oauth/callback. If you host AnythingMCP yourself, enterhttps://your-anythingmcp-host/api/mcp-oauth/callbackinstead. The URI must match character for character, otherwise Microsoft answers AADSTS50011. -
Open API permissions → Add a permission → Microsoft Graph → Delegated permissions and add
offline_access,User.ReadandFiles.ReadWrite.offline_accessis what makes Microsoft issue a refresh token; without it the connector stops an hour after you authorize it. -
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.
-
Paste the Application (client) ID from the Overview page into
MICROSOFT_CLIENT_ID, the secret value intoMICROSOFT_CLIENT_SECRETand the tenant value from step 2 intoMICROSOFT_TENANT_ID, then install the connector. -
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.
-
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(plusFiles.ReadWrite.Allfor workbooks in SharePoint or shared with you) - SharePoint:
Sites.ReadWrite.AllandFiles.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).
Prerequisites: MICROSOFT_CLIENT_ID, MICROSOFT_CLIENT_SECRET, MICROSOFT_TENANT_ID
Install the connector locally
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
Open http://localhost:3000/connectors/store, pick OneDrive (Microsoft 365) and paste in the env vars listed under Prerequisites.
Available tools
| Tool | What it does |
|---|---|
onedrive_get_drive | Get the signed-in user's OneDrive: drive id, type (personal, business), owner, storage quota (total, used, remaining, deleted, state) and… |
onedrive_list_root | List 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_folder | List the files and folders inside one folder, addressed by its id |
onedrive_list_folder_by_path | List the files and folders inside a folder addressed by its path from the top of the OneDrive, e.g. "Documents/Reports" |
onedrive_get_item | Get 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_path | Get 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_item | Get the metadata of an item in another drive, typically a file someone shared with the user: pass remoteItem.parentReference.driveId and… |
onedrive_search | Search the user's own OneDrive for files and folders whose name, metadata or content matches the text |
onedrive_search_shared | Search the user's OneDrive and the files other people shared with the user |
onedrive_create_folder | Create a folder inside a parent folder (default: the top of the OneDrive) |
onedrive_upload_text_file | Create 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_content | Overwrite the content of an existing text file with new text (up to about 4 MB) |
onedrive_copy_item | Copy a file or folder (with its contents) into a folder, optionally under a new name |
onedrive_rename_item | Rename a file or folder in place |
onedrive_move_item | Move a file or folder into another folder of the same OneDrive, optionally renaming it on the way |
onedrive_delete_item | Delete a file or folder (a folder with its contents) |
onedrive_list_permissions | List 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_link | Create a sharing link for a file or folder: type "view" or "edit", scope "anonymous" (anyone with the link, if the organisation allows it)… |
onedrive_invite | Give 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?"
Next steps
Was this guide helpful?