Google Drive MCP Server
Enables creating, reading, editing, and formatting Google Docs, including text insertion/replacement, paragraph and list styles, renaming, duplication, and revision conflict handling.
Allows searching, listing, and reading files on Google Drive, including personal drives and shared drives, with support for metadata, text files, binaries, and workspace file exports.
Provides tools to create, read, update, and format Google Sheets, including managing tabs, rows, columns, cell ranges, and precondition checks for safe writes.
Allows reading Google Slides presentations by exporting their text content for further processing.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Drive MCP Serversearch my Google Drive for the Q3 budget and read it as a spreadsheet"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
title: "Google Drive MCP Server" date: 2026-08-19 tags:
project/workspace
subproject/tools
type/guide
area/tech
date/2026-08-19
Google Drive MCP Server
A local MCP server for Cursor, Claude Code, and Claude Desktop. Through it, the agent searches for and reads files on Google Drive, creates and edits Google Docs and Google Sheets.
When reading, Google Docs are converted to Markdown, spreadsheets to CSV, and presentations to text. Docs can be edited surgically: insert, replace, styles, headings, lists, rename, duplicate. Sheets — values, formats, tabs, rows, and columns. Works with both personal Drive and Shared drives.
Repository: https://github.com/Stillfrozen/gdrive-mcp
Based on wagnerlabs/gdrive-mcp.
OAuth keys live only on your disk. They never end up in git.
Step-by-step setup in Google Cloud (project, API, Desktop OAuth, test users): docs/INSTALL.ru.md
Quick Start
You need Node.js 18+ (20 is better) and a Google account whose Drive you'll be working from.
git clone https://github.com/Stillfrozen/gdrive-mcp.git
cd gdrive-mcp
./scripts/install.shThe script installs dependencies, builds the project, and walks you through Google Cloud: project, API, consent screen, Desktop client, browser login. At the end it prints a ready-made snippet for the MCP client.
View the steps without making any changes:
./scripts/install.sh --dry-runIf you'd rather click through the Console yourself — the full screen-by-screen breakdown is in docs/INSTALL.ru.md.
Cursor
In ~/.cursor/mcp.json (or .cursor/mcp.json in the project) — only an absolute path:
{
"mcpServers": {
"gdrive": {
"command": "node",
"args": ["/absolute/path/to/gdrive-mcp/dist/index.js"],
"env": {
"GDRIVE_OAUTH_PATH": "/absolute/path/to/gdrive-mcp/credentials/gcp-oauth.keys.json",
"GDRIVE_CREDENTIALS_PATH": "/absolute/path/to/gdrive-mcp/credentials/.gdrive-server-credentials.json"
}
}
}
}The env block is optional if the JSON files live in the repository's credentials/. If the file already has other servers, add "gdrive" inside mcpServers without overwriting the rest.
Next, go to Cursor → Settings → MCP → Reload. The gdrive indicator should turn green.
Claude Code CLI
claude mcp add --scope user gdrive -- node /absolute/path/to/gdrive-mcp/dist/index.js--scope user installs the server globally. To remove it: claude mcp remove gdrive.
Claude Desktop
In claude_desktop_config.json:
{
"mcpServers": {
"gdrive": {
"command": "node",
"args": ["/absolute/path/to/gdrive-mcp/dist/index.js"]
}
}
}Related MCP server: Google Drive MCP Server
Tools
Reading
Tool | What it does |
| Search by full text or Drive query syntax |
| File metadata by ID |
| Contents: Docs → Markdown, Sheets → CSV, Slides → text |
| List of files in a folder, sorting and pagination |
| Spreadsheet tabs and named ranges |
| Doc metadata and optionally structured tab text |
Writing: Sheets
Tool | What it does | Destructive | Idempotent |
| New spreadsheet | No | No |
| Overwrite a cell range | Yes | Yes |
| Add rows below data | No | No |
| Clear values, keep the format | Yes | Yes |
| Format a range | No | Yes |
| New tab | No | No |
| Delete a tab along with its data | Yes | No |
| Rename a tab | Yes | No |
| Insert empty rows or columns | No | No |
| Delete rows or columns with data | Yes | No |
Writing: Docs
Tool | What it does | Destructive | Idempotent |
| Empty Doc, optionally in a specified folder | No | No |
| Insert by position, index, or text anchor | No | No |
| Replace a range or anchor match | Yes | No |
| Replace all exact matches on a tab or throughout the Doc | Yes | Yes |
| Delete a range or anchor match | Yes | No |
| Bold, color, font, link | No | Yes |
| Headings and paragraph alignment | No | Yes |
| Lists: create, change, remove | Yes | Yes |
| Rename a Doc file | Yes | No |
| Duplicate, optionally into a specified folder | No | No |
How values are written to cells
gdrive_update_sheet and gdrive_append_sheet have the value_input_option parameter:
USER_ENTERED(default) — same as input in the Sheets UI. A formula like=SUM(A1:A10)will execute, numbers and dates will be formatted.RAW— as-is. The string=SUM(A1:A10)stays text.
How files are read
gdrive_read_file exports Workspace documents itself:
Source form | What is returned |
Google Docs | Markdown |
Google Sheets | CSV (first tab only) |
Google Slides | Text |
Google Drawings | PNG, essentially metadata |
Text ( | UTF-8 as-is |
Binary (images, PDF, …) | Metadata and a browser link |
For the whole spreadsheet (tabs, structure, writing) use gdrive_get_spreadsheet_info and the Sheets write-tools, not gdrive_read_file.
For Doc paragraphs, heading titles, lists, and anchor-based edits use gdrive_get_document_info. The response includes raw text and displayText without the trailing paragraph line break; displayText is usually safer as an anchor. For the fastest Markdown use gdrive_read_file.
Security model
Several layers: MCP annotations, "read first", plus revisions and anchors for Docs, and a current-value check for Sheets.
1. Tool annotations
Each tool declares MCP annotations. The client can ask for confirmation before a destructive operation. See the Destructive / Idempotent columns in the tables above.
2. Read first, then write
The server remembers which spreadsheets and Docs the agent has already opened in this session.
A spreadsheet is considered read after:
gdrive_read_file(cells as CSV)gdrive_get_spreadsheet_info(structure and tabs)gdrive_create_sheet(the agent just created the file itself)
A Doc is considered read after:
gdrive_read_file(Markdown + revision if Google provided it)gdrive_get_document_info(tabs or structured text)gdrive_create_doc
Any write without that step is rejected:
You must read this spreadsheet before writing to it…
You must read this document before writing to it…
So the agent is less likely to target the wrong file. The list resets on process restart (each MCP session starts fresh).
gdrive_get_file doesn't count here: it's only Drive metadata, not content.
3. Writing to Docs with revision awareness
An edit is tied to the revision the agent read last:
conflict_mode: "strict"(default) — DocsrequiredRevisionId. If the document was edited, the write fails.conflict_mode: "merge"— DocstargetRevisionId. Google merges when possible.
The structured content cache lives in the session after gdrive_get_document_info include_content=true. The anchor tools (gdrive_insert_doc_text, gdrive_replace_doc_text, gdrive_update_doc_paragraph_style, gdrive_update_doc_list) use it while the revision is the same. Otherwise the server takes a fresh snapshot.
For targeted text replacement you can pass parameter expected_text: the server checks before sending that the range contains exactly that string.
For the anchored gdrive_delete_doc_text and gdrive_replace_doc_text, the server itself trims only the final paragraph line break when a match hits the end of a tab. The Docs API can't delete a range with a terminal newline segment. Explicit start_index / end_index don't do that: you must exclude the trailing newline yourself.
4. Precondition for Sheets
gdrive_update_sheet has an optional expected_current_values — a two-dimensional array of the same shape as values. The server reads the cells and compares. A mismatch rejects the write, with the actual content in the error.
Surgical edit (one cell, formula) — pass in
expected_current_values.Bulk operation (a thousand rows) — don't pass it, or you'll double the requests and hit the quota.
include_previous_values: true returns old the values for audit. If expected_current_values is set, old values are always returned.
Rollback
Doc and Sheets edits show up in the Google Workspace version history. You can roll back there.
No tool deletes an entire file from Drive. Destructive operations only happen inside the Doc and inside the spreadsheet. To delete a file, use the Drive UI.
Configuration
Paths to keys can be overridden with environment variables:
Variable | Default | What it is |
|
| OAuth client JSON from Google Cloud |
|
| Stored refresh token |
Updating
After git pull, run upgrade. It rebuilds the project and, if setup-manifest.json gained new APIs or scopes, asks you to do auth again:
cd /path/to/gdrive-mcp
git pull
./scripts/upgrade.shIf the manifest hasn't changed, the script just rebuilds and tells you you're good. Cursor picks up dist/ after MCP Reload. No need to re-register the server.
About scope: the server requests full
drive, not the narrowerdrive.file. That's broader than Google's minimum recommendation, but otherwise you couldn't read any available file, write to, or rename existing Docs (rename, duplicate, edits) and write to existing Docs (rename, duplicate, edits). Thedocumentsscope is needed for structured reads andbatchUpdate.
In Testing status, an external application's refresh token lives for 7 days. Then invalid_grant and you'll need to run npm run auth again. Details and options (Internal / Publish) are in docs/INSTALL.ru.md.
Limitations
gdrive_create_sheetplaces the spreadsheet in the root of Drive. You can't pick a folder.gdrive_read_filereturns CSV from the first tab only for Sheets. Other tabs — viagdrive_get_spreadsheet_info.gdrive_read_filealways returns Markdown for Docs. Tabs, paragraph boundaries, lists, anchors —gdrive_get_document_info.Before changing the formatting and structure of a Doc, first run
gdrive_get_document_info include_content=true.gdrive_replace_all_doc_texttouches the first tab by default. For all tabs you need explicitall_tabs: true.
Development
npm install
npm run dev # tsx, без сборки
npm run build
npm test
npm run test:live # живой Google Doc, нужны сохранённые credentials
npm run test:watchnpm run test:live creates a temporary Doc, inserts text through the same stream as MCP, checks it via gdrive_get_document_info, and finally puts the file in the trash.
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceIntegrates with Google Drive to enable listing, searching, and reading files, plus reading and writing to Google Sheets.9,027284MIT
- AlicenseNot gradedqualityDmaintenanceIntegrates with Google Drive to enable listing, reading, and searching over files, with automatic export of Google Workspace documents to appropriate formats.4,907MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Google Drive files and Google Sheets through search, read, and write operations. Supports automatic conversion of Google Workspace files to readable formats and direct spreadsheet cell updates.9,027MIT
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI agents to efficiently access and process Google Drive documents by converting them to markdown and offering selective content extraction. Features intelligent caching, advanced search capabilities, and respect for Drive permissions to optimize context window usage.
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Securely search and manage workspace context files for AI agents and teams.
Persistent docs and memory for AI agents — read, write, organize & search a shared workspace.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Stillfrozen/gdrive-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server