Skip to main content
Glama

drive-mcp

MCP server for Google Drive and OneDrive operations.

Tools

Tool

Description

gdrive_list_folder

List files in a Google Drive folder by name or folder_id

gdrive_list_folder_recursive

Recursively list files in a folder and subfolders

gdrive_list_shared_drives

List Shared Drives visible to the account

gdrive_search

Search Google Drive by filename (includes Shared Drives)

gdrive_read_file

Read file contents from Google Drive

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_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

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.

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 Drive credentials: place OAuth desktop client JSON at drive_credentials.json.

  • OneDrive credentials: defaults in src/onedrive.py use a public device-flow app registration.

  • Bootstrap auth once:

venv/bin/python -c "from src import google_drive; google_drive.authenticate()"
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

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers