drive-mcp
This MCP server lets you browse, read, write, organize, share, and undo changes to Google Drive files and access/read OneDrive files.
Google Drive discovery: list folders (shallow/recursive), search file names/contents, list Shared Drives.
Google Drive reading/download: read Docs, Sheets, Slides, PDFs, Office/text files; download or export files to local paths.
Google Drive changes: create/overwrite files, create/append Docs, create folders, rename, move, copy, trash, and share; many mutations support dry-run previews and undo restore tokens.
Google Drive account handling: README documents optional account selection, account-scoped results, and cross-account/unknown-account guidance.
OneDrive: list root/folders, search by name, read text/PDF/Office files, and start/complete reauthentication when signed out.
Provides tools for listing, searching, reading, renaming, and moving files in Google Drive.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@drive-mcp search Google Drive for 'meeting notes'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
drive-mcp
MCP server for Google Drive and OneDrive operations.
Tools
Tool | Description |
| List the Google accounts the server can act on |
| List every item in a Google Drive folder by name, |
| Recursively list files in a folder and subfolders; |
| List Shared Drives visible to the account |
| Search Google Drive file names and contents, every word in any order (includes Shared Drives) |
| Read the text of a Doc, Slides deck, Sheet (first tab), PDF, Office or text file |
| Download a Drive file (or export Docs/Sheets/Slides) to a local path |
| Create/overwrite a text file in Google Drive |
| Create a Google Doc (optionally seeded with text) |
| Append plain text to an existing Google Doc |
| Create a Google Drive folder (optional parent, dry-run, undo) |
| Rename a Google Drive file |
| Move a Google Drive file to another folder |
| Copy a Google Drive file |
| Move a Google Drive file/folder to trash |
| Share a file/folder with a user email ( |
| Undo a prior mutating gdrive_* operation via restore token, in the account that made it |
| List items in OneDrive root |
| List items in a OneDrive folder by path |
| Search OneDrive by filename |
| Read file contents from OneDrive |
Most mutating Google Drive tools accept optional file_id / folder_id arguments
(preferred when known) and support dry_run=True previews. Successful mutations
that can be reversed return a restore_token for gdrive_undo.
Accounts
Every gdrive_* tool takes an optional account email. Omit it for the default
account. The signed-in accounts are named in the server instructions and in the
account parameter's description; gdrive_list_accounts lists them too.
Every result names its account (
gdrive_list_accountslists them all instead): text results start withAccount: <email>, dict results carry"account": "<email>".A tool never crosses accounts silently. When a file or folder looked up by ID, URL or name is not in the chosen account but is in another, the reply is an
InOtherAccounterror whosesuggested_tool_callsholds the same call with that account. When it is in neither, the not-found message names both.An
accountthat is not a signed-in email (a typo,personal,all) is anUnknownAccounterror whosesuggested_tool_callsrepeat the call with the closest email, or once per signed-in account. Nothing runs.gdrive_move/gdrive_copywith the item in one account and the destination folder only in the other answerCrossAccountDestination(Drive cannot move or copy between accounts here), with a folder search in the item's account and agdrive_sharepreview.gdrive_undoacts on the account stored in the restore token.
Inputs
file_id,folder_id,parent_folder_idanddestination_folder_idaccept a bare ID or a pasted Google URL (docs.google.com/{document,spreadsheets,presentation,forms}/d/<id>,drive.google.com/file/d/<id>,drive.google.com/drive/[u/0/]folders/<id>,...?id=<id>). A pasted URL infile_name,folder_nameorgdrive_search'squeryis treated the same way.An argument a tool does not declare is refused with an
UnknownArgumenterror naming the valid arguments and the one meant (path->file_id,spreadsheet_id->file_id,q->query,limit->max_results,content->textforgdrive_append_doc, ...).
Search
gdrive_search matches every word of the query, in any order. Files whose names
match come first (Match: name: an exact name, then folders, then the newest),
then a few whose names hold most of the words, then files whose contents match
(Match: content). Name words match singular and plural; filler words (the,
for, folder, ...) and possessives (X's) are ignored when other words remain.
A Google Sheets hit adds Sheets: pass spreadsheet="<id>" to the gsheets_* tools.
When nothing matches, the reply searches the other account too and either gives
the exact call that finds hits there or lists next steps (fewer words,
gdrive_list_folder).
Listing and reading
Folder listings read every page Drive returns and state the count.
gdrive_list_folder_recursivelists paths with IDs (no links).querykeeps the files whose path holds every word, e.g.query="worksheet". Above 200 files it answers with the file count per subfolder and the narrowing call.gdrive_read_filestarts withFile: <name> (ID <id>, <type>), notes other files with the same name, follows shortcuts, says a Sheet read is its first tab only (with thegsheets_list_tabscall), and ends a cut read with themax_chars/gdrive_download_filecall for the rest. A folder answersIsAFolder(withgdrive_list_folder), an image or other binaryUnsupportedFileType(withgdrive_download_file).gdrive_movepreviews resolve the destination folder;gdrive_sharerefuses a role other thanreader/commenter/writerbefore anything runs.
OneDrive
OneDrive results start with OneDrive account: <user>. While its sign-in has
lapsed, every onedrive_* tool answers OneDriveSignedOut: only the user can
renew it (onedrive_start_reauth gives a code to enter on a Microsoft page,
onedrive_complete_reauth finishes), and the reply names the synced OneDrive
folder on this computer (~/Library/CloudStorage/OneDrive-*) when one exists.
Related MCP server: Google Drive MCP Server
Setup
Prerequisites
Python 3.10+
Google account with Drive API enabled
Microsoft account with Graph API access
Installation
git clone https://github.com/<your-user>/drive-mcp.git
cd drive-mcp
"$(uv python find --system --managed-python 3.13.15)" -m venv --copies venv
venv/bin/python -m pip install -e .Authentication
Google sign-ins live outside the repository in ~/.config/google-accounts
(GOOGLE_ACCOUNTS_DIR relocates it), one token per account, shared with the
other Google MCP servers on this machine:
credentials.json: OAuth desktop client JSON from Google Cloud Console.default: email of the account used when a tool names none (GOOGLE_DEFAULT_ACCOUNToverrides it for one process).<email>.json: that account's token, written by the login command.
Sign in each account once; the first one becomes the default:
venv/bin/python -m src.google_accounts login you@example.com
venv/bin/python -m src.google_accounts listThe server never opens a browser itself: a missing account or scope is reported with the login command to run.
OneDrive uses a public device-flow app registration (defaults in
src/onedrive.py); bootstrap it once:
venv/bin/python -c "from src import onedrive; onedrive.authenticate()"Claude Code Configuration
Add to ~/.claude.json:
{
"mcpServers": {
"drive-mcp": {
"type": "stdio",
"command": "/path/to/drive-mcp/venv/bin/python",
"args": ["/path/to/drive-mcp/run_server.py"]
}
}
}Development
venv/bin/python -c "from src.server import mcp; print([t.name for t in mcp._tool_manager._tools.values()])"
venv/bin/python run_server.pyLicense
MIT
Available Tools
21 toolsgdrive_copyA
Copy a Google Drive file, optionally renaming and/or placing under a new folder.
Discovery: run gdrive_search or gdrive_list_folder first to obtain
file_name / file_id and destination folder values.
Use this for: duplicating a file/template.
Not for: moving the original file — see gdrive_move.
Use dry_run=True to preview the change without committing.
Args: file_name: Name of the file to copy new_name: Optional name for the copy destination_folder: Optional destination folder name destination_folder_id: Optional stable destination folder ID file_id: Optional stable file ID (preferred when known) dry_run: Preview the copy without committing it
Inputs: dry_run, file_id, new_name, file_name, +2 more. Returns: result
gdrive_create_docA
Create a Google Doc in Drive, optionally seeded with plain-text content.
Discovery: run gdrive_search or gdrive_list_folder first to obtain
parent folder name/ID values.
Use this for: creating a Google Doc artifact.
Not for: creating a folder — see gdrive_create_folder.
Not for: writing a plain .md/.txt file — see gdrive_write_file.
Not for: spreadsheets — use gsheets-mcp.
Use dry_run=True to preview the change without committing.
Args: title: Title of the Google Doc content: Optional plain-text content to seed into the Doc parent_folder: Optional parent folder name (defaults to My Drive root) parent_folder_id: Optional stable parent folder ID dry_run: Preview the create without committing it
Inputs: title (required), content, dry_run, parent_folder, +1 more. Returns: result
gdrive_create_folderA
Create a folder in Google Drive.
Discovery: run gdrive_search or gdrive_list_folder first to obtain
parent folder name/ID values when nesting under an existing folder.
Use this for: creating a new folder (optionally under a parent).
Not for: creating a Google Doc — see gdrive_create_doc.
Not for: renaming an existing folder — see gdrive_rename.
Not for: moving an existing folder — see gdrive_move.
Use dry_run=True to preview the change without committing. Use exist_ok=True to return an existing same-named child folder instead of erroring.
Args: folder_name: Name of the folder to create parent_folder: Optional parent folder name (defaults to My Drive root) parent_folder_id: Optional stable parent folder ID exist_ok: If a matching folder already exists under the parent, return it dry_run: Preview the create without committing it
Inputs: folder_name (required), dry_run, exist_ok, parent_folder, +1 more. Returns: result
gdrive_download_fileA
Download a Google Drive file to a local filesystem path.
Google Docs/Sheets/Slides are exported to Office formats (.docx/.xlsx/.pptx). Other files are downloaded in their native binary form.
Discovery: use gdrive_search or gdrive_list_folder first to obtain
file_name / file_id values.
Use this for: saving a Drive file locally for offline/binary use.
Not for: reading text content in-chat — see gdrive_read_file.
Args: local_path: Destination file path, or directory to download into file_name: Name of the file to download file_id: Optional stable file ID (preferred when known) dry_run: Preview the download without writing bytes
Inputs: local_path (required), dry_run, file_id, file_name. Returns: result
gdrive_list_folderA
List files in a Google Drive folder by name or folder_id.
Args: folder_name: Name of the folder to list (e.g., "Stock Investor Accelerator") folder_id: Optional stable folder ID from gdrive_search (preferred when known)
Discovery: use gdrive_search first when the exact folder_name/folder_id is unknown.
Sibling tools: use gdrive_list_folder_recursive to include subfolders and gdrive_read_file to read a discovered file.
Inputs: folder_id, folder_name. Returns: result
gdrive_list_folder_recursiveA
Recursively list all files in a Google Drive folder and its subfolders.
Args: folder_name: Name of the folder to list (e.g., "Stock Investor Accelerator") folder_id: Optional stable folder ID from gdrive_search (preferred when known)
Discovery: use gdrive_search first when the exact folder_name/folder_id is unknown.
Sibling tools: use gdrive_list_folder for a shallow listing and gdrive_read_file to read a discovered file.
Inputs: folder_id, folder_name. Returns: result
gdrive_moveA
Move a file to a different folder in Google Drive.
Discovery: run gdrive_list_folder or gdrive_search first to obtain
file_name / file_id and destination folder values.
Use this for: moving files between folders.
Not for: renaming a file in place — see gdrive_rename.
Use dry_run=True to preview the change without committing.
Args: file_name: Name of the file to move destination_folder: Name of the destination folder dry_run: Preview the move without committing it file_id: Optional stable file ID (preferred when known) destination_folder_id: Optional stable destination folder ID
Inputs: dry_run, file_id, file_name, destination_folder, +1 more. Returns: result
gdrive_read_fileA
Read the contents of a file from Google Drive.
Supports:
Google Docs (exported as plain text)
Google Sheets (exported as CSV)
PDFs (text extracted)
Text files (.txt, .md, .csv, .json, etc.)
Args: file_name: Name of the file to read (e.g., "My Document" or "report.pdf") max_chars: Maximum characters to return (default: 100000) file_id: Optional stable file ID from gdrive_search (preferred when known)
Discovery: use gdrive_search, gdrive_list_folder, or gdrive_list_folder_recursive first to find the exact file_name or file_id.
Inputs: file_id, file_name, max_chars. Returns: result
gdrive_renameA
Rename a file in Google Drive.
Discovery: run gdrive_list_folder or gdrive_search first to obtain
file_name / file_id values.
Use this for: renaming files in place.
Not for: moving a file to a different folder — see gdrive_move.
Use dry_run=True to preview the change without committing.
Args: file_name: Current name of the file to rename new_name: New name for the file dry_run: Preview the rename without committing it file_id: Optional stable file ID (preferred when known)
Inputs: dry_run, file_id, new_name, file_name. Returns: result
gdrive_searchB
Search for files in Google Drive by name (includes Shared Drives).
Args: query: Search term to find in file names max_results: Maximum number of results to return (default: 20)
Inputs: query (required), max_results. Returns: result
gdrive_trashA
Move a Google Drive file or folder to trash.
Discovery: run gdrive_search or gdrive_list_folder first to obtain
file_name / file_id values.
Use this for: soft-deleting a file/folder (recoverable from trash). Not for: permanently deleting — not supported by this server.
Use dry_run=True to preview the change without committing.
Args: file_name: Name of the file/folder to trash file_id: Optional stable file ID (preferred when known) dry_run: Preview the trash without committing it
Inputs: dry_run, file_id, file_name. Returns: result
gdrive_undoA
Undo a prior Drive mutation using its restore_token.
Supports: gdrive_rename, gdrive_move, gdrive_create_folder, gdrive_write_file (create only), gdrive_create_doc, gdrive_copy, gdrive_trash, gdrive_share.
Args: restore_token: Token returned by a mutating gdrive_* tool after commit
Inputs: restore_token (required).
gdrive_write_fileA
Create or overwrite a text/binary-capable file in Google Drive.
Discovery: run gdrive_search or gdrive_list_folder first to obtain
parent folder and optional existing file_id values.
Use this for: writing markdown/text/json/csv files into Drive.
Not for: creating a Google Doc — see gdrive_create_doc.
Not for: spreadsheet edits — use gsheets-mcp.
Use dry_run=True to preview the change without committing. Overwrites only when file_id is provided or overwrite=True finds a same-named file under the parent. Undo trashes newly created files; content overwrites are not undoable via restore_token.
Args: file_name: Destination file name (e.g., "notes.md") content: File contents to write parent_folder: Optional parent folder name (defaults to My Drive root) parent_folder_id: Optional stable parent folder ID mime_type: Optional MIME type (guessed from file_name when omitted) file_id: Optional existing file ID to overwrite overwrite: If True, overwrite an existing same-named file under the parent dry_run: Preview the write without committing it
Inputs: content (required), file_name (required), dry_run, file_id, +4 more. Returns: result
onedrive_complete_reauthB
Check if OneDrive re-authentication completed. Call after user visits URL.
Inputs: no named parameters. Returns: result
onedrive_list_folderA
List items in a OneDrive folder by path.
Args: folder_path: Path to the folder (e.g., "Documents/Projects" or "Stock Investor Accelerator")
Discovery: use onedrive_list_root or onedrive_search first when the exact folder_path is unknown.
Sibling tools: use onedrive_list_root for the top-level folder and onedrive_read_file to read a discovered file.
Inputs: folder_path (required). Returns: result
onedrive_list_rootA
List items in the OneDrive root folder.
Sibling tools: use onedrive_list_folder for nested folders and onedrive_read_file to read a discovered file.
Inputs: no named parameters. Returns: result
onedrive_read_fileA
Read the contents of a file from OneDrive.
Supports:
Text files (.txt, .md, .csv, .json, etc.)
PDFs (text extracted)
Word documents (.docx)
Excel spreadsheets (.xlsx) - exported as CSV-like format
PowerPoint presentations (.pptx)
Args: file_path: Path to the file (e.g., "Documents/report.pdf" or "Stock Investor Accelerator/notes.txt") max_chars: Maximum characters to return (default: 100000)
Discovery: use onedrive_search, onedrive_list_root, or onedrive_list_folder first to find the exact file_path.
Inputs: file_path (required), max_chars. Returns: result
onedrive_searchB
Search for files in OneDrive by name.
Args: query: Search term to find in file names max_results: Maximum number of results to return (default: 20)
Inputs: query (required), max_results. Returns: result
onedrive_start_reauthA
Start OneDrive re-authentication. Returns URL and code for user.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Most tools have clearly distinct actions, and the gdrive_/onedrive_ prefixes separate the two providers cleanly. A few near-overlaps exist (gdrive_list_folder vs gdrive_list_folder_recursive, and gdrive_write_file vs gdrive_create_doc), but the descriptions explicitly disambiguate them.
The provider_verb[_noun] pattern is consistent and readable, e.g., gdrive_create_folder, gdrive_read_file, onedrive_list_folder. Minor deviations exist like verb-only names (gdrive_copy, gdrive_trash, gdrive_undo, gdrive_search), but they do not undermine predictability.
21 tools falls in the heavy range for a single MCP server, though the dual-provider scope explains the size. Each tool has a plausible purpose, but the surface feels larger than a typical well-scoped single-domain server.
The Google Drive side is fairly complete: create, read, search, list, rename, move, copy, trash, share, download, and undo are all covered. The OneDrive side is notably incomplete, offering only list/search/read/reauth with no create, write, rename, move, trash, or share operations.
Maintenance
Related MCP Connectors
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Notes, files, GitHub, and Drive through one MCP connection.
Notes, files, GitHub, and Drive through one MCP connection.
Notes, files, GitHub, and Drive through one MCP connection.
Related MCP Servers
- -licenseNot gradedqualityBmaintenanceThis MCP server integrates with Google Drive to allow listing, reading, and searching over files.5,582 npm92,575MIT
- AlicenseNot gradedqualityDmaintenanceA server that provides a Machine Control Protocol (MCP) interface to search, access, and interact with Google Drive files and folders, enabling AI assistants to work with Google Drive content.8MIT
- AlicenseBqualityDmaintenanceMCP server for Google Drive integration with file management, search, sharing, and full CRUD operations.151,594 npm2MIT
- FlicenseNot gradedqualityDmaintenanceA read-only Google Drive MCP server that allows searching files, reading file content (with auto-export for Google Docs, Sheets, Slides), and retrieving file metadata via OAuth authentication.14 npm4-