Custom Google Drive MCP
Provides tools for searching, reading, creating, and managing files and folders on Google Drive, including metadata retrieval, content reading/downloading, file creation with MIME-type handling, and permission management.
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., "@Custom Google Drive MCPfind documents about Q4 planning"
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.
Custom Google Drive MCP Server
A slimmed-down fork of taylorwilsdon/google_workspace_mcp that exposes only the Drive tool surface, with the four overlapping tools renamed and reshaped to match the Claude.ai Google Drive connector contract. Drop-in compatible with skills/scripts written against Claude.ai's built-in Drive tools.
Why this exists
The upstream server is a great general-purpose Workspace MCP, but three things made it unsuitable for drop-in use as a Claude.ai Drive connector replacement:
Tool surface doesn't match Claude.ai's Drive connector. Skills written against Claude.ai's built-in
search_files,read_file_content,download_file_content,create_filebreak against upstream'ssearch_drive_files,get_drive_file_content,get_drive_file_download_url,create_drive_file. Param names and response shapes also differ.create_drive_filecorrupts binary uploads. Upstream doescontent.encode("utf-8")regardless of mime type, so passing a base64-encoded xlsx or pptx results in a Drive file whose bytes are the literal base64 ASCII string — not the decoded binary.It bundles 11 other Google services (Gmail, Calendar, Docs, Sheets, Slides, Forms, Chat, Tasks, Contacts, Search, Apps Script) that inflate the OAuth consent surface, deploy size, and auth blast radius if you only need Drive.
What's different vs upstream
Change | Effect |
Drive-only | No Gmail/Calendar/Docs/Sheets/Slides/Forms/Chat/Tasks/Contacts/Search/AppsScript modules in the repo. CLI no longer exposes |
Claude.ai-compatible tool surface | Four overlapping tools renamed and reshaped (see table below). Two new tools ( |
|
|
| Base64 bytes inline, not a temporary URL. Capped at 25 MB by default (env var |
|
|
Mime-aware | If |
Dead-code pruning | Removed unused tier loader, comments helpers, granular-permissions module, dev CLI, and all non-Drive scope/service constants. See |
The OAuth machinery (Google provider, scopes, session store, callback handling, middleware), core/ server scaffold, attachment storage, http_utils, tool registry, and gdrive/drive_helpers.py are functionally identical to upstream — just trimmed of references to services this fork doesn't ship.
Drive tools available
Claude.ai-compatible surface (6 tools — match the built-in Drive connector)
Tool | Purpose | Key params |
| Query-based search across all accessible drives |
|
| Most recently modified files (excludes trashed) |
|
| Single-file metadata by ID |
|
| Extract text from Docs/Sheets/PDF/Office natively |
|
| Raw bytes as base64 |
|
| Create file or folder; auto-converts to Google native unless |
|
Additional tools preserved from upstream (10 tools)
list_drive_items— list children of a foldercreate_drive_folder— dedicated folder creationupdate_drive_file— metadata only (rename/move/trash), not contentimport_to_google_doc— import MD/DOCX/TXT/HTML/RTF/ODT and convert to a native Google Doccopy_drive_fileget_drive_file_permissions,check_drive_file_public_accessget_drive_shareable_link,manage_drive_access,set_drive_file_permissions
Migration from upstream tool names
Upstream | This fork |
|
|
|
|
|
|
|
|
Setup
1. Prerequisites
Python 3.10+ (
.python-versionpins the exact minor version uv will fetch)uv package manager — install via
curl -LsSf https://astral.sh/uv/install.sh | shA Google account you'll authorize the server with
A Google Cloud project (free tier is fine)
2. Google Cloud configuration (one-time)
In console.cloud.google.com, select or create a project, then:
a. Enable the Drive API APIs & Services → Library → search "Google Drive API" → Enable.
b. Configure the OAuth consent screen APIs & Services → OAuth consent screen.
User type: External (or Internal if you have a Workspace org).
Add yourself under Test users so you can authorize while the consent screen is in testing mode.
Add 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.file
c. Create an OAuth 2.0 Client ID APIs & Services → Credentials → Create credentials → OAuth client ID.
Application type: Web application (not "Desktop app").
Authorized redirect URIs:
http://localhost:8000/oauth2callbackSave the Client ID and Client Secret — you'll paste them into
.envnext.
3. Configure .env
cp env.example .envFor the recommended local setup (HTTP transport + OAuth 2.1 + in-memory session storage, matches the Railway production config):
# Google OAuth client (from step 2c)
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
# Transport
WORKSPACE_MCP_TRANSPORT=streamable-http
WORKSPACE_MCP_PORT=8000
WORKSPACE_MCP_HOST=0.0.0.0
# Auth mode
MCP_ENABLE_OAUTH21=true
WORKSPACE_MCP_STATELESS_MODE=trueFor stdio mode (e.g. Claude Desktop), see the alternative recipe under Run locally below.
4. Install dependencies
uv sync5. Verify
uv run main.py --transport streamable-httpExpected output:
Custom Google Drive MCP Server
Transport: streamable-http
URL: http://localhost:8000
OAuth Callback: http://localhost:8000/oauth2callback
...
Ready for MCP connectionsThe server listens on http://localhost:8000/mcp.
Run locally
HTTP transport (recommended)
Matches the Railway production setup. Use this for Claude.ai, MCP Inspector, or any client that speaks streamable-http.
uv run main.py --transport streamable-httpConnect a client to http://localhost:8000/mcp. The client triggers the OAuth flow on the first tool call — your browser opens, you authorize, the access token lives in server memory for the session.
Smoke test with MCP Inspector:
npx @modelcontextprotocol/inspector
# Transport: streamable-http
# URL: http://localhost:8000/mcp
# Click Connect → do the OAuth handshake → List toolsStdio transport (Claude Desktop, etc.)
Stdio mode talks the MCP protocol over stdin/stdout instead of HTTP, so the OAuth callback uses a tiny standalone server on port 8000 that auto-starts when needed.
Override .env with:
# Drop or comment these out for stdio mode:
# WORKSPACE_MCP_TRANSPORT=streamable-http
# MCP_ENABLE_OAUTH21=true
# WORKSPACE_MCP_STATELESS_MODE=true
# Required: pin to one Google account
USER_GOOGLE_EMAIL=you@example.com
MCP_SINGLE_USER_MODE=1
# Where credentials persist between runs
WORKSPACE_MCP_CREDENTIALS_DIR=./store_credsRun:
uv run main.py --single-userWire into a Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"custom-gdrive": {
"command": "uv",
"args": ["run", "/absolute/path/to/this/repo/main.py", "--single-user"]
}
}
}Connect to Claude.ai (web)
Claude.ai's custom connector requires a public HTTPS URL — http://localhost won't work because Anthropic's edge servers, not your browser, fetch the MCP endpoint. Two paths:
Deploy to Railway (see below) — set
WORKSPACE_EXTERNAL_URL=https://<service>.up.railway.app.Tunnel localhost over ngrok / Cloudflare Tunnel for testing:
ngrok http 8000 # copy the https://<id>.ngrok-free.app URL it printsThen in
.env:WORKSPACE_EXTERNAL_URL=https://<id>.ngrok-free.app GOOGLE_OAUTH_REDIRECT_URI=https://<id>.ngrok-free.app/oauth2callbackAnd add
https://<id>.ngrok-free.app/oauth2callbackto the GCP OAuth client's authorized redirect URIs. Restart the MCP server after editing.env.
In claude.ai → Settings → Connectors → Add custom connector:
Name: anything
Remote MCP server URL:
https://<your-external-url>/mcp(don't omit the/mcppath — POST to/returns 405)
Click Connect. The OAuth flow opens in a new tab; authorize with the Google account you added under GCP Console → OAuth consent screen → Test users.
Free ngrok URLs change on each restart. Each new URL means re-editing .env and re-adding the redirect URI in GCP. Use a static domain (paid plan) or Cloudflare Tunnel for a stable setup.
Docker
docker compose up --buildEquivalent to the HTTP transport recipe; reads .env from this directory.
Deploy to Railway
The Dockerfile is set up for Railway as-is:
# From the repo root
railway up --service custom-gdrive-mcpSet these in Railway service variables (see env.example):
GOOGLE_OAUTH_CLIENT_ID,GOOGLE_OAUTH_CLIENT_SECRETWORKSPACE_EXTERNAL_URL=https://<service>.up.railway.appMCP_ENABLE_OAUTH21=trueWORKSPACE_MCP_STATELESS_MODE=trueWORKSPACE_MCP_TRANSPORT=streamable-http
Add https://<service>.up.railway.app/oauth2callback to the GCP OAuth client's authorized redirect URIs.
Smoke-test the binary upload fix
# 1. Round-trip a small pptx
PPTX=/path/to/test.pptx
B64=$(base64 -i "$PPTX")
# 2. Call create_file via MCP inspector or your client with:
# title="test_binary.pptx"
# content=$B64
# mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation"
# disableConversionToGoogleType=true # keep as pptx, don't convert to Slides
# 3. Download the resulting file from Drive
curl -L -o roundtrip.pptx "<webContentLink>"
# 4. Verify
file roundtrip.pptx # Should report "Microsoft PowerPoint", not "ASCII text"
md5 "$PPTX" roundtrip.pptx # Should matchFor a text round-trip (markdown, no base64), pass mimeType="text/markdown" and content=<raw string> — the UTF-8 path kicks in automatically. Add disableConversionToGoogleType=true to keep it as a plain .md file (otherwise the auto-convert path turns it into a Google Doc).
Common gotchas
Symptom | Fix |
| The URI in |
| OAuth consent screen isn't published or your Google account isn't in the test-users list. |
| Step 2a was skipped. The server prints a direct enable link in the error message. |
| Change |
| You set both |
Provenance
Forked from taylorwilsdon/google_workspace_mcp at commit 5495c83cd3ac503d00cd8015de944c9949cd6443. Upstream LICENSE (MIT) preserved in this directory.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/YatharthLakhera/claude-gdrive-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server