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
Find in guide
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
- Identify spreadsheet ID, tab title, exact A1 range and whether headers/totals/formulas are included.
- Confirm the Google account, file edit access and protected ranges. Work on a copy for destructive or structural tests.
- 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.
| Route / permission | Purpose | Boundary |
|---|---|---|
| spreadsheets.readonly | Read spreadsheet data | No cell edits |
| spreadsheets | Write spreadsheet content | Verify target file and protected ranges |
| Drive scopes in MCP setup | Supporting file access | Review Google's exact required scopes and consent |
- Select the built-in Sheets connector or explicitly choose the custom MCP path; do not combine instructions from both.
- 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.
- Add https://sheetsmcp.googleapis.com/mcp/v1 as the custom connector with your OAuth client details.
- Open a test workbook and read a small named range. Compare headers, displayed values and formulas before editing.
- 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.
# Custom REST app only
GOOGLE_ACCESS_TOKEN=replace_with_scoped_oauth_access_token
GOOGLE_SPREADSHEET_ID=replace_with_spreadsheet_idSupported operations & boundaries
| Operation | Route | Important boundary |
|---|---|---|
| Read cell ranges | Sheets MCP / REST | Choose formatted values, raw values or formulas deliberately |
| Update cells | Approved connector/API writes | Do not overwrite formulas or protected regions |
| Insert/delete rows or columns | Structural tools/batch updates | Can shift references and downstream ranges |
| Find/share the file | Drive surface | Sharing changes are separate from spreadsheet edits |
Make a bounded first request
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.
- GET
/v4/spreadsheets/{spreadsheetId}/values/{range}Read values from a known A1 or R1C1 range; inspect rendering options.
API reference for /v4/spreadsheets/{spreadsheetId}/values/{range} (opens in a new tab) - GET
/v4/spreadsheets/{spreadsheetId}Inspect workbook metadata and selected grid fields rather than guessing tab IDs.
API reference for /v4/spreadsheets/{spreadsheetId} (opens in a new tab) - POST
/v4/spreadsheets/{spreadsheetId}/values:batchUpdateWrite multiple value ranges after validating exact targets and valueInputOption.
API reference for /v4/spreadsheets/{spreadsheetId}/values:batchUpdate (opens in a new tab)
A practical workflow
- For a reconciliation, define the matching key and the two source ranges. Record tab titles, header row and report date.
- Read only required columns, plus formulas where needed to distinguish calculated from entered values.
- Normalize dates, currencies and empty cells explicitly. Report unmatched and duplicate keys separately; do not fuzzy-merge customer records automatically.
- Produce a proposed change table with cell/range, old value, new value and reason. Preserve formulas, totals and protected ranges.
- 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.
| Boundary | Required context |
|---|---|
| Required inputs | Spreadsheet ID and tab; A1 range and headers; Stable record key; Value/formula mode; Write budget and protected regions |
| Approval required | Cell writes, structural edits or formula changes; Sharing/protection changes |
| Stop conditions | Ambiguous keys; Concurrent row movement; Unknown formula or protection impact |
| Return to the user | Ranges and rendering mode; Differences with cell references; Approved writes and verification; Unresolved rows and recovery evidence |
- Inspect metadata, headers and relevant formulas.
- Read bounded ranges with explicit rendering.
- 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
- Disconnect the selected connector/custom MCP and review Google third-party grants.
- Revoke unused custom OAuth credentials or service account access separately.
- 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.
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.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
Official repository
Google APIs Node.js clientOfficial API client library. No community MCP is required for this guide.
References used in this guide
- Sheets custom MCP setup (opens in a new tab)
- Claude dedicated Workspace connectors (opens in a new tab)
- Read values API (opens in a new tab)
- Workbook metadata API (opens in a new tab)
- Batch value writes (opens in a new tab)
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