home / mcp / google drive & sheets mcp server

Google Drive & Sheets MCP Server

Provides MCP endpoints to interact with Google Drive files and Google Sheets data for agent workflows.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "distrihub-mcp-google-workspace": {
      "command": "mcp-google",
      "args": [
        "drive",
        "--access-token",
        "<your-access-token>"
      ],
      "env": {
        "ACCESS_TOKEN": "<your-access-token>",
        "GOOGLE_CLIENT_ID": "<your-client-id>",
        "GOOGLE_CLIENT_SECRET": "<your-client-secret>",
        "GOOGLE_REFRESH_TOKEN": "<your-refresh-token>"
      }
    }
  }
}

You run a pair of MCP servers that expose Google Drive and Google Sheets capabilities to your agent workflows. The servers implement the Model Context Protocol (MCP) and let you list Drive files, read and write Sheets data, create spreadsheets, and clear values in ranges, all through a consistent MCP interface. You can host each service as its own stdio MCP server or connect to them via a Distri-style configuration.

How to use

Start the Drive MCP server and the Sheets MCP server to expose Google Workspace capabilities to MCP clients. Each server runs independently and speaks the MCP protocol over stdio.

From an MCP client or a Distri agent, you can reference the two servers as separate MCP endpoints. For local running, you will start the drives server with the appropriate access token and then do the same for Sheets. You can then compose calls to list files or read and write spreadsheet data as part of larger agent workflows.

To connect through Distri, specify each server as its own MCP entry using the command that starts the server locally, as shown in the installation and usage steps. The Drive server and the Sheets server are independent endpoints and can be started in any order.

How to install

Prerequisites you need before installing and running the servers:

• Rust (latest stable version) and cargo installed on your system.

• A Google Cloud Project with Drive and Sheets APIs enabled.

• OAuth 2.0 credentials configured for your Google Cloud Project.

Install the MCP Google Workspace binary directly from the stable source using cargo.

cargo install --git https://github.com/distrihub/mcp-google-workspace.git

Token management and configuration

Before starting, you must provide OAuth tokens and client credentials to the MCP servers. You will typically set environment variables for access tokens and client secrets.

Examples of common environment variables you will configure include ACCESS_TOKEN, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, and GOOGLE_REFRESH_TOKEN. These enable the servers to authenticate with Google services.

If your tokens expire, refresh them using the token management command shown below.

mcp-google refresh \
  --client-id <your-client-id> \
  --client-secret <your-client-secret> \
  --refresh-token <your-refresh-token>

Additional usage notes

You can run each MCP server locally and connect to it via standard MCP tooling or a Distri-based configuration. The Drive server handles file listing with filtering, MIME-type controls, custom search queries, page size, and ordering. The Sheets server supports reading and writing values, creating new spreadsheets with multiple sheets, and clearing values in ranges.

When using Distri, you can wire both servers into an agent configuration, each as its own MCP endpoint, so your agent can drive both Drive and Sheets operations in a single workflow.

Available tools

list_files

List files in Google Drive with optional MIME-type filtering, custom search queries, page size, and ordering.

read_values

Read data from Google Sheets with options to specify a range and major dimension (ROWS or COLUMNS).

write_values

Write data to Google Sheets.

create_spreadsheet

Create new spreadsheets with a custom title and multiple sheets.

clear_values

Clear values in specified ranges within a spreadsheet.