Share via


Microsoft SharePoint and OneDrive MCP Server reference

Important

You need to be part of the Frontier preview program to get early access to Microsoft Agent 365. Frontier connects you directly with Microsoft’s latest AI innovations. Frontier previews are subject to the existing preview terms of your customer agreements. As these features are still in development, their availability and capabilities may change over time.

Overview

Server ID Display name Description
mcp_ODSPRemoteServer Microsoft SharePoint and OneDrive MCP Server MCP server providing tools for working with your SharePoint and OneDrive content. This server connects to your tenant-specific SharePoint Online MCP server. It automatically discovers and makes available all tools that support OneDrive and SharePoint files integration exposed by the ODSP MCP endpoint.

Available tools

createFolder

Creates a new folder within a specified Document Library as a child of the specified parent folder. If you don't specify a Document Library, the server uses the user's OneDrive. If you don't specify a parent folder, the server creates the folder at the root. If a folder already exists with the same name, the server creates the new folder with a numeric suffix, such as NewFolder (1).

Required parameters:

  • folderName (string) – Name of the folder to create. If a folder with the same name already exists, the server adds a numeric suffix to the new folder name, such as NewFolder (1).
  • documentLibraryId (string) – ID of the Document Library (also called a Drive) where you want to create the folder. If you want to create a folder in the user's drive or their OneDrive, such as "my drive" or "my onedrive," send "me" as the documentLibraryId.

Optional parameters:

  • parentFolderId (string, default = "root") – ID of the parent folder under which the new folder will be created. Defaults to the root of the document library if not specified.

findSite

Finds SharePoint sites that the user can access. This tool can either find a specific site based on a search query you provide, or find the top 20 relevant sites accessible by the user if you don't provide a search query.

Required parameters:

None

Optional parameters:

  • searchQuery (string, default = null) – Search query that can be the entire or partial site name. Providing a search query helps efficiently search for a site, but only if the user is looking for a specific site. For example, if the user asks for a site called xyz, you would pass xyz as the searchQuery. If the user just asks for "my sites," you leave this parameter empty.

listDocumentLibrariesInSite

Lists Document Libraries (also called Drives) in the specified SharePoint site. If you don't specify a site, the server uses the root site.

Required parameters:

None

Optional parameters:

  • siteId: Site ID (default: root)

findFileOrFolder

Finds a file or a folder (also called a DriveItem) that the user can access by passing a search query.

Required parameters:

  • searchQuery: Search query that can be the entire or partial file name

renameFileOrFolder

Rename a file or a folder (also referred to as DriveItems) within the specified Document Library. Note: The new name must comply with naming conventions.

Required parameters:

  • documentLibraryId: Document Library ID (string)
  • fileOrFolderId: File or Folder ID (string)
  • newFileOrFolderName: New name for the file or folder (string)

deleteFileOrFolder

Delete a file or a folder from the specified Document Library.

Required parameters:

  • documentLibraryId: Document Library ID (string)
  • fileOrFolderId: File or Folder ID (string)

readSmallTextFile

Read (download) a text file from a specific Document Library. If you don't specify a Document Library, the user's OneDrive is used. You need to provide a fileId (driveItemId of a File) to identify and download the file.

Required parameters:

  • fileId (string)
  • documentLibraryId (string) – Id of the Document Library (also called as a Drive) of the file you want to read. If user asks you to read or download a file in their drive or their Onedrive for example - Read a file in "my drive", Read a file in "my onedrive" you should send in "me" as the documentLibraryId.

moveSmallFile

Move a file located in the specified Document Library to another folder. This tool only supports move for files less than 5 MB and moves that are within the same site. You can't move files between Drives by using this request.

Required parameters:

  • documentLibraryId (string) – Id of the Document Library (also called as a Drive) of the file you want to move. If user asks you to move a file in their drive or their Onedrive for example - Move a file in "my drive", Move a file in "my onedrive" you should send in "me" as the documentLibraryId.
  • fileId (string) – Id of the file to move
  • newParentFolderId (string) – The ID of the target folder to move the file into. Should be in the same document library as the original location of the file.

getFileOrFolderMetadata

Get metadata of a file or a folder from the specified Document Library in a Sharepoint Site.

Required parameters:

  • FileOrFolderId (string) – Id of a file or a folder. They're also called DriveItems. And their Id can also be sometimes referred to as a driveItemId.
  • documentLibraryId (string) – Id of the Document Library (also called as a Drive) of the file or folder that you need the metadata of. If user asks you to get a file or folder in their drive or their Onedrive for example - "Get metadata of a file in my drive" or "Get metadata of a folder in my onedrive" you should send in "me" as the documentLibraryId.

createSmallTextFile

Create or upload a text file smaller than 5 MB to a specific Document Library. If you don't specify a Document Library, the user's OneDrive is used. You can upload the file to a specific folder. If you don't specify a folder, the file is uploaded to the root folder.

Required parameters:

  • filename (string) – Name of the file to create
  • contentText (string) – Text content of the file to create
  • documentLibraryId (string) – ID of the Document Library (also called a Drive) for the file. If a user asks you to create a file in their drive or their OneDrive, such as "create a file in my drive" or "create a file in my onedrive," send "me" as the documentLibraryId.

Optional parameters:

  • parentfolderId (string, default = "root") – Folder ID within the drive to add the new file.

getFileOrFolderMetadataByUrl

Get metadata for a file or folder from a sharing URL. Only users with explicit permissions to access the file can get the metadata.

Required parameters:

  • fileOrFolderUrl: (string) – URL of the File or Folder (also referred to as DriveItems). The url isn't redeemed to share it with the user; they must already have explicit access to the file.

shareFileOrFolder

Send a sharing invitation to grant permissions on a file or folder within a specified Document Library. Supports assigning roles and notifying recipients.

Required parameters:

  • documentLibraryId: Document Library ID (string, Required)
  • fileOrFolderId: File or Folder ID (string, Required)
  • recipientEmails: (string[], Required) – Email addresses of recipients to invite. At least one recipient email is required.

Optional parameters:

  • roles (string[]) – Roles to assign to recipients. Accepted values: read, write (write grants both read and write access). Defaults to read role if not specified.
  • sendInvitation (bool, default = true) – Indicates whether to send a sharing invitation. Defaults to true if not specified.
  • message (string, default = "Here's the file we're collaborating on.") – Custom message to include in the invitation email. Defaults to a standard message if not specified.

getFolderChildren

Enumerates the top 20 files and folders within a specified parent folder in a Document Library. If you don't specify a Document Library, the user's OneDrive is used.

Required parameters:

  • documentLibraryId (string) – ID of the Document Library (also called a Drive) for the parent folder. If a user asks you to get files in a folder in their drive or their OneDrive, such as "get files in a folder in my drive" or "get files in a folder in my onedrive," send "me" as the documentLibraryId.

Optional parameters:

  • parentFolderId: (string, default = "root") – ID of the parent folder (DriveItem) whose files and folders are listed. Defaults to the root folder of the Document Library if not specified.

Echo

Sends the message back to the client.

Required parameters:

  • message: Message to send back

setSensitivityLabelOnFile

Set the sensitivity label of a file from the specified Document Library.

Required parameters:

  • documentLibraryId (string) – The document library ID, also known as driveId, of the document library
  • fileId (string) – The file ID, also known as driveItemId, of the file
  • sensitivityLabelId (string) – Required. ID of the sensitivity label to assign, or empty string to remove the sensitivity label.

Optional parameters:

  • assignmentMethod (string, default = "privileged") - The assignment method of the label on the document. Indicates whether the assignment of the label was done automatically, standard, or as a privileged operation (the equivalent of an administrator operation). Possible values are standard, privileged, auto, and unknownFutureValue.
  • justificationText (string, default = "Changed by MCPServer") – Optional. Justification text for audit purposes, and is required when downgrading or removing a label.

getDefaultDocumentLibraryInSite

Get the default Document Library (also called Drive) in a SharePoint Site. If you don't specify a site, the root site is used.

Required parameters:

None

Optional parameters:

  • siteId: Site ID (default: root)

Key features

Folder management

  • Create folders with automatic naming conflict resolution
  • Enumerate folder children (top 20)
  • Move files between folders (within same site)

File operations

  • Create and upload small text files (< 5MB)
  • Read and download text files
  • Rename files and folders
  • Delete files and folders
  • Get file and folder metadata by ID or URL

Site and library discovery

  • Find SharePoint sites by search query
  • List document libraries in a site
  • Get default document library

Sharing and permissions

  • Share files and folders with role assignments
  • Send sharing invitations with custom messages
  • Access control via explicit permissions

Security and compliance

  • Set sensitivity labels on files
  • Support for privileged, standard, and auto assignment methods
  • Justification text for compliance auditing

Integration

  • OneDrive and SharePoint Online support
  • Tenant-specific server connection
  • DriveItem abstraction for files and folders

Notes

  1. Default Document Library is 'me' (user's OneDrive)
  2. Default parent folder is 'root'
  3. Folder name conflicts resolved with numeric suffixes
  4. File moves limited to less than 5 MB and within same site
  5. Sharing URLs require explicit access permissions
  6. DriveItems represent both files and folders
  7. Top 20 limit on folder children enumeration