Microsoft 365 Files

v0.2.2
io.github.mindstone/mcp-server-microsoft-files Checked 3 days ago Published 1 day ago

Microsoft 365 OneDrive files via Graph: list, search, get, upload, download, share, read text.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_files

List files and folders in OneDrive. Defaults to root folder.

ParameterTypeDescription
pathstringFolder path (e.g., "/Documents") or item ID
topintegerMax items to return (default: 50)

get_file

Get metadata for a specific file or folder.

ParameterTypeDescription
pathstringFile path or item ID

download_file

Get a download URL for a file (valid for short period).

ParameterTypeDescription
pathstringFile path or item ID

search_files

Search for files in OneDrive by name or content.

ParameterTypeDescription
querystringSearch query
topintegerMax results (default: 25)

upload_file

Upload a file to OneDrive. Text content up to 4MB; binary content as base64 up to 10MB (uploads over 4MB use a resumable upload session).

ParameterTypeDescription
contentstringFile content (text, or base64 when encoding is "base64")
encodingstringContent encoding (default: utf8). Use "base64" for binary files.
pathstringDestination path including filename (e.g., "/Documents/note.txt")

create_folder

Create a new folder in OneDrive.

ParameterTypeDescription
pathstringFull path for new folder (e.g., "/Documents/NewFolder")

delete_file

Delete a file or folder from OneDrive.

ParameterTypeDescription
pathstringFile/folder path or item ID

move_file

Move a file or folder to a new location.

ParameterTypeDescription
destinationPathstringNew parent folder path
newNamestringOptional new name
sourcePathstringCurrent file/folder path or ID

copy_file

Copy a file or folder to a new location.

ParameterTypeDescription
destinationPathstringDestination folder path
newNamestringOptional new name
sourcePathstringCurrent file/folder path or ID

get_recent

Get recently accessed files.

ParameterTypeDescription
topintegerMax items (default: 25)

get_shared

Get files shared with you by others.

ParameterTypeDescription
topintegerMax items (default: 25)

share_file

Create a sharing link for a file or folder.

ParameterTypeDescription
pathstringFile/folder path or ID
scopestringWho can access (default: organization)
typestringLink type (default: view)

read_text_file

Read the contents of a text file directly.

ParameterTypeDescription
maxSizeintegerMax bytes to read (default: 100KB)
pathstringFile path or ID

invite_to_file

Share a file or folder with specific people by email (grants read or write permission).

ParameterTypeDescription
messagestringOptional note included in the sharing invitation
pathstringFile/folder path or item ID
recipientsarrayEmail addresses to share with
rolestringPermission to grant (default: read)
sendInvitationbooleanEmail the recipients about the share (default: false)

list_file_permissions

List the sharing permissions granted on a file or folder.

ParameterTypeDescription
pathstringFile/folder path or item ID

revoke_file_permission

Revoke a sharing permission from a file or folder. Use list_file_permissions to find the permission ID.

ParameterTypeDescription
pathstringFile/folder path or item ID
permissionIdstringPermission ID from list_file_permissions

list_file_versions

List the version history of a file.

ParameterTypeDescription
pathstringFile path or item ID

restore_file_version

Restore a previous version of a file, replacing the current content. Use list_file_versions to find the version ID.

ParameterTypeDescription
pathstringFile path or item ID
versionIdstringVersion ID from list_file_versions

list_file_activities

List recent activity in your OneDrive, or on a specific file or folder when a path is given. Requires OneDrive for Business or SharePoint; personal OneDrive accounts do not expose activity history.

ParameterTypeDescription
pathstringFile/folder path or item ID (omit for drive-wide activity)

read_document

Extract the text of a Word (.docx) or PowerPoint (.pptx) document directly, without downloading it. Use read_text_file for plain-text files.

ParameterTypeDescription
maxCharsintegerMax extracted characters to return (default: 100000)
maxSizeintegerMax file bytes to download (default: 20MB)
pathstringDocument path or item ID