gsheets-mcp
Provides CRUD access to Google Sheets, including reading tabs and ranges as TSV with row numbers, server-side filtering, header-keyed row updates, appending rows, writing 2-D ranges, and batch spreadsheet updates.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@gsheets-mcpAppend a row to the Tasks tab: 'Buy milk, high, tomorrow'."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
gsheets-mcp
A small, token-lean MCP server that gives Claude Code (or any MCP client) CRUD access to your own Google Sheets, Docs and Drive files — a lightweight, free alternative to routing those calls through Zapier.
One Python file, stdio transport, your own Google Cloud OAuth client. Google's Sheets, Drive and Docs APIs are free at personal scale, and there is nothing to host.
Why not just use a generic connector
Generic Sheets connectors are expensive in tokens: huge tool schemas, an "inspect the columns" round-trip before every write, JSON objects for every row, and whole-grid reads. This server is built the other way round:
Design choice | Effect |
Output is TSV with the row number first | ~3× fewer tokens than keyed JSON, and the model can address a row straight back |
Trailing blank cells trimmed, cells truncated to 80 chars, default limit 60 rows | no dumping a 200-row tab to read 5 |
Sheet layout lives in | no discovery calls; |
Writes are header-keyed ( | the server caches the header row, so no inspect round-trip |
| only matching rows cross the wire |
Guards: refuses writes into protected ranges and formula cells | the model cannot clobber a spill formula or a live tally by accident |
Related MCP server: MCP Google Sheets Server
Tools
Sheets
describe(sheet)— tabs, sheetIds, header rows, notes, protected rangesread(tab, range, limit, offset, render)— TSV, row number firstfind(tab, where)— server-side filter;whereisCol op valuejoined by&, ops= != ~ !~ empty nonemptyupdate_rows(tab, rows)—[{"row": 12, "Status": "Done"}], keyed by header name or column letterappend_rows(tab, rows)— same shape, appended below the last used rowwrite_range(tab, range, values)— 2-D block writebatch(requests)— rawspreadsheets.batchUpdate(sortRange, repeatCell, setBasicFilter…)
Drive / Docs
drive_search(query, folder, kind, limit)—id kind name modifieddrive_read(file_id, max_chars, offset)— Docs exported as Markdown, text files as-isdrive_create(name, content, kind)—doc|txt|md|folderdrive_update(file_id, name, content, folder)— rename, move, or replace contentdrive_trash(file_id)doc_append(doc_id, text)/doc_replace(doc_id, find, replace)— Docs API, keeps formatting
Writes use USER_ENTERED, so =FORMULA, dates and numbers behave as if typed by a human.
Quickstart
git clone https://github.com/<you>/gsheets-mcp.git ~/mcp/gsheets
cd ~/mcp/gsheets
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt
cp sheets.example.yaml sheets.yaml # then edit: your spreadsheet id, tabs, header rows
# put your OAuth desktop client JSON here as credentials.json (see SETUP.md)
.venv/bin/python server.py auth # opens a browser once, caches token.json
claude mcp add -s user gsheets -- ~/mcp/gsheets/.venv/bin/python ~/mcp/gsheets/server.pyRestart the client; the tools appear as mcp__gsheets__*.
Every tool's sheet argument defaults to the alias dnd (the sheet this was built for) —
either name your main alias dnd in sheets.yaml, or pass sheet="myproject" explicitly.
Getting credentials.json (the Google Cloud console part) is in SETUP.md,
including the two places it is easy to get stuck.
Files
File | |
| the whole server |
| your spreadsheet map — gitignored, start from |
| OAuth desktop client — gitignored, never commit |
| cached login — gitignored, never commit |
Re-auth
While the OAuth consent screen is in Testing, Google expires the refresh token every 7 days. When a tool starts failing with an auth error:
cd ~/mcp/gsheets && .venv/bin/python server.py authPublishing the app (Audience → Publish app) removes the 7-day expiry. As a single-user internal tool it is fine either way.
Extending
The same shape works for any REST API: add a lazy service builder, a @mcp.tool()
function per verb, and keep the return value flat text. The value is in the config file
and the guards, not the API calls.
MIT.
This server cannot be deployed
Maintenance
Related MCP Connectors
Google Docs MCP Pack — read, create, and edit Google Docs via OAuth.
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Query your Google Sheets as structured JSON: list sheets and tabs, read schemas, filter rows.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables interaction with Google Spreadsheets through OAuth 2.0 authentication, supporting reading, writing, and creating spreadsheets via a remote MCP server using SSE.-
- AlicenseNot gradedqualityCmaintenanceProvides full programmatic access to Google Sheets, enabling CRUD operations, permission management, formatting, and spreadsheet discovery through a standardized MCP interface.195MIT
- AlicenseNot gradedqualityDmaintenanceA comprehensive Google Sheets MCP server offering 26 tools for read/write, structural updates, Drive search, and an escape hatch for executing arbitrary Node.js code with pre-authenticated Sheets and Drive clients.71MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for Google Sheets that exposes tools to read cell ranges, update values, and apply advanced batch updates (borders, colors, data validation, conditional formatting) via HTTP.7-