SuperAPIAI Directory

mcp-google-sheets

github.com · AI office

Create, read, update and manage spreadsheets through the Google Sheets API.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsmacOS · Linux

About this tool

mcp-google-sheets is a Python-based MCP (Model Context Protocol) server that acts as a bridge between any MCP-compatible client (such as Claude Desktop) and the Google Sheets API. It allows users to interact with Google spreadsheets using a defined set of tools, thereby enabling powerful AI-driven automation and data manipulation workflows.

Main Purpose

  • Create, modify, and manage Google spreadsheets in MCP-compatible clients via natural language or AI instructions.
  • Provide AI assistants with direct access to Google Drive and Google Sheets to perform spreadsheet data operations.

Main Capabilities

The server provides multiple tools for operating on Google Sheets:

  • list_spreadsheets: Lists spreadsheets in the configured Drive folder (service account) or accessible to the user. The optional parameter folder_id specifies the Drive folder ID. Returns a list of objects containing id and title.
  • create_spreadsheet: Creates a new spreadsheet. Parameters: title (title), optional folder_id specifies the creation location. Returns an object containing spreadsheetId, title, and folder.
  • get_sheet_data: Reads data from a specified range of a worksheet/tab. Parameters: spreadsheet_id, sheet, optional range (A1 notation), and include_grid_data (default False; if True, returns the full grid data). Returns values only or the full grid data.
  • get_sheet_formulas: Reads formulas in a specified range. Parameters: spreadsheet_id, sheet, optional range. Returns a two-dimensional array of formulas.
  • update_cells: Writes data to a specified range, overwriting existing data. Parameters: spreadsheet_id, sheet, range (A1 notation), data (two-dimensional array). Returns the update result.
  • batch_update_cells: Updates multiple ranges in a single API call. Parameters: spreadsheet_id, sheet, ranges (dictionary mapping range strings to two-dimensional arrays). Returns the operation result.
  • add_rows: Inserts empty rows at a specified index. Parameters: spreadsheet_id, sheet, count (number of rows to insert), optional start_row (0-based starting row index, default 0). Returns the operation result.
  • list_sheets: Lists all worksheet/tab names in a spreadsheet. Parameter: spreadsheet_id. Returns a list of name strings.
  • create_sheet: Adds a new worksheet/tab to a spreadsheet. Parameters: spreadsheet_id, title (new worksheet name). Returns the new worksheet property object.
  • get_multiple_sheet_data: Retrieves data from multiple ranges (possibly across different spreadsheets) in a single call. Parameter: queries (array of objects, each containing spreadsheet_id, sheet, range). Returns a list of objects containing the query parameters and the retrieved data or error. In addition, the official text also mentions the following tools (some detailed parameters are not listed due to truncation):
  • get_multiple_spreadsheet_summary
  • find_in_spreadsheet
  • search_spreadsheets
  • share_spreadsheet

Usage

Quick Start (using uvx)

The server can be run with a single command:

uvx mcp-google-sheets@latest

This command automatically downloads the latest code and runs it. It is recommended to always use @latest to ensure you get the latest features and bug fixes.

Prerequisites

  1. Google Cloud setup: Google Cloud Platform credentials must be configured and the necessary APIs enabled; using a service account is strongly recommended.
  2. Install uv: uvx is part of uv. If it is not yet installed, it can be installed with the following command:
    • macOS / Linux:curl -LsSf https://astral.sh/uv/install.sh | sh
    • Windows PowerShell:powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
    • Or use pip:pip install uv Add uv to PATH according to the installer output.
  3. Set environment variables (service account recommended): Authentication information needs to be set. Set the following variables in the terminal:
    • Linux/macOS:
      export SERVICE_ACCOUNT_PATH="/path/to/your/service-account-key.json"
      export DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
      
    • Windows CMD:
      set SERVICE_ACCOUNT_PATH="C:\\path\\to\\your\\service-account-key.json"
      set DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
      
    • Windows PowerShell:
      $env:SERVICE_ACCOUNT_PATH="C:\\path\\to\\your\\service-account-key.json"
      $env:DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
      
    For other authentication methods (OAuth, CREDENTIALS_CONFIG), see the official documentation.

Running the server

uvx will automatically download and run the latest version of mcp-google-sheets:

uvx mcp-google-sheets@latest

After the server starts, it will print logs indicating that it is ready. It is recommended to always use @latest to avoid using a cached older version.

Connecting an MCP client

Configure your client (such as Claude Desktop) to connect to the running server. Depending on the client, you may not need to manually run step 4, because the client can start the server for you. However, it is a good habit to test-run step 4 to ensure the setup is correct.

Optional: Enable tool filtering (reduce context usage)

By default, all 19 tools are enabled (about 13,000 tokens). If you only need a few tools, you can enable tool filtering to reduce context window usage. You can specify the enabled tools via the command-line argument --include-tools or the environment variable ENABLED_TOOLS (comma-separated, no spaces). Common tool subset: get_sheet_data, update_cells, list_spreadsheets, list_sheets. All available tool names: batch_update_cells, create_spreadsheet, find_in_spreadsheet, get_multiple_sheet_data, get_multiple_spreadsheet_summary, get_sheet_formulas, list_spreadsheets, search_spreadsheets, share_spreadsheet. Note: If --include-tools or ENABLED_TOOLS is not specified, all tools are enabled by default.

Use cases

  • Scenarios where you need to automatically create, read, update, and share Google spreadsheets in an AI assistant.
  • Automated workflows such as data aggregation, report generation, and batch data processing.
  • AI applications that use natural language to interact with spreadsheets.

Limitations

  • Google Cloud Platform credentials must be configured, and the Google Sheets API and Google Drive API must be enabled.
  • A service account is recommended, but other authentication methods are also available.
  • All tools are enabled by default, which may consume many context tokens and requires manual filtering.
  • The specific parameters of some tools (such as formatting, sharing, etc.) are not listed in detail in the official text.
  • The official text is at get_multiple_sheet_data is truncated, and the subsequent tool descriptions are incomplete.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools