Google Drive CRUD MCP Server
Provides tools for reading and editing Google Docs documents, including retrieving content and structure, applying batch updates for inserts, styling, tables, and images, and replacing text.
Provides tools for managing Google Drive files and folders, including searching, listing, reading, downloading, uploading, creating, copying, updating, and managing permissions and sharing.
Provides tools for reading and editing Google Sheets spreadsheets, including retrieving values and structure and applying batch updates for formatting, charts, and sheet operations.
Provides tools for reading and editing Google Slides presentations, including retrieving slides and elements and applying batch updates to create slides, insert text and shapes, and place native charts.
Click on "Deploy 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 CRUD MCP Server Create a new Google Doc titled 'Meeting Notes' and share it with me"
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.
Google Drive CRUD MCP Server
Give Claude full read-write access to your Google Drive, Docs, Sheets, and Slides, running on a server you own with Google credentials you control.
CRUD stands for create, read, update, delete - the four things this server lets Claude do to your files, as opposed to read-only access.
Start here if you are not a developer
The Railway button above deploys the server, but it still needs a Google Cloud project and an OAuth client before it will connect to Claude. The guided setup walks through every step, including a copy-paste prompt that has Claude do the Google Cloud and Railway configuration with you:
atlanticlabs.ai/mcp-google-drive
That is the recommended path. The manual instructions further down are for people who would rather run the commands themselves.
Once it is deployed, the connector URL to paste into claude.ai is:
https://<your-railway-domain>/mcpThe /mcp path matters. A request to the bare domain returns an error.
Related MCP server: google-mcp
What it does
The server exposes Google Drive, Docs, Sheets, and Slides to Claude as MCP tools. MCP is the Model Context Protocol, the open standard Claude uses to talk to outside systems.
Drive files
Tool | What it does |
| Query-based search across every drive the account can reach |
| Most recently modified files, excluding trashed ones |
| Metadata for a single file by ID |
| Extract text from Docs, Sheets, PDF, and Office files |
| Raw bytes, returned inline as base64, capped at 25 MB by default |
| Create a file or folder, converting to a native Google type unless told not to |
| Return an upload URL so large files go straight to Google instead of through Claude |
| Import Markdown, DOCX, TXT, HTML, RTF, or ODT and convert to a native Doc |
| List the children of a folder |
| Create a folder |
| Copy a file |
| Rename, move, or trash a file (metadata only, not content) |
| Get a shareable link |
| Inspect who has access |
| Grant or revoke access |
Google Docs
Tool | What it does |
| Read a document's content and structure, including the character indexes needed to edit it |
| Apply a batch of structural edits: insert text, style, tables, images, and so on |
| Replace every occurrence of a string, which is how template filling works |
Google Sheets
Tool | What it does |
| Read a spreadsheet's structure and values |
| Apply batch changes, including native charts, formatting, and sheet operations |
Google Slides
Tool | What it does |
| Read a presentation's slides and elements |
| Apply batch changes: create slides, insert text and shapes, place native charts |
The Docs, Sheets, and Slides tools expose the underlying batch update APIs rather than a simplified wrapper, so Claude can build a formatted document, a real spreadsheet chart, or a slide layout rather than only writing plain text into a file.
How it works
The server runs on your own hosting account and authenticates with your own Google OAuth client. Nothing routes through infrastructure belonging to me or to anyone else.
Your Google Cloud project. You create the OAuth client, so the consent screen names your project and the access tokens are issued to it.
Your server. Railway is the one-click option, but the server is a normal Python application with a Dockerfile and runs anywhere that can run a container.
OAuth 2.1, multi-user. Each person who connects authorizes with their own Google account and sees only their own files. The server validates bearer tokens against Google on every call.
No stored copies of your files. Downloads and inline uploads are held in memory only. When
create_fileis given a URL to fetch from, the bytes are buffered while they transfer: in stateless mode that buffer stays in memory up to 5 MB and spills to a temporary file beyond it, and otherwise it is a temporary file regardless of size. Either way the buffer is deleted when the call ends.Scopes. Drive read and write, Sheets read and write, Slides read and write, plus basic profile and email for identifying the signed-in user. Read-only mode is available and drops the write scopes entirely.
Manual self-host
Prerequisites
Python 3.10 or newer (
.python-versionpins the exact version)The
uvpackage manager:curl -LsSf https://astral.sh/uv/install.sh | shA Google account and a Google Cloud project (the free tier is enough)
1. Configure Google Cloud
In console.cloud.google.com, select or create a project.
Enable the APIs. Under APIs and Services, then Library, enable each of: Google Drive API, Google Docs API, Google Sheets API, Google Slides API.
Configure the OAuth consent screen. Under APIs and Services, then OAuth consent screen:
User type: External, or Internal if you have a Google Workspace organization.
Add yourself under Test users so you can authorize while the consent screen is still in testing mode.
Add these scopes:
openidhttps://www.googleapis.com/auth/userinfo.emailhttps://www.googleapis.com/auth/userinfo.profilehttps://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.readonlyhttps://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/spreadsheetshttps://www.googleapis.com/auth/spreadsheets.readonlyhttps://www.googleapis.com/auth/presentationshttps://www.googleapis.com/auth/presentations.readonly
Create an OAuth 2.0 client ID. Under APIs and Services, then Credentials, choose Create credentials, then OAuth client ID.
Application type: Web application, not Desktop app.
Authorized redirect URI:
http://localhost:8000/oauth2callbackfor local work, orhttps://<your-domain>/oauth2callbackfor a deployed server.Save the client ID and client secret.
2. Configure the environment
cp env.example .envFill in the client ID and secret. The recommended local configuration matches production:
GOOGLE_OAUTH_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=your-client-secret
GOOGLE_OAUTH_REDIRECT_URI=http://localhost:8000/oauth2callback
WORKSPACE_MCP_TRANSPORT=streamable-http
WORKSPACE_MCP_PORT=8000
WORKSPACE_MCP_HOST=0.0.0.0
WORKSPACE_EXTERNAL_URL=http://localhost:8000
MCP_ENABLE_OAUTH21=true
WORKSPACE_MCP_STATELESS_MODE=trueAlways set WORKSPACE_EXTERNAL_URL explicitly on a deployed server. It is the base URL the OAuth endpoints are built from. If it is unset, that base falls back to WORKSPACE_MCP_BASE_URI and the port, which defaults to http://localhost:8000 - correct locally, wrong anywhere else, and the usual cause of a redirect_uri_mismatch error. Setting GOOGLE_OAUTH_REDIRECT_URI explicitly, as above, pins the callback itself.
3. Install and run
uv sync
uv run main.py --transport streamable-httpThe server listens on http://localhost:8000/mcp. To check it before wiring up a client:
npx @modelcontextprotocol/inspector
# Transport: streamable-http
# URL: http://localhost:8000/mcp
# Connect, complete the OAuth handshake, then list toolsDocker works too and reads the same .env:
docker compose up --build4. Deploy
The Dockerfile is ready for Railway as it stands:
railway up --service gdrive-mcpSet GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET, WORKSPACE_EXTERNAL_URL=https://<your-domain>, MCP_ENABLE_OAUTH21=true, WORKSPACE_MCP_STATELESS_MODE=true, and WORKSPACE_MCP_TRANSPORT=streamable-http in the Railway service variables, then add https://<your-domain>/oauth2callback to the authorized redirect URIs on the Google OAuth client.
5. Connect claude.ai
claude.ai fetches the server from Anthropic's servers, not from your browser, so it needs a public HTTPS URL. A deployed Railway service gives you one. For local testing, a tunnel works: run ngrok http 8000, then set WORKSPACE_EXTERNAL_URL and GOOGLE_OAUTH_REDIRECT_URI to the tunnel URL and add that callback to the Google OAuth client. Free ngrok URLs change on every restart, which means editing both places again each time.
In claude.ai, go to Settings, then Connectors, then Add custom connector, and enter https://<your-domain>/mcp. Authorize with a Google account that is listed under Test users on the consent screen.
One extra step if you want Claude to upload files it generates in code: in claude.ai, under Settings, then Capabilities, enable network egress and add *.googleapis.com and googleapis.com to the allowed domains. Without that, the connector itself still works, but a code execution step that pushes bytes out to Google is blocked by the sandbox firewall.

Local use with Claude Desktop
Claude Desktop speaks stdio rather than HTTP. Comment out WORKSPACE_MCP_TRANSPORT, MCP_ENABLE_OAUTH21, and WORKSPACE_MCP_STATELESS_MODE, then set:
USER_GOOGLE_EMAIL=you@example.com
MCP_SINGLE_USER_MODE=1
WORKSPACE_MCP_CREDENTIALS_DIR=./store_credsIn this mode the server also exposes a start_google_auth tool for kicking off the browser authorization flow. It is hidden when OAuth 2.1 is enabled, because the client handles authorization there instead.
Run uv run main.py --single-user, and add this to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"gdrive": {
"command": "uv",
"args": ["run", "/absolute/path/to/this/repo/main.py", "--single-user"]
}
}
}Environment variables
These are the variables a normal deployment needs. The code reads a number of others for reverse proxy, service account, and alternate credential store setups, which env.example and the source cover.
Variable | Required | Default | What it does |
| Yes | none | OAuth client ID from Google Cloud |
| Yes | none | OAuth client secret from Google Cloud |
| No |
| Callback URI, and it must match one registered on the OAuth client |
| Yes when deployed | none | Public URL the server is reachable at, used as the base for the OAuth endpoints |
| No |
| Base used with the port when |
| No |
|
|
| No |
| Port to bind. Railway sets |
| No |
| Bind address |
| No |
| Multi-user mode where each caller sends their own bearer token |
| No | off | Keep no per-session state on disk, needed behind a stateless proxy |
| No |
| Where credentials persist when not stateless, for local use |
| No | off | Drop the write scopes and disable every mutating tool |
| No | none | Pin the server to one Google account in single-user mode |
| No | off | Single-user mode, an alternative to OAuth 2.1 |
| No |
| Largest file |
Troubleshooting
Symptom | Cause and fix |
| The redirect URI does not exactly match the one registered in Google Cloud. Check protocol, port, and path. |
| The consent screen is unpublished and your account is not in the test-users list. |
| An API was not enabled. The error message includes a direct link to enable it. |
A deployed server sends users to a |
|
A POST to the server returns 405 | The connector URL is missing the |
| Both |
Claude can call tools but uploading a generated file fails | Claude's sandbox is blocking outbound traffic to Google. Add |
Attribution
This is a fork of the google_workspace_mcp project, taken at commit 5495c83cd3ac503d00cd8015de944c9949cd6443. The OAuth machinery, server scaffold, tool registry, and Drive helpers are that project's work, and this fork would not exist without it.
What changed here: the Google services this fork does not need were removed (Gmail, Calendar, Forms, Chat, Tasks, Contacts, Search, and Apps Script), which keeps the consent screen and the authorization blast radius down to Drive, Docs, Sheets, and Slides; the overlapping Drive tools were renamed and reshaped to match the tool surface of Claude's built-in Drive connector, so skills written against the built-in tools work unchanged; binary uploads were fixed, since upstream encoded content as UTF-8 regardless of the file type and turned an uploaded xlsx or pptx into a file containing the literal base64 text; and the Docs, Sheets, and Slides batch update tools were added for native-chart and template-filling workflows.
License
MIT, inherited from upstream. See LICENSE.
Maintained by Adam Walker at Atlantic Labs AI. Questions: adam@atlanticlabs.ai
Available Tools
25 toolscheck_drive_file_public_accessCheck Drive File Public AccessARead-onlyIdempotent
Searches for a file by name and checks if it has public link sharing enabled.
Inputs: file_name (required), user_google_email (required), drive_id. Returns: result
copy_drive_fileCopy Drive FileB
Creates a copy of an existing Google Drive file.
This tool copies the template document to a new location with an optional new name. The copy maintains all formatting and content from the original file.
Inputs: file_id (required), user_google_email (required), new_name, parent_folder_id. Returns: result
create_drive_folderCreate Drive FolderA
Creates a new folder in Google Drive, supporting creation within shared drives.
Inputs: folder_name (required), user_google_email (required), parent_folder_id. Returns: result
create_fileCreate FileA
Creates a new file in Google Drive, supporting creation within shared drives. Accepts either direct content or a fileUrl to fetch the content from.
Inputs: title (required), user_google_email (required), content, fileUrl, +3 more. Returns: object
create_resumable_upload_sessionCreate Resumable Upload SessionA
Creates a Google Drive resumable upload session and returns the upload URL.
The caller (e.g. a skill running in claude.ai's sandbox) uses the returned
upload_url to PUT raw file bytes directly to Google — bypassing MCP
transport limits on large content arguments. Only the short URL travels
through MCP; the bytes go straight from the sandbox to Google.
Inputs: title (required), mimeType (required), user_google_email (required), parentId, +1 more. Returns: object
docs_batch_updateBatch Update Google DocA
Apply a batch of edit requests to a Google Doc (documents.batchUpdate).
Accepts any Docs API request type (insertText, deleteContentRange,
updateTextStyle, insertTable, insertInlineImage, ...). Indexes shift as
earlier requests in the batch insert or delete content, so order edits from
the END of the document toward the start, or send one request per call.
Get current indexes from docs_get first. Pass writeControl with the
revision id from docs_get to fail fast if the document changed since —
otherwise stale indexes edit the wrong ranges silently.
Inputs: requests (required), documentId (required), user_google_email (required), writeControl. Returns: object
docs_getGet Google DocARead-onlyIdempotent
Read a Google Doc's content and structure (documents.get).
The returned resource's body.content elements carry startIndex/endIndex
for every paragraph and text run — use them to compute the index arguments
that docs_batch_update requests need, and to verify an edit landed.
Inputs: documentId (required), user_google_email (required), fields, includeTabsContent. Returns: object
docs_replace_all_textReplace All Text in Google DocA
Find-and-replace text across a Google Doc (documents.batchUpdate with one replaceAllText request per item). Preserves surrounding formatting, so it is the safest way to fill placeholders in a template document.
Inputs: documentId (required), replacements (required), user_google_email (required), matchCase. Returns: object
download_file_contentDownload File ContentARead-onlyIdempotent
Downloads a Google Drive file and returns its raw bytes as a base64-encoded blob.
For Google native files (Docs, Sheets, Slides), exports to a useful format:
Google Docs -> PDF (default) or DOCX if export_format='docx'
Google Sheets -> XLSX (default), PDF if export_format='pdf', or CSV if export_format='csv'
Google Slides -> PDF (default) or PPTX if export_format='pptx'
For other files, downloads the original file format.
Size limit: DOWNLOAD_FILE_CONTENT_MAX_MB env var (default 25 MB). Files larger than the limit return an error pointing to read_file_content for text extraction, or a Drive shareable link as a fallback.
Inputs: fileId (required), user_google_email (required), export_format.
get_drive_file_permissionsGet Drive File PermissionsBRead-onlyIdempotent
Gets detailed metadata about a Google Drive file including sharing permissions.
Inputs: file_id (required), user_google_email (required). Returns: result
get_file_metadataGet File MetadataARead-onlyIdempotent
Returns metadata for a single Google Drive file by ID.
Inputs: fileId (required), user_google_email (required). Returns: object
import_to_google_docImport to Google DocA
Imports a file (Markdown, DOCX, TXT, HTML, RTF, ODT) into Google Docs format with automatic conversion.
Google Drive automatically converts the source file to native Google Docs format, preserving formatting like headings, lists, bold, italic, etc. For batch operations, prefer file_path for files on disk so callers do not need to load full file contents into their context.
Inputs: file_name (required), user_google_email (required), content, file_url, +3 more. Returns: result
list_drive_itemsList Drive ItemsARead-onlyIdempotent
Lists files/folders or shared drive containers, supporting shared drives.
If drive_id is specified, lists items within that shared drive. folder_id is then relative to that drive (or use drive_id as folder_id for root).
If drive_id is not specified, lists items from user's "My Drive" and accessible shared drives (if include_items_from_all_drives is True).
Set resource_type to "shared_drives" to list shared drive containers instead of folder contents.
Inputs: user_google_email (required), query, corpora, detailed, +9 more. Returns: result
list_recent_filesList Recent FilesARead-onlyIdempotent
Lists the user's most recently modified files in Google Drive (across all drives the user has access to). Excludes trashed items.
Inputs: user_google_email (required), page_size, page_token. Returns: object
manage_drive_accessManage Drive AccessADestructive
Consolidated tool for managing Google Drive file and folder access permissions.
Supports granting, batch-granting, updating, revoking permissions, and transferring file ownership -- all through a single entry point.
Inputs: action (required), file_id (required), user_google_email (required), role, +10 more. Returns: result
presentations_batch_updatePresentations Batch UpdateA
Apply a batch of update requests to a Google Slides presentation (presentations.batchUpdate).
Used by the QBR skill to delete chart placeholders and embed LINKED Sheets
charts (createSheetsChart, linkingMode=LINKED). Build requests with
scripts/google_native/slides_links.build_link_requests(). Pass writeControl
{"requiredRevisionId": ...} (from presentations_get) to guard against
clobbering concurrent human edits.
Retries transient Drive eventual-consistency failures (a just-converted Sheet not yet visible to Slides) with exponential backoff up to ~30s.
Inputs: requests (required), presentationId (required), user_google_email (required), writeControl. Returns: object
presentations_getPresentations GetARead-onlyIdempotent
Read a Google Slides presentation (presentations.get). Use a fields mask:
slot resolution: slides(objectId,pageElements(objectId,description,title,size,transform,shape/text,elementGroup))
embed verification: slides(pageElements(objectId,sheetsChart))
revision guard: revisionId
Inputs: presentationId (required), user_google_email (required), fields. Returns: object
read_file_contentRead File ContentARead-onlyIdempotent
Retrieves the content of a specific Google Drive file by ID, supporting files in shared drives.
• Native Google Docs, Sheets, Slides → exported as text / CSV. • Office files (.docx, .xlsx, .pptx) → unzipped & parsed with std-lib to extract readable text. • PDFs → text extracted with pypdf when possible; scanned/image-only PDFs fall back to a download hint. • Images → returned as base64 with MIME metadata for multimodal clients. • Any other file → downloaded; tries UTF-8 decode, else notes binary.
Inputs: fileId (required), user_google_email (required). Returns: result
search_filesSearch FilesBRead-onlyIdempotent
Searches for files and folders within a user's Google Drive, including shared drives.
Inputs: query (required), user_google_email (required), corpora, detailed, +6 more. Returns: object
set_drive_file_permissionsSet Drive File PermissionsADestructive
Sets file-level sharing settings and controls link sharing for a Google Drive file or folder.
This is a high-level tool for the most common permission changes. Use this to toggle "anyone with the link" access or configure file-level sharing behavior. For managing individual user/group permissions, use share_drive_file or update_drive_permission instead.
Inputs: file_id (required), user_google_email (required), link_sharing, writers_can_share, +1 more. Returns: result
spreadsheets_batch_updateSpreadsheets Batch UpdateA
Apply a batch of update requests to a Google Sheet (spreadsheets.batchUpdate).
Used by the QBR skill to create native charts (addChart) and set cell number
formats (repeatCell). Build the requests array with
scripts/google_native/sheets_charts.build_batch_requests().
Inputs: requests (required), spreadsheetId (required), user_google_email (required). Returns: object
spreadsheets_getSpreadsheets GetARead-onlyIdempotent
Read a Google Sheet's metadata (spreadsheets.get). Use a fields mask to
resolve sheet ids (sheets(properties(sheetId,title))) or verify charts
(sheets(charts(chartId,spec/title))).
Inputs: spreadsheetId (required), user_google_email (required), fields. Returns: object
start_google_authStart Google AuthA
Manually initiate Google OAuth authentication flow.
NOTE: This is a legacy OAuth 2.0 tool and is disabled when OAuth 2.1 is enabled. The authentication system automatically handles credential checks and prompts for authentication when needed. Only use this tool if:
You need to re-authenticate with different credentials
You want to proactively authenticate before using other tools
The automatic authentication flow failed and you need to retry
In most cases, simply try calling the Google Workspace tool you need - it will automatically handle authentication if required.
Inputs: service_name (required), user_google_email. Returns: result
update_drive_fileUpdate Drive FileCDestructive
Updates metadata and properties of a Google Drive file.
Inputs: file_id (required), user_google_email (required), name, starred, +8 more. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
Multiple tools overlap in purpose, especially around permissions: manage_drive_access, set_drive_file_permissions, get_drive_file_permissions, and check_drive_file_public_access have unclear boundaries. Listing tools (search_files, list_recent_files, list_drive_items) are distinguishable but could be confused.
Naming mixes verb_noun patterns (get_file_metadata, create_drive_folder) with reverse noun_verb patterns (spreadsheets_get, docs_batch_update). Inconsistent use of 'file' vs 'drive_file' and similar operations named differently (read_file_content vs download_file_content).
25 tools is on the high end but reasonable for a server covering Google Drive plus Docs, Sheets, and Slides. Some redundancy (permission tools) makes it feel slightly heavy, but most tools serve distinct purposes.
The tool set includes create, read, and update operations but completely lacks delete or trash functionality, a fundamental gap for a 'CRUD' server. Also missing native creation for Sheets and Slides, relying on import/update only.
Maintenance
Related MCP Connectors
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
Hosted MCP server for marketing agencies: connect Google Ads, GA4, Search Console, Meta, LinkedIn and more to Claude or ChatGPT. Pull reports and make changes via OAuth login, no setup.
Google Search Console, GA4 and PageSpeed MCP server for Claude, ChatGPT and Cursor. Free, hosted.
Hosted BigQuery MCP server for Claude, ChatGPT and Cursor, with each action switched per account.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceMCP server that enables Claude to interact with Google Workspace services including Drive, Docs, Sheets, Slides, Calendar, Gmail, and Contacts.642 npm37MIT
- FlicenseNot gradedqualityCmaintenanceMCP server for Google Drive, Docs, and Sheets — built for Claude Code. Gives Claude Code direct read/write access to Google Sheets (cell-level edits, formatting, structure), Google Docs (insert, replace, append), and Drive (search).1-
- AlicenseNot gradedqualityDmaintenanceA self-hosted MCP server providing Claude with authenticated access to Google Calendar, Gmail, Drive, Docs, Sheets, and Slides via 43 tools and secure OAuth2.528 npmMIT
- AlicenseNot gradedqualityBmaintenanceMCP server connecting Claude to Google Sheets, Docs, and Drive, enabling cell-level editing, formatting, chart creation, and file management through natural language.528 npmMIT