Provides comprehensive tools for programmatically managing Google Sheets, including functionality to create spreadsheets, read and write cell data, append rows, clear ranges, and retrieve spreadsheet metadata.
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 Servercreate a spreadsheet named 'Project Tracker' with sheets 'Tasks' and 'Status'"
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 comprehensive Google Sheets integration. This server enables you to create, read, update, and manage Google Sheets spreadsheets programmatically.
๐ฏ Purpose
This server enables you to:
Create new Google Sheets spreadsheets with custom sheet names
Read data from any range in a spreadsheet
Write data to specific ranges
Append new rows to existing data
Clear ranges of data
Get spreadsheet information and metadata
Batch update multiple ranges efficiently
๐ ๏ธ Available Tools
Core Operations
create-spreadsheet
Creates a new Google Sheets spreadsheet
Input:
title(required),sheet_names(optional array)Returns: Spreadsheet ID, URL, and created sheet names
read-range
Reads data from a specific range
Input:
spreadsheet_id,range_name(e.g., 'Sheet1!A1:C10')Returns: 2D array of cell values
write-range
Writes data to a specific range (overwrites existing data)
Input:
spreadsheet_id,range_name,values(2D array)Returns: Update statistics
append-rows
Appends rows to the end of a range
Input:
spreadsheet_id,range_name,values(2D array)Returns: Update statistics
clear-range
Clears all data from a specified range
Input:
spreadsheet_id,range_nameReturns: Confirmation of cleared range
get-spreadsheet-info
Gets metadata about a spreadsheet
Input:
spreadsheet_idReturns: Title, URL, sheet information, dimensions
batch-update
Performs multiple range updates in a single request
Input:
spreadsheet_id,updates(array of range/values pairs)Returns: Total update statistics
Prompts
manage-sheets: General Google Sheets management prompt for AI assistants
๐ Setup
1. Google Sheets API Setup
Create a Google Cloud project or use an existing one
Configure an OAuth consent screen
Select "External" for testing purposes
Add your email as a test user
Add OAuth scope:
https://www.googleapis.com/auth/spreadsheetsCreate OAuth 2.0 Client ID credentials
Choose "Desktop Application"
Download the credentials JSON file
Save it securely and note the file path
2. Installation
Using uv (recommended):
3. Authentication
On first run, the server will launch a browser for OAuth authentication.
Access tokens will be saved to the specified --token-path for future use.
๐ผ Usage
Standalone Usage
Integration with Claude Desktop
Add to your claude_desktop_config.json:
Integration with Other MCP Clients
This server follows the standard MCP protocol and can be integrated with any MCP-compatible client.
๐ Usage Examples
Creating a New Spreadsheet
Reading Data
Writing Data
Appending New Data
Batch Updates
๐งช Testing
With MCP Inspector
Test the server using MCP Inspector:
Manual Testing
Create a test spreadsheet
Read some data to verify connectivity
Write test data to ensure write permissions work
Try different range formats (A1 notation, named ranges, etc.)
๐ Common Use Cases
Data Analysis Workflows
Content Management
Project Management
Data Synchronization
๐ง Advanced Features
Range Formats Supported
A1 notation:
Sheet1!A1:C10Named ranges:
MyNamedRangeEntire columns:
Sheet1!A:CEntire rows:
Sheet1!1:5Open-ended ranges:
Sheet1!A1:C
Error Handling
The server includes comprehensive error handling for:
Authentication failures and token refresh
Network timeouts and connectivity issues
Invalid spreadsheet IDs or range names
Permission errors
API quota limits
Malformed data inputs
Performance Considerations
Uses
asyncio.to_threadfor non-blocking API callsSupports batch operations for efficiency
Handles Google Sheets API rate limits gracefully
Optimized for both small and large data operations
๐ Security & Permissions
Required OAuth Scopes
https://www.googleapis.com/auth/spreadsheets- Full access to Google Sheets
Security Best Practices
Store credentials securely
Use environment variables for sensitive paths
Implement proper access controls
Regularly rotate access tokens
Monitor API usage and quotas
๐ค Contributing & Extending
This server is designed to be easily extensible. Common enhancements:
Additional Features
Formatting operations (bold, colors, borders)
Formula support for calculated cells
Chart creation and management
Conditional formatting rules
Data validation constraints
Pivot tables and summaries
Integration Enhancements
Database connectors for data import/export
CSV/Excel file import/export
Real-time collaboration features
Webhook notifications for changes
Advanced search and filtering
Performance Optimizations
Caching strategies for frequently accessed data
Streaming support for large datasets
Parallel processing for bulk operations
Connection pooling for high-throughput scenarios
๐ API Reference
Google Sheets API Limits
100 requests per 100 seconds per user
1000 requests per 100 seconds (total quota)
Maximum 10 million cells per spreadsheet
Maximum 200 sheets per spreadsheet
Response Formats
All tools return structured responses with:
Status indicators (success/error)
Detailed error messages when applicable
Update statistics for write operations
Structured data for read operations
๐ Troubleshooting
Common Issues
Authentication Errors
Verify credentials file path
Check OAuth consent screen configuration
Ensure correct scopes are configured
Permission Errors
Verify spreadsheet sharing permissions
Check if spreadsheet exists
Ensure account has edit access
Range Errors
Validate A1 notation format
Check sheet names for typos
Verify range bounds
Quota Exceeded
Implement request throttling
Use batch operations when possible
Monitor usage in Google Cloud Console
Ready to supercharge your Google Sheets workflows with automated operations! ๐