Skip to main content
Glama
Google Sheets MCP Server

Google Sheets MCP Server

by xmqywx

Google Sheets MCP Server

npm version License: MIT

A production-ready Model Context Protocol server that gives AI assistants full access to Google Sheets. Read, write, format, and manage spreadsheets directly from Claude, GPT, or any MCP-compatible client.

What It Does

This MCP server wraps the Google Sheets API v4 and exposes 14 tools that let AI assistants:

  • Create and manage spreadsheets

  • Read and write cell data

  • Append rows, clear ranges, search across sheets

  • Apply formatting (bold, colors, number formats, alignment)

  • Get sheet overviews with sample data

Related MCP server: mcp-google-sheets

Available Tools (14)

Tool

Description

list_spreadsheets

List recent spreadsheets from Google Drive

create_spreadsheet

Create a new spreadsheet with custom sheet names

get_spreadsheet

Get spreadsheet metadata (title, sheets, locale, timezone)

list_sheets

List all sheets/tabs in a spreadsheet

add_sheet

Add a new sheet/tab

delete_sheet

Delete a sheet/tab by ID

read_range

Read cells from a range (e.g., Sheet1!A1:D10)

write_range

Write a 2D array of values to a range

append_rows

Append rows to the end of a sheet

clear_range

Clear all values in a range

get_values

Get all values from a sheet

format_cells

Apply formatting (bold, italic, colors, number format, alignment)

search_sheets

Search for text across all sheets (case-insensitive)

sheet_overview

Get row/column counts, headers, and sample data

Quick Start

Install

npm install -g @xmqywxkris/google-sheets-mcp

Or use directly with npx:

npx -y @xmqywxkris/google-sheets-mcp

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "google-sheets": {
      "command": "npx",
      "args": ["-y", "@xmqywxkris/google-sheets-mcp"],
      "env": {
        "GOOGLE_SERVICE_ACCOUNT_KEY": "/path/to/service-account.json"
      }
    }
  }
}

Claude Code

claude mcp add google-sheets -- npx -y google-sheets-mcp

# Set the environment variable
export GOOGLE_SERVICE_ACCOUNT_KEY="/path/to/service-account.json"

Authentication

Full read/write access. Best for automation and production use.

  1. Go to Google Cloud Console

  2. Create a project (or select an existing one)

  3. Enable the Google Sheets API and Google Drive API

  4. Go to Credentials > Create Credentials > Service Account

  5. Create the service account and download the JSON key file

  6. Set the environment variable:

export GOOGLE_SERVICE_ACCOUNT_KEY="/path/to/service-account.json"
  1. Important: Share your spreadsheets with the service account email (found in the JSON file as client_email) to grant access.

Option 2: API Key (Read-Only)

Simpler setup, but only works with publicly shared spreadsheets.

  1. Go to Google Cloud Console

  2. Enable the Google Sheets API

  3. Go to Credentials > Create Credentials > API Key

  4. Set the environment variable:

export GOOGLE_SHEETS_API_KEY="your-api-key"

Configuration

Variable

Required

Description

GOOGLE_SERVICE_ACCOUNT_KEY

One of these

Path to service account JSON key file (full access)

GOOGLE_SHEETS_API_KEY

is required

Google API key (read-only, public sheets only)

Usage Examples

Data analysis:

"Read the sales data from my spreadsheet and summarize Q1 results"

Report generation:

"Create a new spreadsheet called 'Monthly KPIs', add headers, and format them bold with a blue background"

Data entry:

"Append these 50 customer records to the Customers sheet"

Search and audit:

"Search all sheets for cells containing 'ERROR' or 'N/A'"

Formatting:

"Bold the header row, set currency format on column C, and color negative values red"

Sheet management:

"Add a 'Summary' tab and populate it with totals from other sheets"

Development

git clone https://github.com/xmqywx/google-sheets-mcp.git
cd google-sheets-mcp
npm install
npm run dev

Build for production:

npm run build
npm start

Cursor Plugin

Install directly in Cursor IDE:

  1. Open Cursor → Settings → Plugins

  2. Search "google-sheets-mcp"

  3. Click Install

  4. Configure your Google credentials in the MCP server settings

Or manually: clone this repo and open it in Cursor — the plugin auto-discovers.

License

MIT

Available Tools

14 tools
add_sheetC

Add a new sheet/tab to a spreadsheet

Inputs: title (required), spreadsheetId (required).

append_rowsB

Append rows to the end of a sheet

Inputs: range (required), values (required), spreadsheetId (required).

clear_rangeB

Clear all values from a range of cells

Inputs: range (required), spreadsheetId (required).

create_spreadsheetC

Create a new Google Spreadsheet

Inputs: title (required), sheetNames.

delete_sheetC

Delete a sheet/tab from a spreadsheet

Inputs: sheetId (required), spreadsheetId (required).

format_cellsC

Apply formatting to a range of cells (bold, color, number format, alignment)

Inputs: endCol (required), endRow (required), sheetId (required), startCol (required), +9 more.

get_spreadsheetB

Get spreadsheet metadata including title, sheets, and locale

Inputs: spreadsheetId (required).

get_valuesC

Get all values from a sheet

Inputs: sheetName (required), spreadsheetId (required).

list_sheetsB

List all sheets/tabs in a spreadsheet

Inputs: spreadsheetId (required).

list_spreadsheetsB

List recent spreadsheets from Google Drive (requires service account)

Inputs: maxResults.

read_rangeC

Read cells from a range (e.g., 'Sheet1!A1:D10')

Inputs: range (required), spreadsheetId (required).

search_sheetsA

Search for text across all sheets in a spreadsheet

Inputs: query (required), spreadsheetId (required).

sheet_overviewB

Get an overview of a sheet with row/column counts and sample data

Inputs: sheetName (required), spreadsheetId (required), sampleRows.

write_rangeC

Write data to a range in a spreadsheet

Inputs: range (required), values (required), spreadsheetId (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 14 tools

    Disambiguation4/5

    Most tools have clearly distinct actions and resources, but read_range, get_values, and sheet_overview all retrieve cell/range data with only modest differentiation from names and descriptions. search_sheets and list_sheets are also adjacent but still distinguishable.

    Naming Consistency4/5

    Almost all names follow a verb_noun snake_case pattern (list_spreadsheets, create_spreadsheet, read_range, append_rows). The main deviation is sheet_overview, which uses a noun_noun form instead of a verb-led pattern.

    Tool Count5/5

    With 14 tools, the server is well-scoped for spreadsheet work: enough tools to cover spreadsheet, sheet, range, formatting, and search operations without excessive fragmentation.

    Completeness4/5

    Core spreadsheet lifecycle and data operations are covered: listing, creating, reading, writing, appending, clearing, formatting, searching, and sheet management. Minor gaps exist, such as no delete_spreadsheet or rename_sheet/update_sheet metadata operation.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers