Get the FREE Ultimate OpenClaw Setup Guide →

mcp-gdrive

Model Context Protocol (MCP) Server for reading from Google Drive and editing Google Sheets

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio isaacphi-mcp-gdrive npx -y @isaacphi/mcp-gdrive \
  --env CLIENT_ID="<CLIENT_ID>" \
  --env CLIENT_SECRET="<CLIENT_SECRET>" \
  --env GDRIVE_CREDS_DIR="<PATH_TO_CONFIG_DIRECTORY>"

How to use

This MCP server provides a Google Drive integration that allows you to list, read, and search files in Drive, as well as read and update Google Sheets. The server exposes several tools: gdrive_search to find files by query, gdrive_read_file to fetch file contents by ID, gsheets_read to pull data from spreadsheets (with optional ranges and sheet selection), and gsheets_update_cell to write a value to a specific cell. To use the server, configure your environment with Google Cloud credentials and point the server to a local credentials directory via GDRIVE_CREDS_DIR. Start the MCP client (via npm/npx as shown in the installation instructions) and authenticate through the browser when prompted. Once authenticated, you can invoke the tools to interact with Drive and Sheets programmatically through the MCP interface.

How to install

Prerequisites:

  • Node.js and npm installed on your machine
  • A Google Cloud project with Drive and Sheets APIs enabled
  • OAuth credentials downloaded and prepared (CLIENT_ID, CLIENT_SECRET)

Install and run:

# Install dependencies and build from source (example assumes the package name as in README)
# If you are using npm directly in your project directory
npm install
npm run build

# Alternatively, run the server via npx (as in the usage example) once configured

Configuration and first run:

# Create a config directory for credentials, then set environment vars accordingly
export GDRIVE_CREDS_DIR=/path/to/config/directory
export CLIENT_ID=<CLIENT_ID>
export CLIENT_SECRET=<CLIENT_SECRET>

# Start the authentication flow
node ./dist/index.js

Integrating with the Desktop App:

{
  "mcpServers": {
    "gdrive": {
      "command": "npx",
      "args": ["-y", "@isaacphi/mcp-gdrive"],
      "env": {
        "CLIENT_ID": "<CLIENT_ID>",
        "CLIENT_SECRET": "<CLIENT_SECRET>",
        "GDRIVE_CREDS_DIR": "/path/to/config/directory"
      }
    }
  }
}

After authentication, your MCP-enabled app can start using the gdrive tools.

Additional notes

Tips and notes:

  • Ensure the OAuth credentials are in the directory specified by GDRIVE_CREDS_DIR and that the file name is gcp-oauth.keys.json as described in the README.
  • The first run requires browser-based authentication; keep the environment variables consistent across sessions to reuse the saved token.
  • When using gdrive_search, you can paginate results with pageToken and pageSize up to 100.
  • Google Workspace exports are provided for Docs, Sheets, and Presentations; other file types are delivered in their native formats.
  • If you encounter scope or permission errors, double-check that the OAuth client has the Drive and Sheets scopes enabled and that the OAuth consent screen is configured appropriately.
  • Use the provided examples to structure your own app’s server configuration inside the MCP system.

Related MCP Servers

Sponsor this space

Reach thousands of developers