How to Set Up a Google Sheets MCP Server (2026)
Connect Google Sheets to Claude, Cursor, and VS Code with MCP. Read, write, and analyze spreadsheet data from your AI assistant — full setup with Google Cloud credentials, OAuth/service-account auth, and troubleshooting.
Spreadsheets are where most teams keep their working data — trackers, budgets, inventories, content calendars, and reports. A Google Sheets MCP server lets Claude, Cursor, or VS Code read and write that data directly, so you can ask "summarize this month's numbers" or "append these rows to the tracker" without copy-pasting. This guide covers the complete setup, including the Google Cloud credentials that trip most people up.
What This Integration Enables
With a Google Sheets MCP server connected, your AI assistant can:
- Read values from any range or whole sheet for analysis and summaries
- Write cells, update ranges, and append new rows
- Create new sheets and tabs, and apply basic formatting
- Answer questions about your data ("which rows are overdue?")
- Bridge spreadsheet data into other workflows in the same conversation
Prerequisites
- Node.js 18+ installed and on your PATH
- A Google account and a Google Cloud project (free)
- The Google Sheets API enabled and a credential (service-account JSON recommended)
- An MCP client: Claude Desktop, Cursor, or VS Code
Step 1: Enable the API & Create a Service Account
A service account is the simplest credential for a single automation tool — no interactive login required.
- Open the Google Cloud Console and create (or select) a project.
- Go to APIs & Services → Library, search for Google Sheets API, and click Enable.
- Go to APIs & Services → Credentials, click Create credentials → Service account, and give it a name.
- On the new service account, open Keys → Add key → Create new key → JSON and download the JSON file. Store it somewhere private.
- Copy the service account's email (it ends in
.iam.gserviceaccount.com). You'll share your sheets with it.
The #1 gotcha: a service account can only see sheets that are explicitly shared with its email. Open each spreadsheet you want the AI to access, click Share, and add the service account email (Viewer for read-only, Editor for write access).
Step 2: Share Your Spreadsheets
For each spreadsheet the assistant should use, click Share in Google Sheets and add the service account email. Grant Viewer if you only want analysis, or Editor if the AI should write data. This per-sheet sharing is your security boundary — the server can only touch what you've shared.
Step 3: Add the Server to Your Client
Add a Google Sheets MCP server to your client, pointing it at your downloaded credential. The exact package name varies by server; the pattern below uses npx and an environment variable for the path to your service-account JSON.
Claude Desktop
Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/):
{
"mcpServers": {
"google-sheets": {
"command": "npx",
"args": ["-y", "<google-sheets-mcp-package>"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/absolute/path/to/service-account.json"
}
}
}
}Replace <google-sheets-mcp-package> with the server you chose, and use the absolute path to your JSON key. Some servers use a different env var name (e.g. SERVICE_ACCOUNT_PATH) — check the server's README.
Cursor & VS Code
Use the identical block in ~/.cursor/mcp.json or your VS Code MCP settings. The command, args, and credential env var are the same across clients. See our Google Drive MCP setup guide for the closely related Google Cloud credential flow.
Step 4: Restart and Verify
Fully quit and reopen your client, then test with a sheet you've shared (the server usually identifies sheets by their spreadsheet ID — the long string in the sheet's URL):
Read the first 10 rows of spreadsheet <SPREADSHEET_ID> and summarize the columnsGetting your data back confirms the integration is live.
Real-World Use Cases
- "Summarize this month's expenses from the budget sheet and flag anything unusual"
- "Append these five new leads as rows to the CRM tracker"
- "Which rows in the project sheet are past their due date?"
- "Create a new tab and lay out a weekly content calendar template"
Troubleshooting
403 / permission denied
The spreadsheet isn't shared with your credential. If using a service account, open the sheet and share it with the service account email. Also confirm the Google Sheets API is enabled in your Cloud project.
404 / spreadsheet not found
Double-check the spreadsheet ID — it's the long string between /d/ and /edit in the sheet's URL, not the sheet's display name.
Credentials not loading
Use the absolute path to the JSON key, confirm the env var name matches what the server expects, and validate your config JSON — a missing comma breaks the whole file. Then fully restart the client. Our Sentry MCP guide covers the same restart-and-validate steps.
Security
- Share only the specific spreadsheets the AI needs — per-sheet sharing is your main access control
- Grant Viewer (read-only) unless the AI genuinely needs to write data
- Never commit the service-account JSON key to git; keep it outside your repo
- Keep backups of important sheets before allowing write access, and rotate the key if exposed
Frequently Asked Questions
Is there a Google Sheets MCP server?
Yes. Several community-maintained Google Sheets MCP servers exist, and Google Workspace MCP servers also expose Sheets alongside Drive, Docs, and Gmail. They connect to the Google Sheets API and let your AI client read ranges, write cells, append rows, and create or format sheets, authenticated with Google Cloud credentials.
Should I use a service account or OAuth for the Google Sheets MCP server?
Use a service account for automation and shared/team spreadsheets — you create it once, download a JSON key, and share the specific sheets with the service account's email. Use OAuth when the server should act as your personal Google account across your own files. Service accounts are simpler for a single tool and avoid interactive login flows.
Why does the Google Sheets MCP server return a 403 permission error?
A 403 almost always means the spreadsheet hasn't been shared with the credential you're using. If you're using a service account, open the sheet and share it with the service account's email address (found in the JSON key). Also confirm the Google Sheets API is enabled in your Google Cloud project.
Can the Google Sheets MCP server edit my spreadsheets?
Yes, if granted write scope. It can write cells, append rows, update ranges, and in many servers create or format sheets. Because these are real edits to live data, share only the specific spreadsheets the AI needs, keep a backup of important sheets, and grant read-only access when you only need analysis.
Can I use the Google Sheets MCP server with Cursor and VS Code?
Yes. The same server works with any MCP-compatible client. In Cursor you add it to ~/.cursor/mcp.json, in VS Code to your MCP settings, and in Claude Desktop to claude_desktop_config.json. The command and credential environment variables are identical across clients.
More MCP Integrations
Browse the full MCP server directory to connect Slack, the Google Drive server, and 50+ more tools to your AI workflow.