mcp-google-sheets
Reads and (optionally) appends to Google Sheets via the Google Sheets API v4 using a service account. Provides tools to list a spreadsheet's tabs and row/column counts, read cells in A1 notation as displayed, find rows whose header-matched column contains a query (returning real row numbers), and append rows to a tab when writes are explicitly enabled — with an allowlist, read-only default, per-call cell caps, and an audit log.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-google-sheets
A small, security-first MCP server that lets Claude (or any MCP client) read and, if you allow it, append to your Google Sheets – without anyone copy-pasting business data into a chat window.
Claude Desktop / Claude Code / any MCP client
│ MCP over stdio (runs on your machine or server)
▼
mcp-google-sheets ── allowlist · read-only by default · cell caps · audit log
│ Google Sheets API v4, service account
▼
Only the spreadsheets you shared with the service accountTools
Tool | What it does | Mode |
| Spreadsheet title, tabs, row/column counts | read |
| Cells in A1 notation ( | read |
| Rows whose column (matched by header name) contains a query, with real row numbers | read |
| Append rows to a tab (values parsed as if typed) | write, opt-in |
Example questions once connected: "Which customers in the CRM sheet are in Malmö and still on trial?", "Summarise last month's rows in Orders", "Add these three leads to the Leads tab."
Related MCP server: MCP Google Sheets Server
Security model
Allowlist, required. The server refuses any spreadsheet ID not in
SHEETS_ALLOWED_IDSbefore calling Google.Read-only by default. Write tools are not even registered unless
SHEETS_ALLOW_WRITES=true, and the Google OAuth scope isspreadsheets.readonlyin that mode, so Google enforces it too.Least privilege at Google. A service account only sees sheets explicitly shared with it. Share as Viewer for read-only use.
Bounded output. At most
SHEETS_MAX_CELLS(default 2000) cells per call, with atruncatedflag so the model narrows the range instead of flooding its context.Audit log without data. Every call writes one JSON line to stderr: time, tool, spreadsheet ID, success. Cell values are never logged.
Runs where you run it. stdio transport, no inbound network port, no third-party relay.
Setup
Google Cloud: create a project, enable the Google Sheets API, create a service account, and download its JSON key.
Share each spreadsheet with the service account's e-mail (Viewer, or Editor if you enable writes).
Build:
npm ci && npm run build(Node 20+).Connect your client. Claude Desktop,
claude_desktop_config.json:
{
"mcpServers": {
"google-sheets": {
"command": "node",
"args": ["/absolute/path/to/mcp-google-sheets/dist/index.js"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/absolute/path/to/service-account.json",
"SHEETS_ALLOWED_IDS": "1AbCdEf...your-sheet-id"
}
}
}
}Claude Code: claude mcp add google-sheets --env SHEETS_ALLOWED_IDS=... --env GOOGLE_APPLICATION_CREDENTIALS=... -- node /absolute/path/to/dist/index.js
Variable | Required | Default | Meaning |
| yes | – | Path to the service-account key file |
| yes | – | Comma-separated spreadsheet IDs, or |
| no |
|
|
| no |
| Max cells returned or written per call |
The spreadsheet ID is the part of the URL between /d/ and /edit.
Development
npm test # 15 tests: tool logic + the real MCP client/server pair over an in-memory transport
npm run typecheck
npm run buildsrc/gateway.ts is the only file that talks to Google; tests swap it for an in-memory spreadsheet (test/fake.ts), so the suite runs offline and deterministically.
Built on the MCP TypeScript SDK v2 (@modelcontextprotocol/server), @googleapis/sheets and zod.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Hosted Google Ads MCP with OAuth, bounded reads, and prepare/confirm writes.
Read and write Google Sheets rows via SheetDB APIs; per-API agent permissions, approved deletes.
Google Sheets via Apify: write Apify datasets or JSON rows to a sheet, or read a sheet as JSON.
Read authorized Loam tables and supported external databases through a bounded MCP connection.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides tools to read, write, append, and create Google Sheets via MCP, using OAuth2 authentication shared with gmail_mcp.MIT
- AlicenseNot gradedqualityDmaintenanceProvides full programmatic access to Google Sheets, enabling CRUD operations, permission management, formatting, and spreadsheet discovery through a standardized MCP interface.550 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables reading, writing, appending, and creating Google Sheets spreadsheets through MCP tools, with support for exploring spreadsheet structure and creating new sheets.86 npmMIT
- AlicenseNot gradedqualityCmaintenanceBridges MCP-compatible clients to the Google Sheets API, enabling automated spreadsheet creation, reading, writing, and formatting through natural language.MIT