Google Spreadsheet MCP server

Integrates with Google Drive and Sheets to enable document management, file operations, and spreadsheet manipulation without switching contexts.
Back to servers
Provider
Kazuki Akamine
Release date
Mar 19, 2025
Language
Go
Stats
18 stars

This MCP server enables AI assistants to interact with Google Spreadsheets and Google Drive files. It provides a set of commands for file operations and spreadsheet manipulation, serving as a bridge between AI systems and Google's productivity tools.

Prerequisites

  • Go 1.24 or higher
  • Google Cloud Platform project with the following APIs enabled:
    • Google Drive API
    • Google Sheets API

Installation

Install the MCP Google Spreadsheet server using Go:

go install github.com/kazz187/mcp-google-spreadsheet@latest

This will install the mcp-google-spreadsheet binary in your $GOPATH/bin directory.

Configuration

Environment Variables

You'll need to set the following environment variables:

  • MCPGS_CLIENT_SECRET_PATH: Path to your Google API client secret file
  • MCPGS_TOKEN_PATH: Path where the Google API token will be stored (created automatically if not present)
  • MCPGS_FOLDER_ID: The ID of the Google Drive folder you want to work with

Setting Up Google API Access

  1. Visit the Google Cloud Console
  2. Create a new project
  3. Enable the Google Drive API and Google Sheets API
  4. Create authentication credentials (OAuth client ID)
  5. Download the client secret file

Starting the Server

Run the server with your configuration:

export MCPGS_CLIENT_SECRET_PATH=/path/to/client_secret.json
export MCPGS_TOKEN_PATH=/path/to/token.json
export MCPGS_FOLDER_ID=your_folder_id
mcp-google-spreadsheet

Ensure that $GOPATH/bin is in your PATH if you installed via go install.

During the first run, authentication is required. A browser window will open automatically for Google account authentication. After authentication, you'll be returned to the application. If the browser doesn't open automatically, visit the URL shown in the console.

Integrating with AI Assistants

To use this server with AI assistants like Claude or ChatGPT, add the following to your MCP configuration file:

{
  "mcpServers": {
    "mcp_google_spreadsheet": {
      "command": "mcp-google-spreadsheet",
      "args": [],
      "env": {
        "MCPGS_CLIENT_SECRET_PATH": "/path/to/client_secret.json",
        "MCPGS_TOKEN_PATH": "/path/to/token.json",
        "MCPGS_FOLDER_ID": "your_folder_id"
      }
    }
  }
}

If you installed using go install, you can specify just the executable name in the command field as shown above, but make sure $GOPATH/bin is in the PATH of the user running the MCP server.

Available Commands

Google Drive Operations

  • list_files: Get a list of files in Google Drive
  • copy_file: Copy a file in Google Drive
  • rename_file: Rename a file in Google Drive

Google Spreadsheet Operations

  • list_sheets: Get a list of sheets in a spreadsheet
  • copy_sheet: Copy a sheet within a spreadsheet
  • rename_sheet: Rename a sheet in a spreadsheet
  • get_sheet_data: Retrieve data from a sheet
  • add_rows: Add rows to a sheet
  • add_columns: Add columns to a sheet
  • update_cells: Update cells in a single range
  • batch_update_cells: Update cells in multiple ranges at once

Security Notes

  • Access is restricted to files within the specified folder ID
  • Directory traversal attacks are prevented
  • Files requested by users are verified to exist within the specified folder

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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