Mcp Gdrive Cloudflare

by brianmoney

330 downloads
Not rated
GitHub

About

Remote MCP server for Google Drive and Sheets running on Cloudflare Workers with full OAuth 2.0 support.

Details

Author
brianmoney
Downloads
330
Categories
Cloud Service, Other, Infrastructure, File Management

- Search Drive files with advanced filters (MIME type, owner, dates)
- Read files with 22+ export formats (PDF, DOCX, Markdown)
- Upload files up to 5MB
- Create, delete, move, and share files and folders
- Read, update, and append Google Sheets data
- Full OAuth 2.0 server with PKCE and auto token refresh

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Mcp Gdrive Cloudflare
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Deploy to Cloudflare Workers using Wrangler CLI: install dependencies, create KV namespaces, configure Google OAuth credentials and environment variables, then run wrangler deploy. The worker URL serves as the MCP endpoint.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp gdrive cloudflare": {
            "gdrive": {
                "url": "https://mcp-gdrive-cf.CFDOMAIN.workers.dev/sse",
                "type": "http"
            }
        }
    }
}

McpServers

{
    "gdrive": {
        "url": "https://mcp-gdrive-cf.CFDOMAIN.workers.dev/sse",
        "type": "http"
    }
}

Remote MCP server for Google Drive and Sheets running on Cloudflare Workers with full OAuth 2.0 support.

Remote MCP server for Google Drive and Sheets running on Cloudflare Workers with full OAuth 2.0 support.

Production Readyβœ… |11 Tools|OAuth 2.0|PKCE|Global Edge Network

Adapted fromisaacphi/mcp-gdriveto run as a remote HTTP/SSE MCP server on Cloudflare's edge network with complete OAuth 2.0 authorization server capabilities.

git clonehttps://github.com/brianmoney/mcp-gdrive-cf.gitcd mcp-gdrive-cf npm install

wrangler kv:namespace create KV_TOKENS wrangler kv:namespace create KV_CLIENTS

3. Update wrangler.toml with your namespace IDs

wrangler secret put GOOGLE_CLIENT_SECRET

npx @modelcontextprotocol/inspectorhttps://your-worker.workers.dev/sse


- πŸ”Search- Basic and advanced search with filters (MIME type, owner, dates, shared drives)
- πŸ“„Read- Read any file with 22+ export formats (PDF, DOCX, XLSX, Markdown, etc.)
- πŸ“Create Folders- Organize files with nested folder structures
- ⬆️Upload- Upload files up to 5MB
- πŸ—‘οΈDelete- Move files to trash
- πŸ“¦Move- Reorganize files between folders
- πŸ”Share- Add permissions (reader, writer, commenter, owner)

- πŸ“ŠRead- Batch read multiple ranges
- ✏️Update- Update individual cells
- βž•Append- Add rows to spreadsheets

- ☁️Global Edge Network- Runs on Cloudflare Workers worldwide
- πŸ”OAuth 2.0 Server- Full authorization server with PKCE support
- πŸ”‘Dynamic Client Registration- Automatic client onboarding
- πŸ”„Auto Token Refresh- Seamless Google token renewal
- πŸ“‘SSE Transport- Real-time Server-Sent Events
- πŸ›‘οΈSecure- HTTPS only, encrypted token storage

Unlike the original STDIO-based mcp-gdrive, this implementation:
- Runs remotelyon Cloudflare Workers (no local process)
- Full OAuth 2.0authorization server (not just OAuth client)
- Multi-client supportvia dynamic client registration
- PKCE securityfor public clients
- 22+ export formatsfor Drive files
- Write operations(create, delete, move, share, upload)
- Production testedwith real workloads

- Cloudflare Accountwith Workers enabled (free tier works)
- Google Cloud Projectwith Drive API and Sheets API enabled
- Node.jsLTS (v18+)
- Wrangler CLI(npm install -g wrangler)
- Create a project at
Google Cloud Console
- Enable APIs:

- Google Drive API
- Google Sheets API

- Type:Web application
- Redirect URIs:
https://your-worker.workers.dev/google/callback\

- https://www.googleapis.com/auth/drive\
-
https://www.googleapis.com/auth/spreadsheets\

wrangler kv:namespace create KV_CLIENTS

Copy the namespace IDs to wrangler.toml:

``toml [[kv_namespaces]] binding = "KV_TOKENS" id = "your-tokens-namespace-id"

[[kv_namespaces]] binding = "KV_CLIENTS" id = "your-clients-namespace-id"


toml [vars] GOOGLE_CLIENT_ID = "your-client-id.apps.googleusercontent.com"

wrangler secret put GOOGLE_CLIENT_SECRET

Your worker will be available at: https://your-worker-name.your-account.workers.dev\

This server implements acomplete OAuth 2.0 authorization serverper the MCP specification.

`bash npx @modelcontextprotocol/inspectorhttps://your-worker.workers.dev/sse

- Discovery- Inspector auto-discovers OAuth endpoints
- Registration- Click "Guided Setup" β†’ registers client automatically
- Authorization- Redirects to Google β†’ authenticates β†’ redirects back
- Token Exchange- Automatically exchanges code for access token
- Use Tools- All 11 tools now available!

- βœ…PKCE (RFC 7636)- Proof Key for Code Exchange
- βœ…State Parameter- CSRF protection
- βœ…HTTPS Only- Enforced by Cloudflare Workers
- βœ…Secure Token Storage- Encrypted in Workers KV
- βœ…Token Expiration- Access tokens expire in 1 hour
- βœ…Client Secret Hashing- SHA-256 hashed storage
- βœ…Authorization Code Single-Use- Codes deleted after exchange

- gdrive_search - Basic search across all files
-
gdrive_search_advanced - Advanced search with filters
-
gdrive_read_file - Read files with 22+ export formats
-
gdrive_create_folder - Create folders
-
gdrive_upload_file - Upload files (up to 5MB)
-
gdrive_delete_file - Move files to trash
-
gdrive_move_file - Move files between folders
-
gdrive_add_permission - Share files/folders

- gsheets_read - Read multiple ranges
-
gsheets_update_cell - Update single cells
-
gsheets_append_row - Append rows

json { "mcp.servers": { "gdrive": { "url": "https://your-worker.workers.dev/sse", "authorization": { "type": "oauth2" } } } }

macOS/Linux:
~/Library/Application Support/Claude/claude_desktop_config.json
Windows:
%APPDATA%\Claude\claude_desktop_config.json

json { "mcpServers": { "gdrive": { "url": "
https://your-worker.workers.dev/sse" } } }

Server available athttp://localhost:8788

bash npx @modelcontextprotocol/inspectorhttp://localhost:8788/sse

bash wrangler tail --format pretty
`

"Failed to discover OAuth metadata"

- Ensure /.well-known/oauth-authorization-server returns valid JSON
- Check CORS headers are present
- Verify latest version is deployed:
wrangler deploy

"Token exchange failed: HTTP 400"

- Check code_verifier matches original code_challenge
- Ensure redirect_uri exactly matches registration
- Verify client credentials are correct
- Check CloudFlare logs:
wrangler tail

- Check Google OAuth scopes include drive and spreadsheets
- Re-authenticate if scopes changed: visit
/google/authorize
- Verify Worker has valid Google access token
- Check KV namespace bindings in
wrangler.toml
- Never commit secrets- Use
wrangler secret put`
- Rotate client secrets- Periodically regenerate OAuth credentials
- Monitor access- Use CloudFlare Analytics to track usage
- Limit OAuth scopes- Only request necessary Google permissions
- Use PKCE- Always use PKCE for public clients
- Validate redirect URIs- Whitelist exact URIs in Google Console
- Enable 2FA- Protect your CloudFlare and Google accounts

- isaacphi/mcp-gdrive- Original STDIO implementation
-
Model Context Protocol- MCP specification
-
CloudFlare Workers- Serverless platform

Bridge Town is an MCP-native, git-versioned financial modeling platform for FP&A teams and finance leaders. AI agents use Bridge Town tools to create projects, write Python model files, run models in isolated cloud sandboxes, query data, write outputs to Google Sheets, create dashboards, branch scenarios, and collaborate with teammates.

Deploy HTML/React artifacts from your AI client to hosted, share-gated URLs. Private by default, password or email gates, EU hosting. Remote MCP: https://bauta.app/mcp

MCP server for Google Sheets β€” read, write, append, and clear data in any spreadsheet using OAuth. Works with Claude Desktop and any MCP client.

Google Sheets - BlackHawkMCP and CSV (.csv) files with scalable, chunked, and column-specific data access, ideal for large datasets.

Read and write data from Microsoft Excel files. Supports text, formulas, sheet creation, and Windows-only live editing.

An MCP server for manipulating and managing Excel files.

A filesystem server for Windows Subsystem for Linux (WSL), using native commands for faster file operations.

Interact with Google Docs and Google Drive for document creation, editing, and file management, with support for shared drives.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.