MCP Google Sheets Server
Provides tools for reading, writing, and managing Google Sheets, including reading ranges, updating cells, appending rows, clearing ranges, and performing batch updates, enabling AI agents to automate spreadsheet workflows.
Click on "Install 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., "@MCP Google Sheets Serverappend a row to my reading log with the book I just finished"
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.
MCP Google Sheets Server
Read, write, and manage Google Sheets from Claude Desktop, Claude Code, and any Model Context Protocol (MCP) compatible AI client.
A lightweight, production-ready Model Context Protocol (MCP) server that exposes the Google Sheets API to Claude and other LLM agents. Automate spreadsheet workflows, build AI agent tools that log to sheets, sync data pipelines with your team's spreadsheets, or let Claude edit a doc for you — all with a single MCP server.
Table of contents
Related MCP server: mcp-google-sheets
Why
If you've wanted Claude to update a Google Sheet — a job-tracker, a habit log, a project dashboard — without switching windows, this server gives you the missing tool. It's the natural counterpart to Anthropic's official Google Drive MCP connector (which reads files but cannot write cells).
Common workflows:
Let Claude append rows to a job-application tracker sheet as you apply
Sync a research reading list, weekly retro, or IELTS study log
Give an AI agent structured, auditable output to a spreadsheet
Automate financial or ops dashboards from natural-language prompts
Features
✅ Read any range in A1 notation
✅ Update cell values with
RAWorUSER_ENTEREDparsing✅ Append rows to any sheet (ideal for logging)
✅ Clear ranges without deleting formatting
✅ Batch update multiple ranges in one call
✅ Inspect spreadsheet metadata (sheet tabs, dimensions)
🔐 OAuth 2.0 with local token storage and automatic refresh
📦 TypeScript, ES modules, minimal dependencies
🖥️ Works with Claude Desktop, Claude Code, and any MCP client over stdio
Quick start
# 1. Put your Google Cloud OAuth credentials.json here
# (how to obtain it: see Setup steps 1-3 below)
mkdir -p ~/.config/mcp-google-sheets
cp /path/to/downloaded-credentials.json ~/.config/mcp-google-sheets/credentials.json
# 2. Authorize (opens browser once)
npx @yangchoi/mcp-google-sheets auth
# 3. Register with Claude
claude mcp add --scope user google-sheets -- npx -y @yangchoi/mcp-google-sheetsSetup
1. Create a Google Cloud project
Open Google Cloud Console.
Click New Project → give it any name (e.g.,
mcp-sheets).
2. Enable the Sheets API
In your project, open Google Sheets API.
Click Enable.
⚠️ Check the project selector before you click Enable. That link opens in whatever project the console last had selected — which is often not the project you just created. Enabling the API on the wrong project still shows a success screen, so this failure is silent: steps 3–5 will all succeed, and you won't find out until your first real tool call returns
Google Sheets API has not been used in project ... or it is disabled.
Verify the API is enabled on the right project before moving on:
gcloud services list --enabled --project=YOUR_PROJECT_ID | grep sheets
# expected: sheets.googleapis.com Google Sheets APINo output means it is not enabled. Enable it from the CLI instead:
gcloud services enable sheets.googleapis.com --project=YOUR_PROJECT_IDOnly the Sheets API is required — this server requests the spreadsheets scope alone, so you do not need to enable the Drive API.
3. Create OAuth 2.0 credentials
Open Credentials.
Click Create Credentials → OAuth client ID.
If prompted, configure the OAuth consent screen first:
User type: External (unless you're on a Workspace with Internal available)
Add yourself as a test user while the app is in
TestingmodeScopes can be left empty at the consent screen; the app will request them at runtime
Back at Create OAuth client ID:
Application type: Desktop app
Name: anything (e.g.,
mcp-google-sheets)
Click Download JSON and save it. This is your
credentials.json.
Move the file to the default config directory:
mkdir -p ~/.config/mcp-google-sheets
mv ~/Downloads/client_secret_*.json ~/.config/mcp-google-sheets/credentials.json(Or set GOOGLE_SHEETS_CREDENTIALS_PATH to point somewhere else — see Configuration.)
4. Install the server
Nothing to install if you run it with npx — the commands below fetch the
published package on demand. To pin a copy instead:
npm install -g @yangchoi/mcp-google-sheetsgit clone https://github.com/yangchoi/mcp-google-sheets.git
cd mcp-google-sheets
npm install
npm run buildThen substitute node /absolute/path/to/mcp-google-sheets/dist/index.js for
npx -y @yangchoi/mcp-google-sheets everywhere below, and npm run auth for
the auth command.
5. Authorize
Run the one-time OAuth flow. Your browser will open, you approve access to your own Sheets, and the resulting token is stored at ~/.config/mcp-google-sheets/token.json.
npx @yangchoi/mcp-google-sheets authYou should see Authorization complete. Token saved. in the terminal. The token
is written with 0600 permissions so other accounts on the machine cannot read
your refresh token.
The flow needs port 47319 free for the OAuth callback; if something else holds
it, the command says so and exits without opening a browser.
Register with your MCP client
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows) and add:
{
"mcpServers": {
"google-sheets": {
"command": "npx",
"args": ["-y", "@yangchoi/mcp-google-sheets"]
}
}
}Restart Claude Desktop. The Sheets tools will appear in the tool picker.
Claude Code
Register the server with the CLI:
claude mcp add --scope user google-sheets -- npx -y @yangchoi/mcp-google-sheets--scope user makes the server available in every project on your machine. Without it the server is added at local scope, which loads only in the directory you ran the command from — a common surprise when a scheduled job or a session started elsewhere suddenly has no sheet tools. Check what you got with:
claude mcp get google-sheets # look for "Scope: User config"⚠️ Do not put
mcpServersin~/.claude/settings.json. Claude Code does not read MCP servers from that file, so the block is silently ignored. MCP configuration lives in~/.claude.json(local and user scope, written byclaude mcp add) or in a project's.mcp.json.
Restart Claude Code. Confirm the tools load via /mcp.
Checking the token
While the OAuth app is in "Testing" mode Google expires the refresh token seven days after consent, which is the most common reason a working setup stops working. This reports how much of that window is left:
npx @yangchoi/mcp-google-sheets check-auth # installed
npm run check-auth # from a cloneLast authorized: 2026-09-03 15:19
7.0 days left, if the OAuth app is still in "Testing" mode (published apps do not expire on this schedule).It exits 0 when there is time left, 1 when expiry is close, and 2 when the
token is already unusable or missing, so it can gate a scheduled job.
Tests
npm test # builds, then runs the suite
npm run test:offline # only the tests that need no credentialsThe offline tests cover the CLI surface, the OAuth callback port handling, the advertised tool schemas, and the error shapes. They need no Google account.
The live tests exercise the real Sheets API and are skipped unless you point them at a scratch spreadsheet — they write to it:
MCP_TEST_SPREADSHEET_ID=<id> npm test
# if the first tab is not called "Sheet1"
MCP_TEST_SPREADSHEET_ID=<id> MCP_TEST_SHEET_NAME=Data npm testAvailable tools
Tool | Purpose |
| List sheet tabs and their dimensions. Call first to discover sheet names. |
| Read cell values in A1 notation. Returns typed values (numbers as numbers) by default; pass |
| Overwrite cells in a specific range. |
| Append one or more rows after the last row with data. |
| Clear values in a range without deleting formatting. |
| Update multiple ranges in a single API call. |
All tools take spreadsheetId (found in the sheet URL between /d/ and /edit).
Usage examples
Prompt Claude:
"Look at the spreadsheet
1abcXYZ...and add a new row to theApplicationssheet:Legora, Stockholm, Legal AI, 2026-08-18, pending."
Claude will call get_spreadsheet_metadata to find the sheet, then append_row with the values.
Or read + summarize:
"Read the first 20 rows of sheet
Applicationsin1abcXYZ...and tell me how many are still pending."
Claude calls read_range on Applications!A1:F20, then reasons over the returned array.
Configuration
Environment variables (all optional):
Variable | Default | Purpose |
|
| OAuth client credentials file. |
|
| Where the refresh token is stored. |
|
| Base directory used when the two paths above are unset. |
Security
credentials.jsonandtoken.jsonare local only and never transmitted anywhere except to Google's OAuth servers.Both files are covered by
.gitignore; do not commit them to version control.The server only requests the
spreadsheetsscope — no Drive-wide access, no Gmail, no calendar.Token refresh happens automatically; no long-lived access token is exposed.
Running the server does not require any network listening port at steady state (the temporary port
47319is used only during the initial OAuth callback and is closed immediately after).
Troubleshooting
Google Sheets API has not been used in project <number> before or it is disabled — step 2 never took effect on the project your credentials belong to. This is the most common failure, and it survives restarts: reauthorizing, rebuilding, or restarting your MCP client will not fix it, because OAuth succeeds independently of whether the API is enabled.
Find the project your credentials actually use, then enable the API on that project:
# the project_id in your OAuth client file is the one that matters
python3 -c "import json;print(json.load(open('$HOME/.config/mcp-google-sheets/credentials.json'))['installed']['project_id'])"
gcloud services enable sheets.googleapis.com --project=THAT_PROJECT_ID
gcloud services list --enabled --project=THAT_PROJECT_ID | grep sheets # confirmThe project number in the error message is the same project as that project_id, just in numeric form. If gcloud projects describe THAT_PROJECT_ID says the project does not exist, you are logged into gcloud with a different Google account than the one that created it — run gcloud auth login and pick the right account.
credentials.json not found — you missed step 3–4. Check the path.
Error: access_denied during OAuth — your Google account is not listed as a test user on the OAuth consent screen. Go to OAuth consent screen → add your email under Test users.
insufficient permission when calling a tool — the token was created with a smaller scope. Delete token.json and re-run npx @yangchoi/mcp-google-sheets auth.
Tool doesn't appear in Claude — confirm the path in your MCP config is absolute and points to dist/index.js (not src/index.ts). Ensure you ran npm run build.
Tools appear in one directory but not another — the server was registered at local scope, which binds it to a single project path. Run claude mcp get google-sheets; if the scope is not User config, re-register it:
claude mcp remove google-sheets
claude mcp add --scope user google-sheets -- npx -y @yangchoi/mcp-google-sheetsThis matters most for unattended runs (cron, launchd, claude -p), where the working directory is often / rather than your project. Without the tools an agent may fall back to calling the Sheets API another way and report success without touching your sheet.
No stored token at server startup — you skipped step 5. Run npx @yangchoi/mcp-google-sheets auth.
Development
npm install
npm run dev # tsc --watch
npm run build # produces dist/
npm run start # runs dist/index.js on stdioContributions welcome. This is a minimal core; PRs for structural updates (spreadsheets.batchUpdate for formatting, sheet-add, filters, protected ranges) are appreciated.
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
An agent-first office suite Claude & ChatGPT read and write over one MCP URL.
Give Claude only the Google Drive files you choose. Every action logged.
Multiple Google accounts (Gmail, Calendar, Drive, Contacts, Tasks) in one Claude connector.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude to read, write, append, and clear data in Google Sheets directly using a Google Cloud Service Account. It provides tools for real-time spreadsheet interaction, including fetching sheet metadata and managing cell ranges through simple commands.499MIT
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to interact with Google Sheets for reading, writing, and managing spreadsheets through a set of MCP tools.MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to read, write, append, create, and clear Google Sheets data using natural language.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read, write, and manage Google Sheets using the Google Sheets API v4.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yangchoi/mcp-google-sheets'
If you have feedback or need assistance with the MCP directory API, please join our Discord server