Skip to main content
Glama

drive-mcp

MCP server for Google Drive and OneDrive operations.

Tools

Tool

Description

gdrive_list_accounts

List the Google accounts the server can act on

gdrive_list_folder

List every item in a Google Drive folder by name, folder_id or folder URL ("root" is My Drive), folders first

gdrive_list_folder_recursive

Recursively list files in a folder and subfolders; query keeps only paths holding its words

gdrive_list_shared_drives

List Shared Drives visible to the account

gdrive_search

Search Google Drive file names and contents, every word in any order (includes Shared Drives)

gdrive_read_file

Read the text of a Doc, Slides deck, Sheet (first tab), PDF, Office or text file

gdrive_download_file

Download a Drive file (or export Docs/Sheets/Slides) to a local path

gdrive_write_file

Create/overwrite a text file in Google Drive

gdrive_create_doc

Create a Google Doc (optionally seeded with text)

gdrive_append_doc

Append plain text to an existing Google Doc

gdrive_create_folder

Create a Google Drive folder (optional parent, dry-run, undo)

gdrive_rename

Rename a Google Drive file

gdrive_move

Move a Google Drive file to another folder

gdrive_copy

Copy a Google Drive file

gdrive_trash

Move a Google Drive file/folder to trash

gdrive_share

Share a file/folder with a user email (reader/commenter/writer)

gdrive_undo

Undo a prior mutating gdrive_* operation via restore token, in the account that made it

onedrive_list_root

List items in OneDrive root

onedrive_list_folder

List items in a OneDrive folder by path

onedrive_search

Search OneDrive by filename

onedrive_read_file

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_accounts lists them all instead): text results start with Account: <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 InOtherAccount error whose suggested_tool_calls holds the same call with that account. When it is in neither, the not-found message names both.

  • An account that is not a signed-in email (a typo, personal, all) is an UnknownAccount error whose suggested_tool_calls repeat the call with the closest email, or once per signed-in account. Nothing runs.

  • gdrive_move / gdrive_copy with the item in one account and the destination folder only in the other answer CrossAccountDestination (Drive cannot move or copy between accounts here), with a folder search in the item's account and a gdrive_share preview.

  • gdrive_undo acts on the account stored in the restore token.

Inputs

  • file_id, folder_id, parent_folder_id and destination_folder_id accept 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 in file_name, folder_name or gdrive_search's query is treated the same way.

  • An argument a tool does not declare is refused with an UnknownArgument error naming the valid arguments and the one meant (path -> file_id, spreadsheet_id -> file_id, q -> query, limit -> max_results, content -> text for gdrive_append_doc, ...).

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_recursive lists paths with IDs (no links). query keeps 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_file starts with File: <name> (ID <id>, <type>), notes other files with the same name, follows shortcuts, says a Sheet read is its first tab only (with the gsheets_list_tabs call), and ends a cut read with the max_chars / gdrive_download_file call for the rest. A folder answers IsAFolder (with gdrive_list_folder), an image or other binary UnsupportedFileType (with gdrive_download_file).

  • gdrive_move previews resolve the destination folder; gdrive_share refuses a role other than reader/commenter/writer before 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_ACCOUNT overrides 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 list

The 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.py

License

MIT

Available Tools

21 tools
gdrive_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_list_shared_drivesB

List Shared Drives visible to the authenticated Google account.

Sibling tools: use gdrive_search / gdrive_list_folder with folder_id values discovered inside a Shared Drive.

Inputs: max_results. 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_shareA

Share a Google Drive file/folder with a user email.

Discovery: run gdrive_search or gdrive_list_folder first to obtain file_name / file_id values.

Use this for: granting reader/commenter/writer access to a collaborator. Not for: transferring ownership.

Valid roles: reader, commenter, writer. Use dry_run=True to preview the change without committing.

Args: email: Collaborator email address role: Access role — one of reader, commenter, writer file_name: Name of the file/folder to share file_id: Optional stable file ID (preferred when known) send_notification: Whether Google should email the collaborator dry_run: Preview the share without committing it

Inputs: email (required), role, dry_run, file_id, +2 more. 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_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

    A3.7/5.0

    Scored across 21 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness3/5

    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

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers