Skip to main content
Glama
google-sheets-readonly-mcp

google-sheets-readonly-mcp

by taittag

google-sheets-readonly-mcp

A lightweight, strictly READ-ONLY Model Context Protocol (MCP) server for reading Google Sheets from AI agents (Antigravity, Claude Code, Claude Desktop, Cursor, etc.).

Designed for teams and knowledge bases that enforce a zero-write safety policy on company spreadsheets.

Why This Exists (3-Layer Read-Only Guarantee)

Most Google Sheets MCP servers request full read+write scopes and expose cell-editing tools. google-sheets-readonly-mcp enforces read-only access at three independent layers:

  1. OAuth Consent Layer: Requests strictly one scope: https://www.googleapis.com/auth/spreadsheets.readonly.

  2. Token Verification Layer: Refuses to run if token.json contains any non-readonly scope.

  3. Code & Transport Layer: Only executes HTTP GET against allowlisted Google hosts (sheets.googleapis.com / docs.google.com) and exposes only read tools (read_only_hint=True, destructive_hint=False), plus built-in PII cell warnings (phones/emails) and ? hypothesis-cell highlighting.


Related MCP server: Google Sheets MCP Server

Exposed Tools (4 Read-Only Tools)

Tool

Auth Required

What It Does

sheets_read_public_csv

None (view-only shared link)

Reads a link-shared Google Sheet tab (gid) via HTTP GET CSV export; returns Markdown table, rows, PII cell warnings, and ? cells.

sheets_get_metadata

OAuth spreadsheets.readonly

Lists spreadsheet title, locale, and all tab names & grid dimensions.

sheets_read_tab

OAuth spreadsheets.readonly

Reads any tab or A1 range from a private/shared Google Sheet as Markdown + rows + PII cell warnings.

sheets_read_persona_matrix

OAuth spreadsheets.readonly

Reads a structured matrix tab (e.g., qualitative Persona / research table) with ? hypothesis extraction and PII warnings.


Installation

pip install git+https://github.com/taittag/google-sheets-readonly-mcp.git

Or install locally in editable mode:

git clone https://github.com/taittag/google-sheets-readonly-mcp.git
cd google-sheets-readonly-mcp
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytest -q

Quick Setup

Works immediately after installation via sheets_read_public_csv.

Mode B — Private Google Sheets (One-Time OAuth spreadsheets.readonly, ~3 min)

  1. In Google Cloud Console, enable Google Sheets API.

  2. Configure OAuth consent screen (add scope https://www.googleapis.com/auth/spreadsheets.readonly and add your Google account under Test Users).

  3. Create Credentials → OAuth client ID → Desktop app and download the JSON file.

  4. Save it outside git with 0600 permissions:

    mkdir -p ~/.config/google-sheets-readonly-mcp
    mv ~/Downloads/client_secret_*.json ~/.config/google-sheets-readonly-mcp/credentials.json
    chmod 600 ~/.config/google-sheets-readonly-mcp/credentials.json
  5. Authorize once (opens browser, saves token.json at mode 0600, auto-refreshes):

    google-sheets-readonly-mcp --auth
    google-sheets-readonly-mcp --status

Agent Configuration

Antigravity CLI (~/.gemini/config/mcp_config.json)

{
  "mcpServers": {
    "google-sheets-readonly": {
      "command": "/path/to/google-sheets-readonly-mcp/.venv/bin/google-sheets-readonly-mcp",
      "args": []
    }
  }
}

Claude Code (.mcp.json or ~/.claude.json)

{
  "mcpServers": {
    "google-sheets-readonly": {
      "command": "/path/to/google-sheets-readonly-mcp/.venv/bin/google-sheets-readonly-mcp",
      "args": []
    }
  }
}

(Override credential directory via GSHEETS_CONFIG_DIR, GSHEETS_CREDENTIALS_PATH, or GSHEETS_TOKEN_PATH.)

License

MIT

Available Tools

4 tools
sheets_get_metadataB
Read-onlyIdempotent

Read Google Spreadsheet title and list of tabs/dimensions via OAuth spreadsheets.readonly (READ ONLY).

Inputs: spreadsheet (required). Returns: object

sheets_read_persona_matrixB
Read-onlyIdempotent

Read a matrix/persona tab via OAuth spreadsheets.readonly, extracting ? hypothesis cells and PII warnings (READ ONLY).

Inputs: spreadsheet (required), tab_name. Returns: object

sheets_read_public_csvB
Read-onlyIdempotent

Read a link-shared (view-only) Google Sheet tab via HTTP GET CSV export with zero OAuth setup, plus PII & ? cell highlights (READ ONLY).

Inputs: spreadsheet (required), gid, max_rows. Returns: object

sheets_read_tabA
Read-onlyIdempotent

Read a Google Sheet tab or A1 range via OAuth spreadsheets.readonly as Markdown + rows with PII cell warnings (READ ONLY).

Inputs: tab_name (required), spreadsheet (required), a1_range, max_rows. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 4 tools

    Disambiguation4/5

    Each tool targets a distinct read path: metadata, generic tab/range, persona-matrix extraction, and public CSV export. The boundary between sheets_read_tab and sheets_read_persona_matrix is a bit soft (the latter is a specialized tab read), but descriptions make the difference clear.

    Naming Consistency4/5

    All names use the sheets_ prefix with a verb_noun shape (sheets_read_tab, sheets_read_public_csv). The lone deviation is sheets_get_metadata using 'get' instead of 'read', which is a minor inconsistency rather than a confusing one.

    Tool Count4/5

    Four tools is a sensible surface for a deliberately read-only Sheets server. No obvious padding, though the set is just shy of feeling thin since a couple of tools are narrowly scoped variants.

    Completeness5/5

    For a read-only scope, the surface covers the lifecycle: discover sheet structure (metadata), read arbitrary tabs/ranges, handle a specialized matrix format, and access link-shared sheets without OAuth. No write operations exist by design, so there are no true gaps for the stated purpose.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to read, write, and manage Google Sheets through 34 tools across optional toolsets, including formatting, charts, and pivot tables, with OAuth/service-account auth and token-efficient responses.
      43 npm
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI apps to work with Google Sheets in plain language: finding spreadsheets, reading and writing ranges, managing sheets, formatting, validation, protected ranges, tables, charts, and access control, with deliberate writes and destructive operations clearly marked.
      26
      278 npm
      3
      MIT