sheets-mcp
Allows reading, editing, and managing Google Sheets spreadsheets: list and create spreadsheets, read raw ranges or header-labelled records, find rows by value, and write, append, or clear data in tabs.
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., "@sheets-mcp Find all rows in the Q3 Pipeline sheet where stage is Negotiation."
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.
sheets-mcp
An MCP server that connects Claude — or any MCP client — to Google Sheets.
Ask in plain language, and the model reads and edits your spreadsheets directly:
"In my Q3 Pipeline sheet, find every deal marked
Negotiationand add a follow-up row to the Tasks tab for each one."
Built on the official MCP Python SDK (v2) and the Google Sheets API v4.
Why this exists
Most spreadsheet automation dies at the glue layer: a script that reads a sheet is easy, but a script that reads whatever sheet someone asks about is not. MCP moves that decision to the model. You expose a handful of well-described tools, and the client figures out which to call.
Two design choices worth knowing about:
read_recordsover raw grids. Handing a model a 2D array of strings wastes tokens and invites off-by-one errors.read_recordsuses the header row to return labelled objects, each tagged with its real sheet row number so a follow-up write lands in the right place.Read-only mode is enforced by registration, not by a check. With
SHEETS_MCP_READ_ONLY=true, the write tools are never registered, so the model cannot see them and cannot be talked into calling them.
Related MCP server: gsheets-mcp
Tools
Tool | What it does |
| Lists accessible spreadsheets, newest first, optionally filtered by title. |
| Returns a spreadsheet's title, URL, and every tab with its dimensions. |
| Reads a raw grid from an A1 range. |
| Reads a tab as labelled records using a header row. Each record carries |
| Returns records whose named column matches a value (exact or substring). |
| Overwrites a range with the rows you supply. |
| Appends rows below the last used row. Overwrites nothing. |
| Clears values in a range, leaving formatting intact. |
| Creates a spreadsheet, optionally with named tabs, optionally shared with an email. |
| Adds a tab to an existing spreadsheet. |
The last five are omitted entirely in read-only mode.
Install
Requires Python 3.11+.
git clone https://github.com/niberdi01gold/sheets-mcp.git
cd sheets-mcp
pip install -e .Google setup (5 minutes)
A service account is the recommended path: no browser flow, no token to refresh, and it only ever sees the sheets you explicitly share with it.
In the Google Cloud Console, create a project.
Enable the Google Sheets API and the Google Drive API.
Go to IAM & Admin → Service Accounts, create one, then Keys → Add key → JSON. Save the file somewhere outside the repo.
Open the JSON and copy the
client_emailvalue.In Google Sheets, press Share on each spreadsheet you want the server to reach and paste that address (Viewer for read-only, Editor for writes).
Step 5 is the one people miss. A service account starts with access to nothing; sharing is what grants it.
Then point the server at the key:
cp .env.example .env
# set GOOGLE_SERVICE_ACCOUNT_FILE=/absolute/path/to/service-account.jsonUse this when you want the server to see everything you can see, without sharing sheets one by one. Create an OAuth client of type Desktop app, download the JSON, then:
export GOOGLE_OAUTH_CLIENT_FILE=/absolute/path/to/oauth-client.json
sheets-mcp auth # opens a browser once; caches a token at ~/.sheets-mcp/token.jsonThe server itself never opens a browser — it reads the cached token and fails with a clear message if there isn't one.
Connect it to a client
Claude Desktop
Edit claude_desktop_config.json (Settings → Developer → Edit Config):
{
"mcpServers": {
"sheets": {
"command": "sheets-mcp",
"env": {
"GOOGLE_SERVICE_ACCOUNT_FILE": "/absolute/path/to/service-account.json",
"SHEETS_MCP_READ_ONLY": "false"
}
}
}
}Use absolute paths. Claude Desktop launches the server in its own process and does not inherit your shell environment.
Claude Code
claude mcp add sheets -e GOOGLE_SERVICE_ACCOUNT_FILE=/absolute/path/to/service-account.json -- sheets-mcpMCP Inspector (for development)
mcp dev src/sheets_mcp/server.pyUsage examples
Once connected, these are the kinds of requests the tools are shaped for.
Read and summarise
Open the spreadsheet called "Monthly Expenses" and tell me which category grew the most between June and July.
The model calls list_spreadsheets → get_spreadsheet → read_records, then reasons over the labelled rows.
Append without clobbering
Add these three leads to the Leads tab: Acme (acme@example.com, cold), Globex (ops@globex.com, warm), Initech (hi@initech.com, cold).
Calls append_rows, which anchors below the last used row, so concurrent edits by a human do not get overwritten.
Targeted update
In the Inventory tab, find the row where SKU is TH-4410 and set its Stock column to 0.
Calls find_rows to get the record and its _row, then write_range on the single cell.
Build a new sheet from a conversation
Create a spreadsheet called "Q4 Content Calendar" with tabs for Blog, Email and Social, share it with me at nico@example.com, and fill the Blog tab with a header row.
Calls create_spreadsheet then write_range.
Configuration
Variable | Default | Purpose |
| — | Path to the service account JSON key. |
| — | The same key inlined, for hosts without a filesystem. |
| — | OAuth client secrets, for the user-account flow. |
|
| Where the cached OAuth token lives. |
|
| When true, only the read tools are registered. |
Credentials are resolved in the order listed above; the first one set wins.
Development
pip install -e ".[dev]"
pytest -q
ruff check .The tests run the real server in memory through the SDK's Client, with a fake Google client injected — no network, no credentials required.
Notes and limits
Reads use
FORMATTED_VALUE, so you get what a human sees in the cell, not the underlying float.create_spreadsheetunder a service account produces a file owned by that account. Passshare_withor it will be invisible in your Drive.Cell formatting, charts, and pivot tables are out of scope for now.
batchUpdatesupport is the obvious next addition.Very large tabs are read whole before slicing. Fine to a few thousand rows; range-limited reads would be the fix beyond that.
License
MIT — see LICENSE.
Available Tools
10 toolsadd_sheetA
Add a new tab to an existing spreadsheet.
Args: spreadsheet_id: The long token from the spreadsheet URL. title: Name of the new tab; must not already exist.
Inputs: title (required), spreadsheet_id (required). Returns: object
append_rowsA
Append rows below the last used row of a tab. Nothing is overwritten.
Args: spreadsheet_id: The long token from the spreadsheet URL. sheet_name: The tab to append to, e.g. "Sales". values: Rows of cell values, in the same column order as the sheet. value_input_option: USER_ENTERED parses formulas and dates; RAW stores literally.
Inputs: values (required), sheet_name (required), spreadsheet_id (required), value_input_option. Returns: object
clear_rangeA
Clear the values in a range, leaving formatting and the rows in place.
Args: spreadsheet_id: The long token from the spreadsheet URL. a1_range: The range to clear, e.g. "Sheet1!A2:D100".
Inputs: a1_range (required), spreadsheet_id (required). Returns: object
create_spreadsheetA
Create a new spreadsheet and return its ID and URL.
A spreadsheet created by a service account is owned by that account, so pass
share_with to give a human account access to it.
Args: title: Title of the new spreadsheet. sheet_names: Optional tab names to create instead of the default single tab. share_with: Optional email address to grant edit access to.
Inputs: title (required), share_with, sheet_names. Returns: object
find_rowsB
Find records in a tab whose column matches a value.
Args: spreadsheet_id: The long token from the spreadsheet URL. sheet_name: The tab name to search. column: Header name of the column to match against. value: Value to look for; matching is case-insensitive. header_row: 1-based row number holding the column headers. exact: True for an exact match, False for a substring match. limit: Maximum number of matches to return.
Inputs: value (required), column (required), sheet_name (required), spreadsheet_id (required), +3 more. Returns: object
get_spreadsheetA
Get a spreadsheet's title, URL and the name and size of every tab in it.
Call this before reading when you do not already know the tab names.
Args: spreadsheet_id: The long token from the spreadsheet URL.
Inputs: spreadsheet_id (required). Returns: object
list_spreadsheetsA
List Google Sheets the credentials can access, most recently modified first.
Args: name_contains: Optional case-insensitive substring to filter titles by. limit: Maximum number of spreadsheets to return (1-100).
Inputs: limit, name_contains. Returns: object
read_rangeB
Read a raw grid of cells from a spreadsheet.
Args: spreadsheet_id: The long token from the spreadsheet URL. a1_range: A1 notation, e.g. "Sheet1", "Sheet1!A1:D50" or "Sheet1!A:A".
Inputs: a1_range (required), spreadsheet_id (required). Returns: object
read_recordsA
Read a tab as labelled records, using one row as the column headers.
Each record includes a _row field with its 1-based sheet row number, which
you can use to build an A1 range for a later update.
Args: spreadsheet_id: The long token from the spreadsheet URL. sheet_name: The tab name, e.g. "Sales". header_row: 1-based row number holding the column headers. limit: Maximum number of data records to return.
Inputs: sheet_name (required), spreadsheet_id (required), limit, header_row. Returns: object
write_rangeA
Overwrite a range of cells with the given rows. Existing values are replaced.
Args: spreadsheet_id: The long token from the spreadsheet URL. a1_range: Top-left anchored range, e.g. "Sheet1!A2:C10". values: Rows of cell values, outer list is rows, inner list is columns. value_input_option: USER_ENTERED parses formulas and dates; RAW stores literally.
Inputs: values (required), a1_range (required), spreadsheet_id (required), value_input_option. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Each tool maps to a clearly distinct operation: list vs. get metadata, raw range vs. labelled record reads, overwrite vs. append vs. clear, search, and create spreadsheet vs. add tab. The boundaries are unambiguous and descriptions reinforce the differences.
All tool names follow a consistent snake_case verb_noun pattern (e.g., list_spreadsheets, read_range, append_rows, create_spreadsheet). The convention is predictable throughout with no mixing of styles.
Ten tools provide a well-scoped set for Google Sheets operations. Each tool earns its place without redundancy, and the count is comfortably within the ideal 3–15 range.
The surface covers core operations: list, read (raw and records), search, write, append, clear, create spreadsheet, and add tab. However, there is no delete or rename for spreadsheets or tabs, and no formatting or batch operations, which are minor gaps for a complete lifecycle.
Maintenance
Related MCP Connectors
Google Docs MCP Pack — read, create, and edit Google Docs via OAuth. Reuses the google_sheets…
Connect AI assistants to Google Sheets through controlled tools for reading and updating rows.
Google Sheets via Apify: write Apify datasets or JSON rows to a sheet, or read a sheet as JSON.
Connect an AI assistant to your Google Sheets, Drive, Docs, PDFs, BigQuery and Gmail.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read, write, and manage Google Sheets spreadsheets through natural language commands, providing a bridge between MCP clients and the Google Sheets API.550 npm1MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for Google Sheets operations, enabling spreadsheet management including reading, writing, appending, creating, and searching sheets via natural language.MIT
- 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