Google Drive MCP Server

Self-hosted MCP server for Google Drive, Docs, Sheets, Slides and Calendar with 130 tools

By Piotr Agier (individual) TypeScript Local · stdio Files and storageProductivityData and analytics

65 popularity score ★ 235 ↓ 7.9k/wk

Connect your client

Local (npm)

Add in one click

Opens the app, which asks before it adds the server.

Or add it by command or config

FirstTerminal
npx -y @piotr-agier/google-drive-mcp auth
Claude CodeTerminal
claude mcp add google-drive -- npx -y @piotr-agier/google-drive-mcp
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "google-drive": {
      "command": "npx",
      "args": [
        "-y",
        "@piotr-agier/google-drive-mcp"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "google-drive": {
      "command": "npx",
      "args": [
        "-y",
        "@piotr-agier/google-drive-mcp"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "google-drive": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@piotr-agier/google-drive-mcp"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.google-drive]
command = "npx"
args = ["-y", "@piotr-agier/google-drive-mcp"]
Gemini CLITerminal
gemini mcp add --scope user google-drive npx -- -y @piotr-agier/google-drive-mcp
Local (from source)

Add in one click

Opens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.

Or add it by command or config

FirstTerminal
git clone https://github.com/piotr-agier/google-drive-mcp.git
cd google-drive-mcp
npm install
npm run build
npm run auth
Claude CodeTerminal
claude mcp add google-drive -- node '<ABSOLUTE_PATH_TO_CLONE>/dist/index.js'
Claude Desktopclaude_desktop_config.json
{
  "mcpServers": {
    "google-drive": {
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
      ]
    }
  }
}
Cursor~/.cursor/mcp.json
{
  "mcpServers": {
    "google-drive": {
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
      ]
    }
  }
}
VS Code.vscode/mcp.json
{
  "servers": {
    "google-drive": {
      "type": "stdio",
      "command": "node",
      "args": [
        "<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
      ]
    }
  }
}
Codex~/.codex/config.toml
[mcp_servers.google-drive]
command = "node"
args = ["<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"]
Gemini CLITerminal
gemini mcp add --scope user google-drive node -- '<ABSOLUTE_PATH_TO_CLONE>/dist/index.js'

Settings 9

GOOGLE_DRIVE_OAUTH_CREDENTIALS Optional: Path to the OAuth client JSON; defaults to ~/.config/google-drive-mcp/gcp-oauth.keys.json.
GOOGLE_DRIVE_MCP_TOKEN_PATH Optional: Where local OAuth tokens are stored; defaults to ~/.config/google-drive-mcp/tokens.json.
GOOGLE_DRIVE_MCP_SCOPES Optional: Comma-separated scopes to request, such as drive.readonly; the full set by default.
GOOGLE_APPLICATION_CREDENTIALS Optional: Service-account key path; switches to service-account mode.
GOOGLE_DRIVE_MCP_SUBJECT Optional: Workspace user a service account impersonates through domain-wide delegation.
GOOGLE_DRIVE_MCP_ACCESS_TOKEN Optional: Pre-obtained access token; switches to external-token mode.
MCP_TRANSPORT Optional: stdio (default) or http; HTTP listens on 127.0.0.1:3100 unless MCP_HTTP_HOST/MCP_HTTP_PORT are set.
MCP_TEAM_MODE Optional: Turn on multi-user team mode over HTTP; needs MCP_TEAM_ISSUER_URL.
GOOGLE_DRIVE_MCP_DISABLE_RESOURCES Optional: Turn off gdrive:/// resources, leaving tools on.

What it does

Google Drive MCP Server is a community-built Node.js server that connects an MCP client to a Google account's Drive, Docs, Sheets, Slides and Calendar. You run it yourself: locally over stdio for a desktop client, or over Streamable HTTP for a shared deployment.

Its tool reference at v2.12.0 lists 130 tools. On Drive they cover searching, listing folders and Shared Drives, uploading and downloading, moving, copying, deleting, sharing, permissions, revisions and PDF conversion. In Docs they cover tabs, smart chips, footnotes, text and paragraph styling, tables, images and comments. Sheets has value updates, row appends, validation, protected ranges, row and column sizing, and formatting. Slides has text boxes, shapes, speaker notes, thumbnails and slide reordering, and Calendar has event listing, creation, updates and deletion. Drive files can also be read as `gdrive:///` resources unless `--no-resources` is set.

It can sign in four ways. Local OAuth is the default and can hold several Google accounts, and each tool call can pick one with the `account` parameter. A service account can also impersonate a Workspace user through domain-wide delegation. A pre-obtained access token is the third way. Team mode, an HTTP deployment where each member signs in with their own Google account through OAuth 2.1, is the fourth. The configuration guide sets the order: a service account wins, then an external token, then local OAuth.

The docs do not say this in one place: timeout and retry settings (`--api-timeout`, default 120000 ms; `--retry-max`, default 3) apply only to the content insertion in `createGoogleDoc` and to token refreshes, not to every Google API call. 500 and 502 errors are not retried, so a partly applied batch edit is not applied twice (docs/configuration.md).

What it needs

RuntimeNode.js 18+

Node.js 18 or later. A Google Cloud project with the Drive, Docs, Sheets, Slides and Calendar APIs enabled, an OAuth consent screen with your account added as a test user, and a Desktop-app OAuth client whose JSON is saved as ~/.config/google-drive-mcp/gcp-oauth.keys.json (or set GOOGLE_DRIVE_OAUTH_CREDENTIALS to its path). Run `npx -y @piotr-agier/google-drive-mcp auth` once in a browser to store tokens. Without the credentials file the server exits with "OAuth credentials not found". The Docker image is not published: you build it from the clone, after signing in locally.

Limits

Google expires refresh tokens after 7 days for OAuth apps left in Testing status, so you must sign in again unless the app is published. Which tools work depends on the scopes granted: a write tool called with an account that holds only drive.readonly fails with a scope error. Team mode needs HTTP and a public https issuer URL. It cannot be combined with service-account or external-token modes, and it turns off `manage_accounts`, the per-tool `account` parameter and `gdrive:///` resources. An external access token without a refresh token is not renewed and eventually expires. By its makers' choice it covers Drive and the editors, not every Workspace API; no Gmail tools are listed.

Who it suits

It suits someone who wants an assistant to do real editing work in their own Google Workspace (restyle a Doc, format a Sheet, build Slides, book Calendar events) and is willing to set up a Google Cloud project and OAuth client first. Teams can run it as one shared HTTP service in team mode, behind TLS. It is not Google's own server, and it can delete, share and rewrite files, so anyone who only needs to read Drive should limit GOOGLE_DRIVE_MCP_SCOPES to drive.readonly, or pick a smaller read-only server. Anyone who does not want to manage OAuth credentials should look for a hosted option instead.

Tools 40 of 130

search
Search Drive files, 50 results per page by default and up to 100, with optional raw Drive query syntax
listFolder
List the contents of a folder, the root by default
listSharedDrives
List the Shared Drives the account can see
createTextFile
Create a .txt or .md file in Drive
readTextFile
Read a text file stored in Drive
uploadFile
Upload a local file or base64 content, or a new version of an existing file
downloadFile
Save a Drive file to a local path
deleteItem
Delete a file or folder
moveItem
Move a file or folder to another folder
copyFile
Copy a Drive file
createFolder
Create a Drive folder
shareFile
Share a file with a person or group
addPermission
Add a permission to a file
removePermission
Remove a permission from a file
getRevisions
List a file's revisions
restoreRevision
Restore a file to an earlier revision
authGetStatus
Report which Google account and sign-in mode are active
convertPdfToGoogleDoc
Convert a PDF in Drive into a Google Doc
createGoogleDoc
Create a Google Doc with content
readGoogleDoc
Read a Google Doc's text
insertText
Insert text at a position in a Doc
findAndReplaceInDoc
Find and replace text across a Doc
applyTextStyle
Apply character styling to a range in a Doc
insertTable
Insert a table into a Doc
insertLocalImage
Upload a local image to Drive and place it in a Doc
addComment
Add a comment to a Doc
createGoogleSheet
Create a spreadsheet from a 2D array of values
getGoogleSheetContent
Read cell values from a sheet
appendSpreadsheetRows
Append rows to a sheet
formatGoogleSheetCells
Format a range of cells
addGoogleSheetConditionalFormat
Add a conditional formatting rule
createGoogleSlides
Create a presentation
getGoogleSlidesContent
Read the content of a presentation
updateGoogleSlidesSpeakerNotes
Change a slide's speaker notes
exportSlideThumbnail
Export an image of a slide
listCalendars
List the account's calendars
getCalendarEvents
List events in a calendar
createCalendarEvent
Create a calendar event
deleteCalendarEvent
Delete a calendar event
manage_accounts
List, add, remove or set the default connected Google account (local OAuth only)

Similar servers