Google Drive & Sheets MCP server

Integrates with Google Drive and Google Sheets to enable document searching, content reading, and spreadsheet manipulation through OAuth authentication and resource-based access.
Back to servers
Setup instructions
Provider
Phil Isaac
Release date
Mar 19, 2025
Language
TypeScript
Stats
2 stars

This MCP server integrates with Google Drive to allow listing, reading, and searching files, as well as the ability to read and write to Google Sheets. It provides a streamlined way to access and manipulate Google Drive content through a standardized protocol interface.

Installation

Prerequisites

  1. Create a new Google Cloud project
  2. Enable the Google Drive API
  3. Configure an OAuth consent screen ("internal" is fine for testing)
  4. Add OAuth scopes:
    • https://www.googleapis.com/auth/drive.readonly
    • https://www.googleapis.com/auth/spreadsheets
  5. Create an OAuth Client ID for application type "Desktop App"
  6. Download the JSON file of your client's OAuth keys

Setup Instructions

  1. Create a configuration directory for the MCP server
  2. Rename your OAuth key file to gcp-oauth.keys.json and place it in your configuration directory
  3. Note your OAuth Client ID and Client Secret for environment variables
  4. Install and build the server:
npm install
npm run build

Installing via Smithery

For an automated installation with Claude Desktop:

npx -y @smithery/cli install @rishipradeep-think41/drive-mcp --client claude

Usage

Authentication

When making your first request, you'll be prompted to authenticate in your browser. You must use an account within the same organization as your Google Cloud project.

Your OAuth token will be saved in the directory specified by the GDRIVE_CREDS_DIR environment variable for future use.

Integration with Desktop App

Add the following to your app's server configuration:

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

Available Tools

Google Drive Search

Search for files in your Google Drive:

  • Input parameters:
    • query (string): Search query
    • pageToken (string, optional): Token for pagination
    • pageSize (number, optional): Number of results per page (max 100)
  • Output: File names and MIME types of matching files

Google Drive File Reading

Read contents of a file from Google Drive:

  • Input parameters:
    • fileId (string): ID of the file to read
  • Output: Contents of the specified file

Google Sheets Reading

Read data from a Google Spreadsheet:

  • Input parameters:
    • spreadsheetId (string): The ID of the spreadsheet
    • ranges (array of strings, optional): A1 notation ranges (e.g., ['Sheet1!A1:B10'])
    • sheetId (number, optional): Specific sheet ID to read
  • Output: Data from the specified spreadsheet range

Google Sheets Cell Update

Update cell values in a Google Spreadsheet:

  • Input parameters:
    • fileId (string): ID of the spreadsheet
    • range (string): Cell range in A1 notation (e.g., 'Sheet1!A1')
    • value (string): New cell value
  • Output: Confirmation of the update

Resource Access

The server provides access to Google Drive files using the resource identifier format:

gdrive:///<file_id>

Supported file types and conversions:

  • Google Workspace files are automatically exported:
    • Docs → Markdown
    • Sheets → CSV
    • Presentations → Plain text
    • Drawings → PNG
  • All other files are provided in their native format

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

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

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

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

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later