gsheets-mcp
Provides read-only access to list spreadsheets on Google Drive via the Drive API.
Allows reading and writing Google Sheets, with tools to list spreadsheets, get sheet info, read ranges, update ranges, and append rows.
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-mcplist my spreadsheets"
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 local MCP (Model Context Protocol) server that lets Claude read and write your Google Sheets through the Google Sheets API v4.
It runs entirely on your own machine. You authenticate with your own Google account using OAuth2 (the "installed app" / Desktop flow), and your data never passes through any third-party server.
Free and open source under the MIT License. No telemetry, no third-party servers.
š Website: https://gsheets-mcp.trombella.org/
What you get
Tool | What it does |
| List your Google Sheets on Drive (optionally filtered by name). |
| Metadata for a spreadsheet: title, locale, and its tabs (names, IDs, size). |
| Read values from a range (e.g. |
| Write/overwrite values into a range. |
| Append rows to the end of a table. |
Most tools take a spreadsheet ID ā the long string in a sheet's URL:
https://docs.google.com/spreadsheets/d/<THIS_IS_THE_ID>/edit.
You can also discover IDs with list_spreadsheets instead of copying them by hand.
Related MCP server: sheetsdb-mcp-server
Prerequisites
Node.js 18+ (
node --version).A Google account.
Part 1 ā Set up Google Cloud (one time)
You need an OAuth "Desktop app" client so the server can ask for your permission to access your sheets.
1. Create a Google Cloud project
Top bar ā project dropdown ā New Project. Give it a name (e.g.
gsheets-mcp) and create it. Make sure it's selected.
2. Enable the APIs
Go to APIs & Services ā Library (https://console.cloud.google.com/apis/library).
Search for Google Sheets API, open it, click Enable.
Search for Google Drive API, open it, click Enable.
The Drive API is used only by
list_spreadsheetsto enumerate your sheets, via the read-onlydrive.readonlyscope. It is not used to modify, move or delete files.
3. Configure the OAuth consent screen
Go to APIs & Services ā OAuth consent screen.
User type: External ā Create. (Internal is only available on Google Workspace organizations.)
Fill in the required fields: App name (e.g.
gsheets-mcp), your email as User support email and Developer contact. You can leave the rest blank. Save and continue.Scopes: you can skip adding scopes here (the app requests them at login). Save and continue.
Test users: click Add users and add your own Google email. This is required ā in "Testing" mode only listed test users can authorize the app. Save and continue.
Leave the app in Testing mode. That's fine for personal use and never expires for your own test-user account. (Publishing to "Production" would trigger Google's app verification, which you don't need here.)
4. Create the OAuth client credentials
Go to APIs & Services ā Credentials.
Create Credentials ā OAuth client ID.
Application type: Desktop app. Name it (e.g.
gsheets-mcp desktop). Create.In the confirmation dialog, click Download JSON. This file contains your
client_idandclient_secret.
5. Place the credentials file
Save the downloaded file as credentials.json in the config directory:
mkdir -p ~/.config/gsheets-mcp
mv ~/Downloads/client_secret_*.json ~/.config/gsheets-mcp/credentials.jsonKeep this file private ā it's ignored by git. You can override its location with the
GSHEETS_MCP_CREDENTIALSenvironment variable (see.env.example).
Part 2 ā Install and build
From the project folder:
npm install
npm run buildPart 3 ā Log in (one time)
Run the interactive login. It opens your browser on Google's consent screen; approve
access, and the token is saved to ~/.config/gsheets-mcp/token.json (refreshed
automatically from then on).
npm run login
# equivalently: node dist/index.js loginBecause the app is in Testing mode, Google shows a "Google hasn't verified this app" warning. This is expected for your own app ā click Advanced ā Go to gsheets-mcp (unsafe) and continue. Then grant the two requested permissions (see below).
When you see ā
Authorization complete in the terminal, you're done.
Scopes requested:
https://www.googleapis.com/auth/spreadsheetsā read/write your spreadsheets.
https://www.googleapis.com/auth/drive.readonlyā read-only, used only bylist_spreadsheetsto enumerate your sheets. It cannot modify or delete files.To revoke access at any time, visit https://myaccount.google.com/permissions.
Note: if you upgrade the server and the requested scopes change, you must run
npm run loginagain ā a previously granted consent doesn't cover new scopes. The same applies per machine (each computer stores its own token).
Part 4 ā Add the server to Claude Desktop
Open Claude Desktop's config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add a gsheets entry under mcpServers, pointing at the compiled entrypoint. Use the
absolute path to dist/index.js in this project:
{
"mcpServers": {
"gsheets": {
"command": "node",
"args": ["/absolute/path/to/google-sheets-mcp/dist/index.js"]
}
}
}Save the file and fully quit and reopen Claude Desktop. You should now see the
gsheets tools available. Try asking Claude something like:
"List my Google Sheets, then read
A1:C5from the one named 'Budget'."
Using it with Claude Code
claude mcp add gsheets -- node /absolute/path/to/google-sheets-mcp/dist/index.jsUsage examples (what to ask Claude)
List: "List my Google Sheets" / "Find my spreadsheets whose name contains 'budget'."
Info: "What tabs does spreadsheet
<ID>have?" (returns the exact tab names to use).Read: "Read range
Foglio1!A1:D10from spreadsheet<ID>."Update: "Put the values
[[\"Name\",\"Score\"],[\"Ada\",42]]starting atFoglio1!A1in spreadsheet<ID>."Append: "Append the row
[\"Grace\", 99]toFoglio1in spreadsheet<ID>."
ā ļø Note: tab names are localized
Ranges use the tab (sheet) name, e.g. Sheet1!A1:D10. But the default tab name
depends on your Google account's language: it's Sheet1 in English, Foglio1 in
Italian, Hoja1 in Spanish, Feuille1 in French, and so on. Using the wrong name
returns Unable to parse range: ā¦.
If you're unsure of the real tab name, open the sheet and read the tab label at the
bottom, or just ask Claude to read the whole sheet by passing only the tab name as
the range (e.g. Foglio1). A dedicated get_sheet_info tool that lists the exact tab
names is on the roadmap.
Configuration reference
All optional; defaults work out of the box. See .env.example.
Variable | Default | Purpose |
|
| Where |
|
| Path to the OAuth client file. |
|
| Path to the saved token. |
For headless / HTTP mode (see below) you can instead provide credentials via env:
Variable | Purpose |
| OAuth client, instead of |
| Refresh token, instead of |
| Required in HTTP mode. Bearer token clients must send. |
| HTTP port (default |
Remote / mobile use (advanced)
The default transport is stdio (local). The server can also run as a remote MCP connector over HTTP so you can reach it from clients that can't launch a local process ā e.g. the Claude mobile app:
MCP_AUTH_TOKEN=$(openssl rand -hex 32) npm run serve:http # listens on :8000/mcpEvery request must send Authorization: Bearer <MCP_AUTH_TOKEN>. Because this endpoint
can write your spreadsheets, always put it behind a network gate (Cloudflare Access, VPN)
in addition to the bearer token ā never expose it raw on the internet.
A ready-made Home Assistant OS add-on for a personal always-on setup (behind a
Cloudflare Tunnel) lives in ha-addon/gsheets-mcp/ ā see its
DOCS.md for the full step-by-step.
Troubleshooting
"Not authenticated. Run the one-time login first" ā you haven't logged in yet, or the token file is missing. Run
npm run login."OAuth client credentials not found" ā
credentials.jsonisn't where the server expects it. Check Part 1, step 5.403 access_deniedin the browser ā your Google account isn't listed as a test user. Add it under OAuth consent screen ā Test users (Part 1, step 3.5)."Request had insufficient authentication scopes" ā your saved token predates a scope change (e.g.
list_spreadsheetsneedsdrive.readonly). Runnpm run loginagain to re-consent.Unable to parse range: ā¦ā the tab name is wrong. Tab names are localized (Foglio1in Italian,Sheet1in English). Useget_sheet_infoto see the exact names.No
refresh_tokenwarning ā revoke the app at https://myaccount.google.com/permissions and runnpm run loginagain.Tools don't appear in Claude Desktop ā confirm the path in
claude_desktop_config.jsonis absolute and points todist/index.js, that you rannpm run build, and that you fully restarted Claude Desktop.
Development
npm run build # compile to dist/
npm run watch # recompile on change
npm run typecheck # type-check without emittingSource layout: src/index.ts (entrypoint), src/auth.ts (OAuth), src/sheetsClient.ts
and src/driveClient.ts (API wrappers), src/tools/* (one file per MCP tool).
License
Released under the MIT License. You're free to use, modify and distribute it. If it saves you time, you can support development with a coffee ā see the website for the link. ā
Not affiliated with or endorsed by Google. "Google Sheets" is a trademark of Google LLC.
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Related MCP Servers
- AlicenseBqualityAmaintenanceMCP server for Google Sheets - Read, write and manipulate spreadsheets through Claude Desktop441,23597MIT
- FlicenseBqualityDmaintenanceAn MCP server that enables Claude to interact with Google Sheets via the SheetsDB API, supporting CRUD operations and smart data addition.6-
- AlicenseNot gradedqualityBmaintenanceAn MCP server that gives Claude Code write access to a personal Google account ā Gmail, Drive, Calendar, Sheets, and YouTube ā backed by a self-owned Google Cloud OAuth client.1,091MIT
- AlicenseNot gradedqualityBmaintenanceAn MCP server that lets Claude read, edit, and format Google Sheets in place, including cell updates, formula filling, row/column operations, and find & replace.453MIT