gsheets-mcp
Provides tools for interacting with Google Sheets, including listing tabs, reading/writing ranges, appending rows, creating spreadsheets, copying, searching, clearing, and triggering recalculation.
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., "@gsheets-mcpshow the first 10 rows of Sheet1"
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 strict, agent-friendly MCP server for Google Sheets. Version 1.0.0 exposes
wire contract 1.0 through one explicit CLI and direct structured results.
Tool contract
Tool | Inputs | Broker | Local |
|
| yes | yes |
|
| yes | yes |
|
| yes | yes |
|
| yes | yes |
|
| yes | yes |
| source | yes | yes |
|
| no | yes |
|
| yes | yes |
|
| yes | yes |
spreadsheet accepts only a spreadsheet ID or a strict
https://docs.google.com/spreadsheets/... URL. Common tools never treat a title
as an identifier. In local mode, search by title first and pass the selected
results[n].spreadsheet ID to the next tool. range is A1 notation, preferably
including the tab (for example, Comps!A1:H20).
Inputs are closed-world, strictly typed JSON. Unknown fields—including plausible
fields such as dry_run and idempotency_key—are rejected. values must be a
non-empty two-dimensional JSON array, not a JSON-encoded string.
Related MCP server: @node2flow/google-sheets-mcp
Results and failures
Successful calls return a direct object rather than JSON inside a string:
{
"status": "ok",
"operation": "gsheets_read_range",
"spreadsheet": "1AbCdEf...",
"range": "Comps!A1:B2",
"value_render_option": "FORMATTED_VALUE",
"date_time_render_option": "FORMATTED_STRING",
"values": [["Ticker", "PCTY"], ["Revenue", 100]]
}Operational and validation failures set MCP isError=true. The structured
content carries a stable code plus explicit outcome and retry guidance:
{
"status": "error",
"operation": "gsheets_write_range",
"error": {
"code": "operation_outcome_uncertain",
"message": "The operation may have changed external state, but confirmation was lost.",
"outcome": {
"state": "uncertain",
"phase": "write_range",
"mutation_may_have_occurred": true
},
"retry": {
"safe": false,
"automatic": false,
"action": "inspect_before_retry",
"retry_after_seconds": null
},
"validation": null,
"recovery": null,
"incident_id": null
}
}Never blindly repeat append, create, copy, write, or recalculate after an uncertain result. Copy failures can include destination progress. Recalculation accepts only formulas plus blank cells, restores the exact formula matrix, and verifies formulas; it does not claim that custom-function values are fresh.
Install and inspect
Prerequisites are Python 3.10+ and a Google Cloud OAuth desktop client with the Sheets and Drive APIs enabled.
python3 -m venv venv
source venv/bin/activate
python -m pip install -e .
gsheets-mcp --help
gsheets-mcp --version
gsheets-mcp capabilities --jsonThe bare command prints help and exits. Only gsheets-mcp serve starts the stdio
protocol server, and stdout is reserved for MCP frames while it runs. Discovery
and capabilities inspection do not load credentials.
Local OAuth mode
Local mode is the default. Save the OAuth desktop client JSON as
drive_credentials.json in the repository root, or set
GOOGLE_CREDENTIALS_FILE. The token cache defaults to token.pickle; override
it with GOOGLE_TOKEN_FILE. Both files are ignored by Git.
Run interactive consent once from a trusted local terminal:
source venv/bin/activate
python -c 'from gsheets_mcp.sheets_client import authenticate; authenticate()'Set GSHEETS_HEADLESS=1 in non-interactive environments so missing consent fails
closed. A local MCP configuration uses the installed console script explicitly:
{
"mcpServers": {
"gsheets-mcp": {
"type": "stdio",
"command": "/absolute/path/to/gsheets-mcp/venv/bin/gsheets-mcp",
"args": ["serve"]
}
}
}Broker mode
Set GSHEETS_TOKEN_MODE=broker when a trusted token broker supplies per-user,
in-memory credentials. Calls then require GSHEETS_BROKER_URL and
GSHEETS_BROKER_SESSION_TOKEN. Broker discovery exposes exactly eight tools;
Drive title search is intentionally absent. Do not put broker tokens in tracked
configuration or command arguments.
GSHEETS_TOKEN_MODE=broker gsheets-mcp capabilities --json
GSHEETS_TOKEN_MODE=broker gsheets-mcp serveAn invalid mode fails closed. Broker credentials refresh proactively near expiry, and Google 401 handling is bounded to one exact-request credential refresh.
Development
source venv/bin/activate
python -m pip install -e '.[dev]'
python -m pytest -q
python scripts/mcp_lint.pyThe lint command imports the live registry without credentials and verifies the mode-specific tool sets, strict schemas, annotations, versions, dependency pins, and absence of retired runtime paths.
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
- Flicense-qualityDmaintenanceAn MCP server that enables interaction with Google Sheets through natural language, allowing users to create, read, update, and manage spreadsheet data via the Google Sheets API v4.Last updated
- Alicense-qualityDmaintenanceMCP server for managing Google Sheets via 23 tools, enabling read/write, formatting, sheet management, and data operations through natural language.Last updated151MIT
- Alicense-qualityDmaintenanceMCP server for interacting with Google Sheets, providing tools to list sheets, read data from cell ranges, and write data to cell ranges.Last updated3MIT
- Alicense-qualityDmaintenanceMCP server enabling AI agents to read, write, and manage Google Sheets, including sheet manipulation, row/column operations, dropdowns, checkboxes, and conditional formatting.Last updated2MIT
Related MCP Connectors
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
MCP server for generating rough-draft project plans from natural-language prompts.
MCP server for Google search results via SERP API
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/henrysouchien/gsheets-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server