home / mcp / google drive mcp server

Google Drive MCP Server

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

Installation
Add the following to your MCP client configuration file.

Configuration

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

This MCP server connects with Google Drive to list, read, and search files, and to read and write Google Sheets. It enables you to access Drive data and Sheets content directly from your MCP client, turning Drive and Sheets into programmable data sources for automation and workflow integration.

How to use

You integrate the Google Drive MCP server into your setup by configuring it as an MCP server within your client. Once running, you can search Drive for files, read file contents, and read or update data in Google Sheets. Authenticate once with a browser-based flow, and your OAuth token is stored for subsequent uses.

How to install

Prerequisites: you need Node.js and npm installed on your system. You also need access to a Google Cloud project with Drive and Sheets APIs enabled and a set of OAuth credentials.

Steps to install and run the server locally:

1. Create a new Google Cloud project and enable the Drive API and Sheets API.

2. Create OAuth credentials for a Desktop App and download the JSON file.

3. Rename the credentials file to gcp-oauth.keys.json and place it in your chosen config directory, e.g. /Users/you/.config/mcp-gdrive.

4. Set environment variables for your client ID, client secret, and the credentials directory. Create a .env file with:

GDRIVE_CREDS_DIR=/path/to/config/directory
CLIENT_ID=<CLIENT_ID>
CLIENT_SECRET=<CLIENT_SECRET>

Additional setup and run details

Build and start the server using your normal Node workflow if applicable. Then run the authentication flow to authorize access to your Google Workspace data.

Usage with Desktop App

To wire this server into a desktop app, include the MCP server configuration that runs via npx and passes your Google OAuth credentials.

{
  "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"
      }
    }
  }
}

Available tools

gdrive_search

Search for files in Google Drive using a query, returning matching file names and MIME types.

gdrive_read_file

Read the contents of a file from Google Drive by specifying its fileId.

gsheets_read

Read data from a Google Spreadsheet with optional ranges and sheet targeting.

gsheets_update_cell

Update a single cell in a Google Spreadsheet by providing the fileId, cell range, and new value.