This Python-based MCP server acts as a bridge between AI assistants and Google Sheets, enabling powerful spreadsheet operations through a defined set of tools. It lets you query, create, and modify spreadsheets programmatically.
Before using this server, you must set up Google Cloud Platform credentials:
uvx
Install uv
(which includes uvx
):
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
Configure authentication (service account recommended):
# Linux/macOS
export SERVICE_ACCOUNT_PATH="/path/to/your/service-account-key.json"
export DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
# Windows CMD
set SERVICE_ACCOUNT_PATH="C:\path\to\your\service-account-key.json"
set DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
# Windows PowerShell
$env:SERVICE_ACCOUNT_PATH = "C:\path\to\your\service-account-key.json"
$env:DRIVE_FOLDER_ID = "YOUR_DRIVE_FOLDER_ID"
Run the server:
uvx mcp-google-sheets@latest
export SERVICE_ACCOUNT_PATH="/path/to/service-account-key.json"
export DRIVE_FOLDER_ID="your_folder_id_from_url"
export CREDENTIALS_PATH="/path/to/credentials.json"
export TOKEN_PATH="/path/to/token.json"
Instead of file paths, provide Base64-encoded credentials:
export CREDENTIALS_CONFIG="ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb..."
export DRIVE_FOLDER_ID="your_folder_id" # If using service account
Add this configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": ["mcp-google-sheets@latest"],
"env": {
"SERVICE_ACCOUNT_PATH": "/full/path/to/your/service-account-key.json",
"DRIVE_FOLDER_ID": "your_shared_folder_id_here"
},
"healthcheck_url": "http://localhost:8000/health"
}
}
}
The server provides these tools for interacting with Google Sheets:
list_spreadsheets
: Lists available spreadsheetscreate_spreadsheet
: Creates a new spreadsheet with specified titlelist_sheets
: Lists all sheets within a spreadsheetcreate_sheet
: Adds a new sheet to a spreadsheetshare_spreadsheet
: Shares a spreadsheet with specified users and rolesget_sheet_data
: Reads data from a specified rangeget_sheet_formulas
: Reads formulas from a specified rangeupdate_cells
: Writes data to a specific rangebatch_update_cells
: Updates multiple ranges in one operationadd_rows
: Appends rows to the end of a sheetget_multiple_sheet_data
: Fetches data from multiple ranges across spreadsheetsget_multiple_spreadsheet_summary
: Gets titles, sheet names, headers, and first rowsTo add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "google-sheets" '{"command":"uvx","args":["mcp-google-sheets@latest"],"env":{"SERVICE_ACCOUNT_PATH":"/path/to/your/service-account-key.json","DRIVE_FOLDER_ID":"your_shared_folder_id_here"},"healthcheck_url":"http://localhost:8000/health"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": [
"mcp-google-sheets@latest"
],
"env": {
"SERVICE_ACCOUNT_PATH": "/path/to/your/service-account-key.json",
"DRIVE_FOLDER_ID": "your_shared_folder_id_here"
},
"healthcheck_url": "http://localhost:8000/health"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": [
"mcp-google-sheets@latest"
],
"env": {
"SERVICE_ACCOUNT_PATH": "/path/to/your/service-account-key.json",
"DRIVE_FOLDER_ID": "your_shared_folder_id_here"
},
"healthcheck_url": "http://localhost:8000/health"
}
}
}
3. Restart Claude Desktop for the changes to take effect