# OneDrive — how to use (mcp.ai)

OneDrive em linguagem natural: busque, leia, crie, mova e compartilhe arquivos e pastas. A plataforma fornece a aplicação OAuth, você só clica em Conectar e escolhe sua conta Microsoft. Várias contas podem ser conectadas no mesmo MCP.

## Option A — via MCP (recommended)
Remote MCP endpoint (HTTP, streamable): `https://api.mcp.ai/p_one_drive?ms=1788957180000`
Add it as a custom/remote MCP connector in your client (Claude, Cursor, VS Code…), then authenticate when prompted. Once connected, ask the agent to use the server's tools (e.g. `one_drive_copy_item`).

## Option B — via direct REST API
Base URL: `https://api.mcp.ai/api/one_drive`
Auth: `Authorization: Bearer sk_live_…` — create a workspace API key at https://mcp.ai/settings/api-keys
Discover endpoints: `GET https://api.mcp.ai/api/one_drive/_endpoints`

### Endpoints
- `POST https://api.mcp.ai/api/one_drive/copy/item` — Tool to copy a DriveItem (file or folder) to a new location asynchronously. Use when you need to duplicate an item, optionally renaming it or specifying a different parent folder. The operation is asy
  - body: { name?: string, item_id: string, site_id?: string, user_id?: string, drive_id?: string, group_id?: string, children_only?: boolean, parent_reference?: object, conflict_behavior?: string, include_all_version_history?: boolean }
- `POST https://api.mcp.ai/api/one_drive/create/link` — Tool to create a sharing link for a DriveItem (file or folder) by its unique ID. Use when you need to generate a shareable link for an item in OneDrive or SharePoint.
  - body: { type: string, scope?: string, item_id: string, site_id?: string, user_id?: string, drive_id?: string, group_id?: string, password?: string, recipients?: object[], expiration_date_time?: string, retain_inherited_permissions?: boolean }
- `POST https://api.mcp.ai/api/one_drive/delete/item` — Tool to delete a DriveItem (file or folder) by its unique ID from the authenticated user's OneDrive. Use when you need to remove an item from OneDrive. This action moves the item to the recycle bin, n
  - body: { item_id: string, user_id?: string, drive_id?: string, if_match?: string }
- `POST https://api.mcp.ai/api/one_drive/download/file` — Downloads a file from a user's OneDrive using its item ID, which must refer to a file and not a folder. Response contains a content object with the downloaded file, MIME type, and name; raw file data 
  - body: { format?: string, item_id: string, user_id?: string, drive_id?: string, file_name: string, if_none_match?: string }
- `POST https://api.mcp.ai/api/one_drive/get/drive` — Retrieves the properties and relationships of a Drive resource by its unique ID. Use this action when you need to get details about a specific OneDrive, user's OneDrive, group's document library, or a
  - body: { drive_id: string, expand_fields?: string[], select_fields?: string[] }
- `POST https://api.mcp.ai/api/one_drive/get/item` — Retrieves the metadata of a DriveItem by its unique ID. Use this tool to get information about a specific file or folder in OneDrive when you have its ID. If a `drive_id` is not provided, it defaults 
  - body: { item_id: string, drive_id?: string, select_fields?: string[], expand_relations?: string[] }
- `POST https://api.mcp.ai/api/one_drive/get/item/permissions` — Retrieves the permissions of a DriveItem by its unique ID within a specific Drive. Use when you need to check who has access to a file or folder and what level of access they have. Response nests perm
  - body: { select?: string, item_id?: string, site_id?: string, user_id?: string, drive_id?: string, group_id?: string, item_path?: string, page_token?: string, if_none_match?: string }
- `POST https://api.mcp.ai/api/one_drive/get/item/thumbnails` — Tool to retrieve the thumbnails associated with a DriveItem. Use when you need to display visual previews of files. Response contains a `value` array with size keys (`small`, `medium`, `large`); thumb
  - body: { select?: string, item_id: string, site_id?: string, user_id?: string, drive_id?: string, group_id?: string, original_orientation?: boolean }
- `POST https://api.mcp.ai/api/one_drive/get/item/versions` — Tool to retrieve the version history of a DriveItem by its unique ID. Use when you need to access or list previous versions of a file. Version history may be unavailable or empty for folders or items 
  - body: { item_id: string, site_id?: string, user_id?: string, drive_id?: string, group_id?: string }
- `POST https://api.mcp.ai/api/one_drive/get/recent/items` — DEPRECATED: Microsoft has deprecated the `GET /me/drive/recent` endpoint backing this action; it already runs in a degraded state and stops returning data after November 2026. This action is retained 
  - body: { top?: integer, select?: string }
- `POST https://api.mcp.ai/api/one_drive/get/shared/items` — DEPRECATED: Use ONE_DRIVE_SEARCH_DRIVE_ITEMS to find a specific shared file or ONE_DRIVE_LIST_ONEDRIVE_SHARED_ITEMS to list files shared from other people's OneDrive accounts. Microsoft Graph sharedWi
  - body: { allow_external?: boolean }
- `POST https://api.mcp.ai/api/one_drive/get/sharepoint/list/items` — Tool to get the items (list items) within a specific SharePoint list on a site. Use when you need to retrieve data from a SharePoint list.
  - body: { top?: integer, skip?: integer, count?: boolean, expand?: string, filter?: string, select?: string, list_id: string, orderby?: string, site_id: string, page_token?: string }
- `POST https://api.mcp.ai/api/one_drive/get/site` — Retrieves metadata for a specific SharePoint site by its ID. Use this action when you need to get details like display name, web URL, and creation/modification dates for a known SharePoint site.
  - body: { expand?: string, select?: string, site_id: string }
- `POST https://api.mcp.ai/api/one_drive/get/site/page/content` — Gets the content of a modern SharePoint site page. Use when you need to retrieve the details and content of a specific page within a SharePoint site.
  - body: { expand?: string, select?: string, page_id: string, site_id: string }
- `POST https://api.mcp.ai/api/one_drive/invite/user/to/item` — Tool to invite users or grant permissions to a specific item in a OneDrive drive. Use when you need to share a file or folder with other users and define their access level (e.g., read or write).
  - body: { roles: string[], item_id: string, message?: string, site_id?: string, user_id?: string, drive_id?: string, group_id?: string, password?: string, recipients: object[], require_sign_in?: boolean, send_invitation?: boolean, expiration_date_time?: string, retain_inherited_permissions?: boolean }
- `POST https://api.mcp.ai/api/one_drive/list/drives` — Tool to retrieve a list of Drive resources available to the authenticated user, or for a specific user, group, or site. Use when you need to find out what drives are accessible. Returns only drives wi
  - body: { top?: integer, expand?: string, select?: string, orderby?: string, site_id?: string, user_id?: string, group_id?: string, page_token?: string }
- `POST https://api.mcp.ai/api/one_drive/list/item/activities` — Tool to list recent activities for a specific item in a OneDrive drive. Use when you need to track changes or actions performed on a file or folder.
  - body: { item_id: string, drive_id: string }
- `POST https://api.mcp.ai/api/one_drive/list/root/drive/changes` — Tool to list changes in the root of the user's primary drive using a delta token. Use when you need to track file and folder modifications, additions, or deletions in the main OneDrive directory. Firs
  - body: { top?: integer, token?: string, expand?: string, select?: string, drive_id?: string }
- `POST https://api.mcp.ai/api/one_drive/list/sharepoint/list/items/delta` — Tool to track changes to items in a SharePoint list using a delta query. Use when you need to get newly created, updated, or deleted list items without performing a full read of the entire item collec
  - body: { top?: integer, token?: string, expand?: string, select?: string, list_id: string, site_id: string }
- `POST https://api.mcp.ai/api/one_drive/list/site/columns` — Tool to list all column definitions for a SharePoint site. Use this when you need to retrieve the schema or structure of columns within a specific SharePoint site.
  - body: { top?: integer, count?: boolean, expand?: string, filter?: string, select?: string, orderby?: string, site_id: string }
- `POST https://api.mcp.ai/api/one_drive/list/site/items/delta` — Tool to track changes to DriveItems in the default document library of a SharePoint site. Use when you need to get a list of items that have been added, modified, or deleted since a previous state or 
  - body: { top?: integer, token?: string, expand?: string, select?: string, site_id: string }
- `POST https://api.mcp.ai/api/one_drive/list/site/lists` — Tool to list all lists under a specific SharePoint site. Use when you need to enumerate lists within a known site. Returns only Microsoft Graph-supported lists — internal/system lists are excluded, so
  - body: { top?: integer, expand?: string, filter?: string, select?: string, orderby?: string, site_id: string, page_token?: string }
- `POST https://api.mcp.ai/api/one_drive/list/site/subsites` — Tool to list all subsites of a SharePoint site. Use when you need to retrieve a collection of subsites for a given parent site. IMPORTANT: This action only works with organizational Microsoft 365 acco
  - body: { top?: integer, expand?: string, filter?: string, select?: string, orderby?: string, site_id: string, page_token?: string }
- `POST https://api.mcp.ai/api/one_drive/list/subscriptions` — Tool to list the current subscriptions for the authenticated user or app. Use this to retrieve details of existing webhook subscriptions. Results may span multiple drives and resources; filter client-
  - body: { page_token?: string }
- `POST https://api.mcp.ai/api/one_drive/move/item` — Tool to move a file or folder to a new parent folder in OneDrive. Use when you need to reorganize your files or folders by changing their location. You can optionally rename the item during the move. 
  - body: { name?: string, itemId: string, siteId?: string, userId?: string, driveId?: string, groupId?: string, description?: string, parentReference: object }
- `POST https://api.mcp.ai/api/one_drive/onedrive/create/folder` — Creates a new folder in the user's OneDrive with configurable conflict behavior, optionally within a specified parent_folder (by ID or full path from root) which, if not the root, must exist and be ac
  - body: { name: string, user_id?: string, description?: string, parent_folder?: string, conflict_behavior?: string }
- `POST https://api.mcp.ai/api/one_drive/onedrive/create/text/file` — Creates a new plain-text file with specified content in the authenticated user's personal OneDrive, using either the folder's unique ID or its absolute path relative to the user's OneDrive root (paths
  - body: { name: string, folder?: string, content: string, user_id?: string, conflict_behavior?: string }
- `POST https://api.mcp.ai/api/one_drive/onedrive/find/file` — Non-recursively finds an item (file or folder) in a specified OneDrive folder; if `folder` is provided as a path, it must actually exist. Results in large folders may be paginated via `@odata.nextLink
  - body: { name: string, folder?: string, user_id?: string, response_detail?: string }
- `POST https://api.mcp.ai/api/one_drive/onedrive/find/folder` — Finds folders by name within an accessible parent folder in OneDrive, or lists all its direct child folders if no name is specified. Search is non-recursive: only immediate children of `folder` are ch
  - body: { top?: integer, name?: string, expand?: string, folder?: string, select?: string[], orderby?: string, user_id?: string, page_token?: string }
- `POST https://api.mcp.ai/api/one_drive/onedrive/list/items` — Retrieves one page of files and folders as `driveItem` resources from the root of a specified user's OneDrive. Returns up to `top` items plus a `next_page_token`; pass that token back as `page_token` 
  - body: { top?: integer, select?: string[], user_id?: string, page_token?: string }
- `POST https://api.mcp.ai/api/one_drive/onedrive/upload/file` — Uploads a file to a specified OneDrive folder, automatically creating the destination folder if it doesn't exist, renaming on conflict, and supporting large files via chunking.
  - body: { file?: object, folder?: string, site_id?: string, user_id?: string, drive_id?: string, file_name?: string, source_url?: string, verify_ssl?: boolean, description?: string, defer_commit?: boolean, if_match_etag?: string, source_headers?: object, file_system_info?: object, conflict_behavior?: string }
- `POST https://api.mcp.ai/api/one_drive/preview/drive/item` — Generates or retrieves a short-lived, permission-bound embeddable URL for a preview of a specific item. URLs expire and must be regenerated per session — do not cache. Use when you need to display a t
  - body: { page?: string|integer, zoom?: number, item_id: string, site_id?: string, user_id?: string, drive_id?: string, group_id?: string, share_id?: string }
- `POST https://api.mcp.ai/api/one_drive/search/items` — Search OneDrive for files and folders by keyword. Searches filenames, metadata, and file content to find matching items. Use when you need to find specific files based on keywords, file types, or cont
  - body: { q: string, top?: integer, expand?: string, select?: string, orderby?: string, drive_id?: string, page_token?: string, search_scope?: string, stripped_annotations?: string[], transformed_path_query?: string, transformed_kql_operator?: string, transformed_parent_query?: string, transformed_wildcard_query?: string }
- `POST https://api.mcp.ai/api/one_drive/update/drive/item/metadata` — Tool to update the metadata of a specific item (file or folder) in OneDrive. Use this to rename items, change descriptions, or move items to a new parent folder.
  - body: { name?: string, item_id: string, site_id?: string, user_id?: string, drive_id?: string, group_id?: string, if_match?: string, description?: string, file_system_info?: object, parent_reference_id?: string, parent_reference_drive_id?: string }

## Example prompts
- "Liste os arquivos modificados na última semana"
- "Procure planilhas com 'orçamento' no nome e me dê os links"
- "Crie uma pasta 'Contratos 2026' e mova os PDFs recentes pra lá"

## More
- Page: https://mcp.ai/one_drive
- Agent spec (llms.txt): https://mcp.ai/one_drive/llms.txt
- Postman collection: https://mcp.ai/one_drive/postman.json
