Skip to main content

Google Drive MCP

The Google Drive MCP server (gdrive-mcp) gives agents direct access to Google Drive for file operations. It exposes 6 tools: list, search, info, mkdir, upload, and download.
This page documents agent-level Google Drive tools for file operations via MCP. For the Equa platform’s Data Room Google Drive sync feature, see Google Drive Sync.

When to use

Prerequisites

Setup

1. Build the server

2. Register in Cursor MCP config

Add to ~/.cursor/mcp.json:
Restart Cursor to pick up the new server. The 6 gdrive_* tools will appear in the MCP tool list.

3. Authentication

The server reuses the existing Google Workspace OAuth token at ~/.config/google-workspace/token.json. No new OAuth flow is required. The token is shared with the Python Google Workspace skill scripts; both systems read and write the same file. When the access token expires, the server refreshes it automatically and writes the updated token back in a format compatible with both Node.js and Python.

Tools

gdrive_list

List files and folders in Google Drive. Returns an array of file objects with id, name, mimeType, size, modifiedTime, and webViewLink. Includes nextPageToken when more results are available. Full-text search across Google Drive files.

gdrive_info

Get detailed metadata for a file. Returns: id, name, mimeType, size, modifiedTime, createdTime, webViewLink, owners, shared, parents.

gdrive_mkdir

Create a new folder. Returns: id, name, webViewLink.

gdrive_upload

Upload a local file to Google Drive. Returns: id, name, webViewLink.

gdrive_download

Download a file from Google Drive. Google Docs, Sheets, and Slides are automatically exported to Office formats (DOCX, XLSX, PPTX). Returns: downloaded (file path) and size (bytes).

Architecture

The server lives at Comet-Bridge/gdrive-mcp/ alongside the comet-mcp browser automation server. Both use the @modelcontextprotocol/sdk with StdioServerTransport.

Token management

The OAuth token at ~/.config/google-workspace/token.json is shared between:
  • gdrive-mcp (this Node.js MCP server)
  • Python Google Workspace scripts (equabot/skills/google-workspace/scripts/)
Both systems can read and refresh the token. When gdrive-mcp refreshes an expired token, it writes back in the exact Python google-auth format (field name token instead of access_token, ISO 8601 expiry string) using atomic write (tmp file + rename) to prevent corruption from concurrent access.

Troubleshooting

Verify the gdrive entry in ~/.cursor/mcp.json points to the correct dist/index.js path. Restart Cursor after editing mcp.json.
The token may have been revoked. Re-run the Python auth script to generate a fresh token: python equabot/skills/google-workspace/scripts/google_auth.py
Check that the MCP server process has write permission to ~/.config/google-workspace/token.json. The atomic write creates a temporary file in the same directory before renaming.