Enables listing spreadsheets within specific folders and managing file sharing permissions for readers, commenters, and writers.
Provides comprehensive tools for spreadsheet manipulation, including cell data access, sheet management, conditional formatting, and structured table operations like filtering and row insertion.
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 MCP Serveradd a row to my 'Expenses' spreadsheet for 'Dinner' at $45 today"
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 Server
A Model Context Protocol (MCP) server that provides a secure bridge between MCP-compatible clients (like Claude Desktop) and the Google Sheets API.
Overview
This MCP server provides a secure interface for AI assistants to interact with Google Spreadsheets, enabling powerful automation and data manipulation workflows. It supports both Service Account and OAuth 2.0 authentication methods and runs as a containerized service for enhanced security.
Key Features
31 Tools for comprehensive spreadsheet manipulation
Service Account & OAuth 2.0 authentication support
Docker-based deployment with non-root user execution
Table-level operations for structured data management
Batch operations for efficient API usage
Conditional formatting with custom rules and formulas
CSV import/export capabilities
Architecture
Tools Available
Spreadsheet Management (3 tools)
list_spreadsheets- List spreadsheets from Drive folder or user accesscreate_spreadsheet- Create new spreadsheetshare_spreadsheet- Share with users/emails (reader, commenter, writer roles)
Sheet Operations (6 tools)
list_sheets- List all sheet names in a spreadsheetcreate_sheet- Add new sheet (tab)rename_sheet- Rename existing sheetcopy_sheet- Duplicate sheet within or across spreadsheetsadd_columns- Add columns to sheetadd_conditional_formatting- Add conditional formatting rulesupdate_conditional_formatting- Update or move existing rules
Data Access (4 tools)
get_sheet_data- Read data from range (with optional grid metadata)get_sheet_formulas- Read formulas from rangeget_multiple_sheet_data- Fetch multiple ranges in one callget_multiple_spreadsheet_summary- Get titles, headers, and preview rows
Data Modification (3 tools)
update_cells- Write data to specific range (overwrites)batch_update_cells- Update multiple ranges in one calladd_rows- Append rows to end of sheet
Table Operations (11 tools)
list_tables- List defined tables (named ranges)create_table- Create table with headers and optional dataget_table_data- Read table data with filters, limit, offsetinsert_table_rows- Insert rows into tableupdate_table_rows- Update rows matching criteriadelete_table_rows- Delete rows matching criteriaadd_table_columns- Add columns to tablerename_table_column- Rename table headerexport_table_as_csv- Export table to CSV formatimport_csv_to_table- Import CSV content into table
Prerequisites
Docker Desktop with MCP Toolkit enabled
Docker MCP CLI plugin (
docker mcpcommand)Google Cloud Project with:
Google Sheets API enabled
Google Drive API enabled
Credentials:
Service Account JSON file (recommended), OR
OAuth 2.0 credentials for user authentication
Quick Start
1. Build Docker Image
2. Configure Credentials
3. Create Custom Catalog
Create or edit ~/.docker/mcp/catalogs/custom.yaml:
4. Update Registry
Edit ~/.docker/mcp/registry.yaml and add:
5. Configure Claude Desktop
Edit your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the custom catalog to the args array:
6. Restart Claude Desktop
Quit and restart Claude Desktop completely. Your Google Sheets tools should now be available!
Usage Examples
Basic Operations
Table Operations
Advanced Features
Data Format Examples
2D Array (for update_cells, add_rows)
Multiple Ranges (for batch_update_cells)
Filters (for get_table_data)
Conditional Formatting Rule
Development
Local Testing
Adding New Tools
Add function to
googlesheets_server.pyDecorate with
@mcp.tool()Use single-line docstring only
Use empty string defaults (
param: str = "")Always return strings
Update catalog with new tool name
Rebuild Docker image
Implementation Rules
See CLAUDE.md for detailed guidelines:
NO multi-line docstrings (causes gateway panic)
NO type hints from typing module
NO
Nonedefaults (use""instead)Single-line docstrings ONLY
Always return strings from tools
Troubleshooting
Tools Not Appearing
Authentication Errors
Common Issues
Gateway panic: Check for multi-line docstrings in tools
JSON parse errors: Ensure valid JSON with double quotes
Empty results: Verify spreadsheet ID, sheet name, and range notation
Security
Credentials stored in Docker Desktop secrets (never hardcoded)
Server runs as non-root user (
mcpuser)Sensitive data never logged
Only operates on authorized spreadsheets
API Limits
Google Sheets API quotas:
500 requests per 100 seconds per project
100 requests per 100 seconds per user
Consider implementing request batching and caching for production use.
Files
googlesheets_server.py- Main MCP server implementationDockerfile- Container definitionrequirements.txt- Python dependenciesreadme.txt- Detailed installation guideCLAUDE.md- Development guidelines for Claude Codemcp-builder-prompt.md- Template prompt used to build this server
References
License
MIT License
Support
For issues and questions:
Check the Troubleshooting section
Review
readme.txtfor detailed setup instructionsSee
CLAUDE.mdfor implementation guidelinesCheck Docker logs:
docker logs [container_name]