drive-mcp
A minimal MCP server for one Google Drive account (stdio) that lets an MCP client search, read, download, create, edit, organize and share files via your own OAuth client — with nothing permanently deleted.
Search & browse:
search_files(name, full text, type, folder, modified after, owned by me; paginated),list_recent_files,list_folder(folders first;root= My Drive).Inspect & read:
get_file_metadata(folder path + web link),get_file_permissions,read_file_content(Docs→Markdown, Sheets→CSV, Slides→text, text-like files as-is; truncatable).Download:
download_fileto an absolute path, exporting Docs/Sheets/Slides/Drawings to docx/xlsx/pptx/png by default; refuses to overwrite unless told.Create:
create_file(text, optionally imported as Doc/Sheet/Slides),create_folder,upload_file(local file, optionally converted to a Google-native file).Update & organize:
update_file_content(replace content),update_file_metadata(rename, move, describe, star),copy_file.Trash (reversible):
trash_fileanduntrash_file; nothing is permanently deleted and there is no empty-trash tool.Share:
share_file(reader/commenter/writer to user, group, domain, or anyone with link; optional expiration; no email unlesssendNotificationEmailis true; link sharing non-discoverable),unshare_file(by permission id or email;anyoneremoves link sharing).Auth/config: Desktop-app OAuth with full
drivescope, one-timenpm run authflow, token stored mode 600; paths and expected account overridable viaDRIVE_MCP_CREDENTIALS,DRIVE_MCP_TOKEN,DRIVE_MCP_ACCOUNT.
Integrates with a single Google Drive account using your own OAuth client, letting agents search, read, download, create, edit, organize, and share files. Read tools cover structured search (by name, full text, type, folder, modified date, ownership), recent files, folder listings, metadata with folder path and web link, content export (Docs as Markdown, Sheets as CSV, Slides as plain text), permission inspection, and downloading files to local paths with format conversion. Write tools cover creating files and folders, uploading local files (optionally importing as Google-native formats), replacing file content, renaming/moving/describing/starring, copying, reversible trashing and untrashing, and granting or revoking sharing permissions for users, groups, domains, or anyone with the link.
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., "@drive-mcp search my Drive for the Q3 budget spreadsheet and summarize it"
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.
drive-mcp
A minimal Model Context Protocol server for one Google Drive account, served over stdio. It gives an MCP client such as Claude Code the ability to search, read, download, create, edit, organize and share files using your own Google OAuth client.
Why
Google's hosted Drive MCP endpoint requires the Cloud project to be enrolled in the Google Workspace Developer Preview Program, which asks for a Workspace account. A personal Google account cannot use it. This server sidesteps that by talking to the Drive API itself with a Desktop-app OAuth client that you create in your own Google Cloud project. No third party sits between the client and your files.
Related MCP server: Google Docs MCP Proxy
Scope and safety
The server requests the full drive scope.
That is deliberate: the narrower drive.file scope only reaches files the app itself created, which would rule out reading, editing or organizing anything already in the account.
Because the scope is broad, the tool surface is the safety boundary:
Nothing permanently deletes.
trash_filemoves to the trash, where Drive keeps things for 30 days anduntrash_filebrings them back. There is no tool to empty the trash.Sharing never emails anyone unless
sendNotificationEmailis set to true.Link sharing is created with
allowFileDiscoveryoff, so shared links are never searchable.download_filerefuses to overwrite a local file unless told to.
Pin every write tool to an "ask" rule in your MCP client so it prompts on every call regardless of the session's permission mode.
In Claude Code that is a block in .claude/settings.local.json of the project where the server is registered:
{
"permissions": {
"ask": [
"mcp__drive__create_file",
"mcp__drive__create_folder",
"mcp__drive__upload_file",
"mcp__drive__update_file_content",
"mcp__drive__update_file_metadata",
"mcp__drive__copy_file",
"mcp__drive__trash_file",
"mcp__drive__untrash_file",
"mcp__drive__share_file",
"mcp__drive__unshare_file"
]
}
}The tool name prefix is mcp__<server name>__, so adjust it to whatever name you register the server under.
Tools
Read
Tool | Effect |
| Structured search: name, full text, type, folder, modified after, owned by me. Paginated |
| Most recently modified files, default 10 |
| Direct children of a folder, folders first. |
| One file with its folder path and web link |
| Content as text. Docs export as Markdown, Sheets as CSV, Slides as plain text; text-like files as-is |
| Who has access and with what role |
| Save to a local absolute path. Docs, Sheets, Slides and Drawings export to docx, xlsx, pptx and png by default |
Write
Tool | Effect |
| Writes. New file from text. |
| Writes. New folder |
| Writes. Upload a local file, optionally importing it as a Google-native file |
| Writes. Replace a file's content. For a Doc, Markdown replaces the whole document |
| Writes. Rename, move, describe or star |
| Writes. Copy, optionally renamed and into another folder |
| Writes. Reversible trash |
| Writes, reaches other people. Grant reader, commenter or writer to a user, group, domain or anyone with the link |
| Writes. Remove a permission by id or by email; |
Files
File | Purpose |
| The MCP server |
| One-time OAuth consent flow; writes the token file |
| File locations and scope, overridable through environment variables |
| OAuth client from Google Cloud Console. Gitignored, never commit it |
| Refresh token, written with mode 600. Gitignored, never commit it |
Setup
Requires Node.js 20 or newer.
In Google Cloud Console, signed in as the Google account you want to expose: create a project and enable the Google Drive API.
Configure the OAuth consent screen as External and add that same account as a test user.
Create an OAuth client ID of type Desktop app and download its JSON to
credentials.jsonin this directory. If you already have a Desktop client from another tool in the same project, the same file works here; each server keeps its own token.Install dependencies and run the consent flow:
npm install npm run authA browser opens on the Google consent screen. When it finishes, the script prints which account the token belongs to. Set
DRIVE_MCP_ACCOUNTto the expected address if you want a warning when the wrong account was used.Register the server with your MCP client. For Claude Code, from the project where you want it available:
claude mcp add drive -- node /absolute/path/to/drive-mcp/server.js
Configuration
Everything defaults to files next to the code. Override with environment variables when the server runs from elsewhere or when several accounts share one checkout.
Variable | Default | Meaning |
|
| Path to the OAuth client JSON |
|
| Path where the refresh token is stored |
| unset | Expected address; |
To change the scope, edit SCOPES in config.js and re-run npm run auth.
An existing token keeps its old scope, and API calls fail with insufficient authentication scopes until it is reissued.
Notes
Staying in OAuth "Testing" status is fine for personal use; no Google verification is needed. Refresh tokens for an app in Testing status expire 7 days after they are issued, whether or not the app is used. This is not an idle timeout: a token used every single day still stops working on day 7. Re-run
npm run authwhen calls start failing withinvalid_grant.credentials.jsonandtoken.jsonare secrets. They are gitignored here, but treat any copy of them like a password.Sibling projects: gmail-mcp and calendar-mcp.
License
MIT. See LICENSE.
Available Tools
17 toolscopy_fileB
WRITES. Copy a file, optionally with a new name and into another folder. Folders cannot be copied.
Inputs: fileId (required), name, folderId.
create_fileA
WRITES. Create a file from text. With convertTo, the text is imported as a Google Doc (from Markdown, HTML or plain text), Sheet (from CSV) or Slides. Without it a plain file of the given mimeType is created. Omit content to create an empty Google file.
Inputs: name (required), content, folderId, mimeType, +2 more.
create_folderC
WRITES. Create a folder.
Inputs: name (required), parentId.
download_fileA
Save a file to a local absolute path. Google-native files are exported (Docs to docx, Sheets to xlsx, Slides to pptx, Drawings to png by default; pass format to change). Refuses to overwrite unless overwrite is true.
Inputs: fileId (required), destinationPath (required), format, overwrite.
get_file_metadataC
Full metadata for one file, including its folder path and web link.
Inputs: fileId (required).
get_file_permissionsC
Who can access a file and with what role.
Inputs: fileId (required).
list_folderA
List the direct children of a folder, folders first then by name. Use "root" for My Drive.
Inputs: folderId, pageToken, maxResults.
list_recent_filesB
The most recently modified files that are not in the trash. Default 10.
Inputs: orderBy, maxResults.
read_file_contentA
Return a file's content as text. Google Docs export as Markdown, Sheets as CSV (first sheet), Slides as plain text; text, Markdown, CSV, JSON and similar files are returned as-is. Binary files such as PDFs and images cannot be read this way; use download_file.
Inputs: fileId (required), format, maxChars.
search_filesA
Search Drive by name, full text, type, folder and modification date. All constraints are ANDed. Returns metadata only; use read_file_content or download_file for contents. Trashed files are excluded unless includeTrashed is true.
Inputs: name, type, orderBy, folderId, +7 more.
trash_fileA
WRITES. Move a file or folder to the trash. Reversible with untrash_file for 30 days; nothing is permanently deleted.
Inputs: fileId (required).
untrash_fileB
WRITES. Restore a file or folder from the trash.
Inputs: fileId (required).
update_file_contentA
WRITES. Replace a file's content with new text. For a Google Doc the text is re-imported (Markdown, HTML or plain text), replacing the whole document; for a Sheet pass CSV. The file id, name, sharing and location are unchanged.
Inputs: fileId (required), content (required), mimeType.
update_file_metadataA
WRITES. Rename, move, describe or star a file. Only the fields passed are changed. Moving replaces the current parent folder.
Inputs: fileId (required), name, starred, description, +1 more.
upload_fileB
WRITES. Upload a local file. With convertTo the upload is imported as a Google-native file (e.g. a .docx or .md into a Google Doc, a .csv or .xlsx into a Sheet).
Inputs: localPath (required), name, folderId, mimeType, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool targets a distinct resource and action: separate tools for creating folders vs files, reading content vs downloading, updating content vs metadata, and sharing vs unsharing. Overlaps like list_folder/search_files/list_recent_files are clearly distinguished by scope and filters.
All tools use snake_case with a consistent verb_noun pattern (e.g., create_folder, update_file_content, share_file). Variations like list_recent_files and get_file_metadata are still predictable and readable.
17 tools is slightly above the typical 3-15 range but justified by Google Drive's breadth (files, folders, permissions, sharing, trash, content I/O). No tool appears redundant, though a few could theoretically be merged.
Core lifecycle is covered: create, read, update, copy, trash/untrash, share/unshare. Minor gaps include no permanent delete (trash is reversible) and no dedicated move operation (handled via update_file_metadata), but no critical dead ends.
Maintenance
Related MCP Connectors
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Notes, files, GitHub, and Drive through one MCP connection.
Notes, files, GitHub, and Drive through one MCP connection.
Notes, files, GitHub, and Drive through one MCP connection.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceA read-only Google Drive MCP server that allows searching files, reading file content (with auto-export for Google Docs, Sheets, Slides), and retrieving file metadata via OAuth authentication.13 npm2-
- AlicenseNot gradedqualityDmaintenanceLocal stdio MCP server that handles Google OAuth2 locally and proxies authenticated requests to Google Docs and Google Drive REST APIs, enabling document and file operations from Cursor or other MCP clients.61 npmMIT
- AlicenseNot gradedqualityDmaintenanceA local, read-only MCP server for searching your Google Drive.23 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables an MCP client to search, read, label, draft, and send Gmail messages for a single Google account over stdio using your own OAuth client.280 npmMIT