This MCP server acts as a bridge between MCP-compatible clients (like Claude Desktop) and the Google Sheets API, allowing you to interact with Google Spreadsheets through AI assistants. It provides a comprehensive set of tools for creating, reading, updating, and managing spreadsheets.
Before using the MCP 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"
Set up authentication environment variables:
For 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
Connect your MCP client (e.g., Claude Desktop) to the running server
Create a Service Account:
Create & Share a Google Drive Folder:
Set Environment Variables:
SERVICE_ACCOUNT_PATH
: Path to the JSON key fileDRIVE_FOLDER_ID
: ID of the shared folderFor personal use with interactive browser login:
CREDENTIALS_PATH
: Path to the OAuth credentials JSONTOKEN_PATH
: Path to store the user tokenCREDENTIALS_CONFIG
with Base64-encoded credentialsAdd the server 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"
}
}
}
}
Note for macOS users: Use the full path to uvx
(e.g., /Users/yourusername/.local/bin/uvx
).
The server provides numerous tools for working with Google Sheets:
list_spreadsheets
: Lists accessible spreadsheetscreate_spreadsheet
: Creates a new spreadsheetget_sheet_data
: Reads data from a sheet rangeupdate_cells
: Writes data to a specific rangeadd_rows
: Appends rows to a sheetlist_sheets
: Lists all sheets in a spreadsheetcreate_sheet
: Adds a new sheet to a spreadsheetshare_spreadsheet
: Shares a spreadsheet with specific usersget_multiple_spreadsheet_summary
: Gets summaries of multiple spreadsheetsAnd several other tools for comprehensive spreadsheet management.
[['2024-07-31', 'Task A Completed'], ['2024-08-01', 'Task B Started']]
"[email protected]
as a reader."To 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