google-sheets-mcp
Provides tools for reading and writing Google Sheets, including retrieving spreadsheet metadata, listing worksheets, reading/writing ranges, appending rows, batch updating values, and clearing ranges while preserving formatting.
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., "@google-sheets-mcpread range A1:D10 from my expense tracker"
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.
# google-sheets-mcp
English | Korean
Local Model Context Protocol server for reading and writing Google Sheets through Google Sheets API v4.
This project is designed for local Codex/AI-agent workflows. It supports both service account credentials and OAuth user credentials.
Features
Read spreadsheet metadata and worksheet tabs.
Read values from A1 ranges.
Update exact ranges.
Append rows.
Batch update multiple ranges.
Clear values while preserving formatting.
Report authentication status without exposing private keys or tokens.
Related MCP server: MCP Google Suite
MCP Tools
auth_statusget_spreadsheetlist_worksheetsread_rangeupdate_rangeappend_rowsbatch_update_valuesclear_range
Install
npm.cmd install
npm.cmd run buildOn macOS/Linux, use npm instead of npm.cmd.
Authentication: Service Account
Recommended for automation.
Create or choose a Google Cloud project.
Enable Google Sheets API.
Create a service account and download a JSON key.
Put the JSON key at:
secrets/google-service-account.jsonShare each target spreadsheet with the service account email from the JSON key:
{
"client_email": "your-service-account@your-project.iam.gserviceaccount.com"
}Give Viewer access for read-only use or Editor access for writes.
The secrets/ directory is committed with only .gitkeep. All credential files inside it are ignored.
Authentication: Custom Credential Path
If you do not want credentials under the repository directory, create a local .env file:
GOOGLE_APPLICATION_CREDENTIALS=C:/secure/path/google-service-account.jsonor provide inline JSON through a secret manager/environment variable:
GOOGLE_SERVICE_ACCOUNT_JSON={"type":"service_account",...}Credential lookup order:
GOOGLE_APPLICATION_CREDENTIALSGOOGLE_SERVICE_ACCOUNT_JSON./secrets/google-service-account.json
Authentication: OAuth User Account
Use OAuth when the MCP should act as your Google user account.
Create OAuth Client credentials in Google Cloud.
Add this redirect URI:
http://127.0.0.1:3333/oauth2callbackCreate
.env:
GOOGLE_OAUTH_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_OAUTH_CLIENT_SECRET=your-client-secret
OAUTH_CALLBACK_PORT=3333Generate a refresh token:
npm.cmd run oauth:initOpen the printed URL, approve access, and add the printed refresh token to
.env:
GOOGLE_OAUTH_REFRESH_TOKEN=your-refresh-tokenRegister With Codex
Build first:
npm.cmd run buildThen register the MCP server:
codex mcp add google-sheets-local -- node <path-to-google-sheets-mcp>/dist/index.jsRecommended ~/.codex/config.toml entry:
[mcp_servers.google-sheets-local]
command = "node"
args = ["<path-to-google-sheets-mcp>/dist/index.js"]
cwd = "<path-to-google-sheets-mcp>"Restart Codex after changing MCP configuration or credentials.
Usage Notes
Use
auth_statusfirst to verify the active authentication mode.Use
list_worksheetsbefore reading or writing ranges.For destructive operations, prefer reading the target range first.
Use
batch_update_valuesfor large table edits to reduce Google API request count.
Security
Never commit credentials. The following are ignored by default:
.env.env.*except.env.examplecredentials/secrets/*exceptsecrets/.gitkeep*.service-account.json*.credentials.json*.token.json
License
MIT
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 Servers
- Alicense-qualityCmaintenanceA Model Context Protocol server that integrates with Google Drive and Google Sheets, enabling users to create, read, update, and manage spreadsheets through natural language commands.Last updated967MIT
- AlicenseAqualityCmaintenanceA Model Context Protocol server that provides seamless integration with Google Workspace, allowing operations with Google Drive, Docs, and Sheets through secure OAuth2 authentication.Last updated83MIT
- FlicenseBqualityDmaintenanceProvides a Model Context Protocol (MCP) server that enables LLMs to directly access and interact with Google Spreadsheet data.Last updated21
- AlicenseBqualityDmaintenanceEnables interaction with Google Spreadsheets through the Model Context Protocol. Supports reading, writing, appending rows, creating sheets, and retrieving spreadsheet information with Google Cloud service account authentication.Last updated5937MIT
Related MCP Connectors
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
A Model Context Protocol server for Wix AI tools
Read-only MCP server for ClassQuill, a tutoring-business-management platform.
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/Cairas/google-sheet-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server