Integration handbook

Claude / Google Sheets ยท Documentation-reviewed guide

Google Sheets for Claude

Read precise spreadsheet ranges, understand formulas and types, and review cell-level changes before writing to a live workbook.

Official setup guide (opens in a new tab)
Connection
Sheets connector / MCP / API
Access
Scoped to your account
Testing
Not account-tested
Contents & search

Connect Claude to Google Sheets

Sheets is useful for reconciliation, reporting and cleaning a defined table. A workbook is not a uniform database: tabs, formulas, merged headers and manually maintained totals can change the meaning of the same-looking rows.

Use Claude's dedicated Sheets connector for supported interactive editing, the official custom MCP for the documented developer route, or the Sheets REST API in your own application. Reading a spreadsheet through Drive is not proof that the dedicated editing tool is authorized.

Before you start

  1. Identify spreadsheet ID, tab title, exact A1 range and whether headers/totals/formulas are included.
  2. Confirm the Google account, file edit access and protected ranges. Work on a copy for destructive or structural tests.
  3. For a custom MCP configuration, follow Google Cloud/API/consent instructions and verify the required Claude plan. The built-in connector uses its own provider sign-in flow.

Authorization & setup

For the native route, enable the dedicated Sheets connector in Claude and open a known spreadsheet. Do not assume a Drive connection alone grants the same tool surface.

For custom MCP, Google documents an OAuth client with the Claude callback and AI-powered-agent setting. For REST, use scoped OAuth or a deliberately authorized service account; do not treat an API key as sufficient access to a private workbook.

Permission decisions before connecting
Route / permissionPurposeBoundary
spreadsheets.readonlyRead spreadsheet dataNo cell edits
spreadsheetsWrite spreadsheet contentVerify target file and protected ranges
Drive scopes in MCP setupSupporting file accessReview Google's exact required scopes and consent
Source: Provider authorization reference
  1. Select the built-in Sheets connector or explicitly choose the custom MCP path; do not combine instructions from both.
  2. For custom MCP only, configure the Cloud project and consent scopes, create the OAuth client with https://claude.ai/api/mcp/auth_callback and the documented agent setting.
  3. Add https://sheetsmcp.googleapis.com/mcp/v1 as the custom connector with your OAuth client details.
  4. Open a test workbook and read a small named range. Compare headers, displayed values and formulas before editing.
  5. Preview exact cell changes and keep approval on for writes. Prefer a bounded range update over a whole-tab replacement.

Local environment for custom code

The hosted connector signs in through the provider; it does not read an environment file from this website. The following placeholders are only for a separate server-side project. Keep .env.local ignored by Git and configure deployment secrets separately. Never use NEXT_PUBLIC_ for these values.

.env.local - placeholders only

ENV
# Custom REST app only
GOOGLE_ACCESS_TOKEN=replace_with_scoped_oauth_access_token
GOOGLE_SPREADSHEET_ID=replace_with_spreadsheet_id

Supported operations & boundaries

Google Sheets: choose the right operation
OperationRouteImportant boundary
Read cell rangesSheets MCP / RESTChoose formatted values, raw values or formulas deliberately
Update cellsApproved connector/API writesDo not overwrite formulas or protected regions
Insert/delete rows or columnsStructural tools/batch updatesCan shift references and downstream ranges
Find/share the fileDrive surfaceSharing changes are separate from spreadsheet edits
Source: Provider capability reference

Make a bounded first request

Read a bounded A1 range

CURL
curl --fail-with-body --get \
  "https://sheets.googleapis.com/v4/spreadsheets/$GOOGLE_SPREADSHEET_ID/values/Sheet1%21A1%3AD10" \
  --data-urlencode "valueRenderOption=UNFORMATTED_VALUE" \
  --header "Authorization: Bearer $GOOGLE_ACCESS_TOKEN"

Replace Sheet1 with the real tab title and URL-encode the A1 range. UNFORMATTED_VALUE requests underlying calculated values, not the formula text. An omitted trailing cell is not necessarily a zero; preserve the returned row/column shape.

Endpoint & protocol reference

These are provider API or protocol entry points, not a promise that the same named operation is exposed in every MCP client. Discover the live MCP tool schema before calling it. Follow the linked reference for request bodies, pagination, permissions and current limits.

A practical workflow

  1. For a reconciliation, define the matching key and the two source ranges. Record tab titles, header row and report date.
  2. Read only required columns, plus formulas where needed to distinguish calculated from entered values.
  3. Normalize dates, currencies and empty cells explicitly. Report unmatched and duplicate keys separately; do not fuzzy-merge customer records automatically.
  4. Produce a proposed change table with cell/range, old value, new value and reason. Preserve formulas, totals and protected ranges.
  5. After approval, apply a small bounded change and read it back. Verify totals and formulas still make sense; retain a copy or reversible before-state for risky edits.

AI agent playbook

Analyze exact ranges or apply approved cell changes without damaging workbook logic.

Execution contract
BoundaryRequired context
Required inputsSpreadsheet ID and tab; A1 range and headers; Stable record key; Value/formula mode; Write budget and protected regions
Approval requiredCell writes, structural edits or formula changes; Sharing/protection changes
Stop conditionsAmbiguous keys; Concurrent row movement; Unknown formula or protection impact
Return to the userRanges and rendering mode; Differences with cell references; Approved writes and verification; Unresolved rows and recovery evidence
Source: Handbook editorial workflow (not a provider guarantee)
  1. Inspect metadata, headers and relevant formulas.
  2. Read bounded ranges with explicit rendering.
  3. Identify duplicates and preserve row/column shape.

Troubleshooting

The API cannot parse the range
Likely cause
The tab title or A1 range may need quoting or URL encoding.
What to do
Inspect metadata, use the actual title and encode the range rather than guessing Sheet1.
The totals changed unexpectedly
Likely cause
A write may have overwritten a formula or interpreted values using the wrong input mode.
What to do
Stop further writes, inspect the affected cells and propose a recovery from the saved before-state or file history.
The connector reads but cannot edit
Likely cause
Read-only authorization, file access or protected ranges may prevent writes.
What to do
Check the selected route and target permissions; do not remove protections without approval.

Revoke access, costs & maintenance

  1. Disconnect the selected connector/custom MCP and review Google third-party grants.
  2. Revoke unused custom OAuth credentials or service account access separately.
  3. Keep approved before/after evidence and review scheduled jobs; authorization cleanup does not undo existing cell changes.

Google API quotas, Workspace policies and client plan requirements apply. Use narrow ranges or batch reads, not repeated full-workbook downloads. Recheck current batch limits and rendering semantics before bulk processing.

Prompts to get started

Start with read-only questions. Replace placeholders with your own account context; these are examples, not live results.

Read-only reconciliation

PROMPTCopy into your conversation
Compare [spreadsheet/range A] and [range B] using [stable key]. Inspect headers and formulas first. Report duplicate keys, unmatched rows and proposed corrections with source cell references. Do not edit values, formulas, structure or sharing.
Cell-level write preview

PROMPTCopy into your conversation
Prepare changes only for [approved IDs/range]. Show before/after cells and value input mode. Preserve formulas and protected ranges. Wait for approval, then re-check row identities and read back the changed cells.

Frequently asked questions

Why are numbers displayed differently in the API?

Rendering options affect formatted strings, calculated values and formula text. Pick the representation appropriate to the task and state which one was used.

Is a Google API key enough for a private sheet?

No. Use a properly authorized OAuth identity or explicitly permitted service account. A file ID alone grants no private access.

Is this account-tested or a working connection?

No. Official documentation was reviewed on November 17, 2026. This guide does not connect accounts or execute examples. Validate with your own permissions before adopting it in an agent.

Sources & resources

References used in this guide

Documentation-reviewed guide. Provider facts come from the linked references; workflow recommendations and agent approval boundaries are our editorial guidance. No private account, paid action or end-to-end workflow was tested.

Logos are local SVGs from Simple Icons. Brand marks belong to their respective owners; credits are not an endorsement. No provider screenshots have been copied into this preview.

Icon library & licensing