mcp-google-sheets
Read, write, format and share Google Sheets spreadsheets and browse Google Drive folders from an MCP client
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
Opens the app, which asks before it adds the server.
npx -y @piotr-agier/google-drive-mcp authclaude mcp add google-drive -- npx -y @piotr-agier/google-drive-mcp{
"mcpServers": {
"google-drive": {
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}{
"mcpServers": {
"google-drive": {
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}{
"servers": {
"google-drive": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@piotr-agier/google-drive-mcp"
]
}
}
}[mcp_servers.google-drive]
command = "npx"
args = ["-y", "@piotr-agier/google-drive-mcp"]gemini mcp add --scope user google-drive npx -- -y @piotr-agier/google-drive-mcpOpens the app, which asks before it adds the server. Then replace each <NAME> in its settings with your value.
git clone https://github.com/piotr-agier/google-drive-mcp.git
cd google-drive-mcp
npm install
npm run build
npm run authclaude mcp add google-drive -- node '<ABSOLUTE_PATH_TO_CLONE>/dist/index.js'{
"mcpServers": {
"google-drive": {
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
]
}
}
}{
"mcpServers": {
"google-drive": {
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
]
}
}
}{
"servers": {
"google-drive": {
"type": "stdio",
"command": "node",
"args": [
"<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"
]
}
}
}[mcp_servers.google-drive]
command = "node"
args = ["<ABSOLUTE_PATH_TO_CLONE>/dist/index.js"]gemini mcp add --scope user google-drive node -- '<ABSOLUTE_PATH_TO_CLONE>/dist/index.js'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. |
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).
| Runtime | Node.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.
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.
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.
searchlistFolderlistSharedDrivescreateTextFilereadTextFileuploadFiledownloadFiledeleteItemmoveItemcopyFilecreateFoldershareFileaddPermissionremovePermissiongetRevisionsrestoreRevisionauthGetStatusconvertPdfToGoogleDoccreateGoogleDocreadGoogleDocinsertTextfindAndReplaceInDocapplyTextStyleinsertTableinsertLocalImageaddCommentcreateGoogleSheetgetGoogleSheetContentappendSpreadsheetRowsformatGoogleSheetCellsaddGoogleSheetConditionalFormatcreateGoogleSlidesgetGoogleSlidesContentupdateGoogleSlidesSpeakerNotesexportSlideThumbnaillistCalendarsgetCalendarEventscreateCalendarEventdeleteCalendarEventmanage_accounts