# Google Drive MCP [Health: Active]

**Category:** 📂 File Systems  
**Repository:** https://github.com/piotr-agier/google-drive-mcp  
**GitHub Stars:** 240  
**npm Downloads (last month):** 25823  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/google-drive-mcp-2

## Description
Secure access to Google Drive, Docs, Sheets, Slides, and Calendar through MCP.

## Tools
Capabilities this server exposes over MCP:

- **search** — Search for files in Google Drive. Results are sorted most-recently-modified first by default; use orderBy for a different order. Set rawQuery=true to pass a raw Google Drive API query supporting operators like modifiedTime, createdTime, mimeType, name contains, etc.
- **createTextFile** — Create a new text or markdown file
- **updateTextFile** — Update an existing text or markdown file
- **readTextFile** — Read content of a text file (any text/* MIME type, e.g. text/plain, text/markdown, text/csv). For Google Docs, use readGoogleDoc.
- **createFolder** — Create a new folder in Google Drive
- **listFolder** — List contents of a folder (defaults to root)
- **listSharedDrives** — List available Google Shared Drives
- **deleteItem** — Move a file or folder to trash (can be restored from Google Drive trash)
- **renameItem** — Rename a file or folder
- **moveItem** — Move a file or folder
- **copyFile** — Creates a copy of a Google Drive file or document
- **uploadFile** — Upload a file (any type: image, audio, video, PDF, etc.) to Google Drive, either from a local path on the server or from base64-encoded content. When fileId is provided, uploads the content as a new version of that existing file (in-place update) instead of creating a new file.
- **downloadFile** — Download a Google Drive file to a local path. For Google Workspace files (Docs, Sheets, Slides, Drawings), exports to the specified format. For regular files, downloads as-is. Streams directly to disk.
- **listPermissions** — List sharing permissions for a file
- **addPermission** — Add a sharing permission to a file. If the principal already holds a permission on the file, Drive updates that permission instead of creating a second one, and the requested role is applied even when it is a downgrade (asking for 'reader' for an existing 'writer' leaves them as 'reader'). Provide emailAddress for type 'user'/'group', domain for type 'domain', and neither for 'anyone'.
- **updatePermission** — Update an existing permission role
- **removePermission** — Remove a permission from a file (by permissionId or emailAddress)
- **shareFile** — Convenience wrapper to share a file with a user email. If the user already holds a permission on the file, that permission's role is set to the requested one (even when it is a downgrade) instead of creating a duplicate.
- **convertPdfToGoogleDoc** — Convert an existing PDF in Drive into an editable Google Doc
- **bulkConvertFolderPdfs** — Convert all PDFs in a folder into Google Docs and return per-file results
- **uploadPdfWithSplit** — Upload PDF and optionally split into chunked parts (metadata split plan for now)
- **getRevisions** — List revisions for a file
- **restoreRevision** — Restore a file to a selected revision (creates a new head revision). Note: workspace files (Docs, Sheets, Slides) are restored via export/import and may lose some formatting.
- **manage_accounts** — Manage connected Google accounts. action='list' shows all connected accounts (no secrets). action='add' starts an OAuth flow for a new account identified by account_id (alias). action='remove' deletes local tokens for an account. action='set_default' picks which account is used when tool calls omit the `account` parameter.
- **authGetStatus** — Show authentication/token status and scope diagnostics
- **authListScopes** — List configured/requested scopes and currently granted scopes
- **authTestFileAccess** — Run auth diagnostics against Drive API/file access
- **createShortcut** — Create a shortcut (link) to a file or folder in Google Drive. Useful for referencing the same document from multiple locations without duplicating it.
- **lockFile** — Lock a file to prevent editing by setting content restrictions. The file remains readable but cannot be modified until unlocked.
- **unlockFile** — Unlock a previously locked file by removing content restrictions, restoring full edit access.
- **createGoogleDoc** — Create a new Google Doc
- **createDocFromHTML** — Create a Google Doc from HTML content in a single Drive API call. HTML tags are converted to native Google Doc styles: <h1> → Heading 1, <h2> → Heading 2, <p> → Normal Text, <b> → bold, <i> → italic, <ul>/<ol> → lists, <table> → tables. Useful when you want native heading/list/table styling applied in one request instead of a createGoogleDoc call followed by per-paragraph formatGoogleDocParagraph requests.
- **updateGoogleDoc** — Update an existing Google Doc (replaces all content). The replacement is one atomic batchUpdate, so a failure leaves the document unchanged rather than wiped. For multi-tab docs, specify tabId to replace a single tab's content; leaves other tabs untouched.
- **insertText** — Insert text at a specific index (surgical edit, doesn't replace whole file). Works on Google Docs and text/* files (e.g. text/plain, text/markdown). Index semantics differ by file type: Google Docs use the Docs API's 1-based structural position (includes structural elements); text files use a 0-based Unicode code point (character) offset into the file content. For multi-tab Google Docs, specify tabId to target a specific tab — tabId is not supported on text files.
- **deleteRange** — Delete content between start and end indices. Works on Google Docs and text/* files (e.g. text/plain, text/markdown). Index semantics differ by file type: Google Docs use the Docs API's 1-based structural position (includes structural elements); text files use 0-based Unicode code point (character) offsets into the file content. For multi-tab Google Docs, specify tabId to target a specific tab — tabId is not supported on text files.
- **readGoogleDoc** — Read content of a Google Doc with format options. Supports multi-tab documents. Text/markdown output leads with the document's revisionId — pass it as ifRevisionId on write tools for an optimistic lock.
- **readGoogleDocPaginated** — Read a portion of a Google Doc with pagination support. Use offset and limit to read large documents in chunks, avoiding output size limits.
- **listDocumentTabs** — List all tabs in a Google Doc with their IDs and hierarchy
- **applyTextStyle** — Apply text formatting (bold, italic, color, etc.) to a range or found text. Use EITHER startIndex+endIndex OR textToFind for targeting.
- **applyParagraphStyle** — Apply paragraph formatting — alignment, indents, spacing, named styles, borders (top/bottom/left/right/between), shading, and pagination controls. Use EITHER startIndex+endIndex OR textToFind OR indexWithinParagraph for targeting. The update styles EVERY paragraph overlapping the range, so one call over the whole body with removeBorders: ["all"] strips every paragraph border from a document.
- **formatGoogleDocText** — Apply text formatting (bold, italic, font, color, links, superscript/subscript) to a range or found text in a Google Doc. Alias for applyTextStyle.
- **formatGoogleDocParagraph** — Apply paragraph formatting (alignment, indentation, spacing, heading style, borders, shading) in a Google Doc. Alias for applyParagraphStyle.
- **createParagraphBullets** — Add or remove bullet points / numbered lists on paragraphs in a Google Doc. Target paragraphs by startIndex+endIndex or textToFind. Use bulletPreset='NONE' to remove bullets.
- **findAndReplaceInDoc** — Find and replace text across a Google Document. Dry-run mode counts matches exactly across body, tables, headers, footers, and footnotes. On zero matches the response explains the likeliest lookalike cause (non-breaking spaces, curly quotes, HTML entities, case). For multi-tab docs, specify tabId to scope replacements to a single tab. When replaceText contains a newline, the write is always locked to the revision its matches were located in — even without an explicit ifRevisionId — since the compiled batch targets indices from that read; a concurrent edit fails the call instead of landing at the wrong offsets.
- **listComments** — List all comments in a Google Document
- **getComment** — Get a specific comment with its full thread of replies
- **addComment** — Add a comment quoting a text range, targeted by startIndex+endIndex or by textToFind. The comment appears in the document's comment panel and records the quoted passage. Google Docs does not support margin-anchored comments through any public API, so the comment is unanchored by design; this is a platform limit, not a failure.
- **replyToComment** — Add a reply to an existing comment
- **deleteComment** — Delete a comment from the document
- **getGoogleDocContent** — Get content of a Google Doc with text indices for formatting
- **getGoogleDocContentPaginated** — Get a portion of a Google Doc with text indices for formatting, with pagination support. Use offset and limit to read large documents in chunks.
- **getGoogleDocImage** — Fetch the bytes of an inline image embedded in a Google Doc, keyed by its inline object ID. Returns a native image the model can see (or base64). The doc is re-fetched so the underlying image URL is always fresh — pass the objectId, never a raw contentUri (those expire). Inline images only; floating/anchored images are not supported.
- **insertTable** — Insert a new table with the specified dimensions at a given index. For multi-tab docs, specify tabId to target a specific tab.
- **editTableCell** — Edit the content and/or style of a specific table cell. Requires knowing the table start index. For multi-tab docs, specify tabId to target a table in a specific tab.
- **styleDocTable** — Style a Docs table in one atomic call: cell borders/background/padding/content alignment (whole table via tableStartLocation, or a cell range subset), fixed column widths, and minimum row heights. Get the real tableStartIndex from the table span line readGoogleDoc or getGoogleDocContent prints (tableStartIndex=N) — never compute it from text offsets. removeBorders: ["all"] unboxes the table (width-0 borders). The API resolves shared edges by applying border updates right-to-left then bottom-to-top.
- **insertImageFromUrl** — Insert an inline image into a Google Document from a publicly accessible URL
- **insertLocalImage** — Upload a local image file to Google Drive and insert it into a Google Document
- **listGoogleDocs** — Lists Google Documents from your Google Drive with optional filtering.
- **getDocumentInfo** — Gets detailed information about a specific Google Document.
- **getGoogleDocStyleSummary** — Compact style inventory of a whole document in a few hundred tokens: fonts with their size ladders, named-style counts, text colors, bordered and shaded paragraph locations, a table inventory with real index ranges, and the heading outline. The cheap first read before any formatting work, in place of pulling the full document JSON to answer style questions. Counts cover every tab; locations are prefixed with the tab title on a multi-tab document, since index spaces restart per tab. Reports the document's revisionId, so the same read that gives you the indices gives you the lock to pass as ifRevisionId on the write.
- **describeGoogleDocRange** — Style probe for one spot: the paragraph styles (named style, alignment, borders, shading, indents, spacing, bullets) and text runs (font, size, bold/italic/underline, colors, links) overlapping a range, with the real document index of every paragraph and run so the result feeds straight into applyParagraphStyle or applyTextStyle. Target it with startIndex (optionally endIndex) or with textToFind, not both. Describes one tab's body; headers, footers, and footnotes are separate index spaces and are not included. Reports the document's revisionId, so the same read that gives you the indices gives you the lock to pass as ifRevisionId on the write.
- **addDocumentTab** — Add a new tab in a Google Doc
- **renameDocumentTab** — Rename an existing Google Doc tab
- **insertSmartChip** — Insert a person smart chip (mention) at a document index. Only person chips are supported by the Docs API; date and file chips are read-only.
- **readSmartChips** — Read smart chip-like elements (person mentions, rich links, date chips) from the default tab of a document
- **createFootnote** — Create a footnote in a Google Doc. Footnotes cannot be inserted inside equations, headers, footers, or other footnotes. For multi-tab docs, specify tabId to target a specific tab.
- **createGoogleSheet** — Create a new Google Sheet. By default uses RAW mode which stores values as-is. Set valueInputOption to 'USER_ENTERED' only when you need formulas to be evaluated.
- **updateGoogleSheet** — Update an existing Google Sheet. By default uses RAW mode which stores values as-is. Set valueInputOption to 'USER_ENTERED' only when you need formulas to be evaluated.
- **batchUpdateGoogleSheetValues** — Write many ranges in ONE call via spreadsheets.values.batchUpdate. Ranges may sit on different sheets of the same spreadsheet. Prefer this over repeated updateGoogleSheet calls whenever more than one range changes: N separate writes cost N round trips and N units of the per-minute write quota, while one batch costs one of each.
- **updateGoogleSheetIfUnchanged** — Write cell values only if the guarded area has not changed since you read it, and get back what was overwritten so the change can be undone. Call once with dryRun:true to obtain the fingerprint, then again passing it as expectedFingerprint. IMPORTANT: this is optimistic and NOT atomic. The Sheets API has no compare-and-swap - unlike Docs, where ifRevisionId is enforced by the API itself - so the check happens in this server, and a write landing in the gap between the read and the write (well under a second) is not caught. It catches the case that actually happens: the model changed since you last looked. To undo a write, call again with updates set to the returned preImage and expectedFingerprint set to the returned postFingerprint - nothing else, since guardRanges defaults to the ranges in updates and preImage already carries exactly the ranges that were written. Any cell listed in the returned hazards cannot be restored by feeding preImage back: updates carries strings, so re-writing the string re-interprets it as a formula, a number or a boolean and the cell changes type. Its native userEnteredValue is returned so that you can restore that one cell outside this server - through the Sheets API's own updateCells, or by hand - so an undo that touches a hazard cell needs that cell handled separately. The hazard list is deliberately not exhaustive: text kept as text via a leading apostrophe is only flagged when it reads as a formula, a number, or TRUE/FALSE - date-shaped text (e.g. '2024-01-01') is not detected.
- **getGoogleSheetContent** — Get content of a Google Sheet with cell information. Each row is returned as 'Row N: ' followed by that row's cells separated by tab characters. Returns displayed values by default; set valueRenderOption to 'FORMULA' to read the underlying formulas (e.g. '=SUM(A1:A10)') instead of their results, or 'UNFORMATTED_VALUE' for raw numbers without display formatting. Under UNFORMATTED_VALUE a date or time cell comes back as a spreadsheet serial number (e.g. 45678), not a date string.
- **getGoogleSheetCells** — Read Google Sheets cells as structured data instead of joined text: each cell comes back with its own absolute A1 address, and with the formula the user entered AND the value it evaluates to, in one call. Reads several ranges at once and returns them separately. Use getGoogleSheetContent for a quick human-readable dump of one range. Use this tool whenever the result will be written back, compared to a formula, or spans several ranges.
- **formatGoogleSheetCells** — Format cells in a Google Sheet (background, borders, alignment)
- **formatGoogleSheetText** — Apply text formatting to cells in a Google Sheet
- **formatGoogleSheetNumbers** — Apply number formatting to cells in a Google Sheet
- **setGoogleSheetBorders** — Set borders for cells in a Google Sheet
- **mergeGoogleSheetCells** — Merge cells in a Google Sheet
- **addGoogleSheetConditionalFormat** — Add conditional formatting to a Google Sheet
- **getSpreadsheetInfo** — Gets detailed information about a Google Spreadsheet including all sheets/tabs
- **appendSpreadsheetRows** — Appends rows of data to the end of a sheet in a Google Spreadsheet
- **addSpreadsheetSheet** — Adds a new sheet/tab to an existing Google Spreadsheet
- **addSheet** — Alias for addSpreadsheetSheet (adds a new sheet/tab)
- **listSheets** — List tabs/sheets in a Google Spreadsheet
- **renameSheet** — Rename a sheet/tab by sheetId
- **deleteSheet** — Delete a sheet/tab by sheetId
- **addDataValidation** — Add data validation rules to a sheet range
- **protectRange** — Protect a range in a spreadsheet
- **addNamedRange** — Create a named range
- **addDimensionGroup** — Group a range of rows or columns in a sheet (creates a collapsible outline group). Indices are 0-based and the interval is half-open [startIndex, endIndex) — to group rows 5 through 12 as shown in the UI, pass startIndex: 4, endIndex: 12. Nest groups by adding a second group inside the range of the first.
- **deleteDimensionGroup** — Remove a row or column group from a sheet. The rows/columns themselves are kept; only the grouping is removed. Indices are 0-based and the interval is half-open [startIndex, endIndex). Use listDimensionGroups to read back an existing group's range and pass it in full: the API decrements the group depth of every dimension in the range rather than matching a whole group, so a range that only partially overlaps a group shrinks that group instead of removing it. With a depth-1 group over columns B:E and a depth-2 group over C:D, deleting D:E leaves depth-1 over B:D and depth-2 over C:C.
- **updateDimensionGroup** — Collapse or expand an existing row or column group. Indices are 0-based and the interval is half-open [startIndex, endIndex). Use listDimensionGroups first to find the group's range and depth.
- **listDimensionGroups** — List the row and column groups of a spreadsheet, with each group's range, nesting depth and collapsed state. Ranges are reported as 0-based half-open intervals, exactly as addDimensionGroup, deleteDimensionGroup and updateDimensionGroup take them.
- **listGoogleSheets** — Lists Google Spreadsheets from your Google Drive with optional filtering
- **setColumnWidth** — Set the width (in pixels) of one or more columns in a sheet. Indices are 0-based and the interval is half-open [startColumn, endColumn) — to resize a single column at position 5, pass startColumn: 5, endColumn: 6.
- **setRowHeight** — Set the height (in pixels) of one or more rows in a sheet. Indices are 0-based and the interval is half-open [startRow, endRow) — to resize a single row at position 5, pass startRow: 5, endRow: 6.
- **autoResizeColumns** — Auto-size one or more columns to fit their content. Indices are 0-based and the interval is half-open [startColumn, endColumn) — to auto-fit a single column at position 5, pass startColumn: 5, endColumn: 6.
- **autoResizeRows** — Auto-size one or more rows to fit their content. Indices are 0-based and the interval is half-open [startRow, endRow) — to auto-fit a single row at position 5, pass startRow: 5, endRow: 6.
- **hideSheetDimension** — Hide a range of columns or rows in a sheet (sets hiddenByUser=true). Indices are 0-based and the interval is half-open [startIndex, endIndex) — to hide a single column/row at position 5, pass startIndex: 5, endIndex: 6.
- **showSheetDimension** — Show (unhide) a range of columns or rows in a sheet (sets hiddenByUser=false). Indices are 0-based and the interval is half-open [startIndex, endIndex) — to unhide a single column/row at position 5, pass startIndex: 5, endIndex: 6.
- **createGoogleSlides** — Create a new Google Slides presentation
- **updateGoogleSlides** — Update an existing Google Slides presentation
- **getGoogleSlidesContent** — Get content of Google Slides with element IDs for formatting
- **formatGoogleSlidesText** — Apply text formatting to elements in Google Slides
- **formatGoogleSlidesParagraph** — Apply paragraph formatting to text in Google Slides
- **styleGoogleSlidesShape** — Style shapes in Google Slides
- **setGoogleSlidesBackground** — Set background color for slides
- **createGoogleSlidesTextBox** — Create a text box in Google Slides
- **createGoogleSlidesShape** — Create a shape in Google Slides
- **getGoogleSlidesSpeakerNotes** — Get speaker notes from a specific slide in Google Slides
- **updateGoogleSlidesSpeakerNotes** — Update speaker notes for a specific slide in Google Slides
- **deleteGoogleSlide** — Delete a slide from a presentation
- **duplicateSlide** — Duplicate a slide in a presentation
- **reorderSlides** — Reorder one or more slides in a presentation
- **replaceAllTextInSlides** — Replace all matching text across a presentation. It reaches slides, speaker notes, layouts and masters, so a match on a layout or master changes every slide that uses it. A match can run across paragraphs inside one text box or table cell, never across two. Pass expectedCount to refuse the write when the count differs.
- **exportSlideThumbnail** — Export a slide thumbnail URL
- **insertSlidesImageFromUrl** — Insert an image into a Google Slides slide from a publicly accessible URL
- **getSlideElementInfo** — Get position, size, and transform of all elements on a slide. Returns actual rendered bounds.
- **moveSlideElement** — Move and/or resize an element (image, text box, shape) on a Google Slides slide
- **deleteSlideElement** — Delete an element (image, text box, shape) from a Google Slides slide
- **insertSlidesLocalImage** — Upload a local image file to Google Drive and insert it into a Google Slides slide
- **setSlideVisibility** — Show or hide (skip) slides in one atomic call. Hidden slides are skipped in present mode and PDF export.
- **replaceSlideImage** — Replace an existing image in place, preserving its layering (z-order), position, size, and crop. Unlike delete+insert, which lands the new image on top of the stack, this keeps the image under any overlaid text.
- **setElementZOrder** — Change the stacking order of page elements (updatePageElementsZOrder). Inserted images land on top of the stack and can cover overlay text — send them backward or to the back. All elements must be on the same page.
- **setElementText** — Replace the entire text of one shape/text box by objectId (element-scoped delete+insert in one atomic call). Unlike replaceAllTextInSlides, this cannot hit other slides, masters, or layouts, and does not depend on matching existing text. Pass empty text to clear the element.
- **listCalendars** — List all accessible Google Calendars for the authenticated user
- **getCalendarEvents** — Get events from a Google Calendar with optional filtering
- **getCalendarEvent** — Get a single calendar event by ID
- **createCalendarEvent** — Create a new calendar event. Supports timed events, all-day events, and Google Meet integration.
- **updateCalendarEvent** — Update an existing calendar event
- **deleteCalendarEvent** — Delete a calendar event

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "google-drive-mcp": {
    "command": "npx",
    "args": ["-y","@piotr-agier/google-drive-mcp"]
  }
}
```

## Documentation

## What Google Drive MCP MCP server does

Google Drive MCP connects an MCP client to Google Workspace services through a server you operate. Its focus is Drive-centered automation, with access to Google Drive files, Shared Drives, permissions, revisions, Google Docs, Google Sheets, Google Slides, and Calendar events.

The project provides about 130 targeted tools for reading and changing Workspace data. It can search files, create folders, move content, update sharing settings, edit document text and formatting, work with spreadsheet formatting, create slide content, and manage calendar events. An optional `gdrive:///` resource interface supports direct file reading and discovery.

## How it works

The server can run locally over stdio or as a hosted service over Streamable HTTP. Local use is intended for desktop-style MCP clients and uses an OAuth consent flow. Hosted deployments can use one identity behind access control or team mode, where requests are authenticated through OAuth 2.1.

Google API calls use the configured Google identity and credentials. Local OAuth can support multiple Google accounts, with account selection available per tool. Service accounts and externally managed OAuth tokens are also supported. This makes the deployment model relevant when an agent must act as a personal user, a service identity, or an authenticated member of a shared service.

## Setup and configuration

Create a Google Cloud project and enable the Drive, Docs, Sheets, Slides, and Calendar APIs. Configure the OAuth consent screen, add a test user when required, and create a Desktop app OAuth client. Save the downloaded credential file at `~/.config/google-drive-mcp/gcp-oauth.keys.json`, unless using one of the documented alternative locations.

Run the authentication command with `npx -y @piotr-agier/google-drive-mcp auth`, then complete the browser consent flow. Tokens are stored by default at `~/.config/google-drive-mcp/tokens.json`. Add the server to an MCP client using its `mcpServers` configuration and restart that client before making calls.

For HTTP deployments, configure the transport and authentication model appropriate to the client. Keep the default bind address on `127.0.0.1` unless the service has TLS and access control. Shared deployments should use team mode so each request is authenticated as its caller.

## Tools and capabilities

The Google Drive MCP MCP server supports workflows such as:

- Searching Drive by file attributes and recent changes.
- Creating folders and moving older files into an archive.
- Creating Sheets, Docs, and Slides from a shared report workflow.
- Replacing document content, applying formatting, and adding comments.
- Managing permissions, Shared Drives, revisions, and file metadata.
- Creating Calendar events, including events with Google Meet links and Drive attachments.
- Checking the active Google account through authentication tools.

The tools expose specific operations rather than attempting to cover every Google Workspace API. This makes the available surface centered on Drive and its related editors and calendar workflows.

## Limitations and notes

Credentials, refresh tokens, access tokens, service-account keys, and token storage files must remain private. Use the narrowest OAuth scopes that cover the required operations. In team mode, protect `team-store.json` because it contains members’ Google refresh tokens.

Client support depends on transport and authentication capabilities. Claude Desktop and other local MCP clients, including Gemini CLI, use stdio with local OAuth. Remote clients use Streamable HTTP; the README specifically documents claude.ai custom connectors for team mode. Troubleshooting guidance is provided separately for identity, API, Docker, authentication, and rate-limit problems.

_Full upstream README: https://allmcps.com/mcp/google-drive-mcp-2/readme_

