by xing5
This MCP server integrates with your Google Drive and Google Sheets, to enable creating and modifying spreadsheets.
# Add to your Claude Code skills
git clone https://github.com/xing5/mcp-google-sheetsmcp-google-sheets is a Python-based MCP server that acts as a bridge between any MCP-compatible client (like Claude Desktop) and the Google Sheets API. It allows you to interact with your Google Spreadsheets using a defined set of tools, enabling powerful automation and data manipulation workflows driven by AI.
uvx)Essentially the server runs in one line: uvx mcp-google-sheets@latest.
This command will automatically download the latest code and run it. We recommend always using @latest to ensure you have the newest version with the latest features and bug fixes.
Refer to the ID Reference Guide for more information about the IDs used below.
☁️ Prerequisite: Google Cloud Setup
🐍 Install
No comments yet. Be the first to share your thoughts!
uvuvx is part of uv, a fast Python package installer and resolver. Install it if you haven't already:
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
# Or using pip:
# pip install uv
Follow instructions in the installer output to add uv to your PATH if needed.🔑 Set Essential Environment Variables (Service Account Recommended)
# Replace with YOUR actual path and folder ID from the Google Setup step
export SERVICE_ACCOUNT_PATH="/path/to/your/service-account-key.json"
export DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
set SERVICE_ACCOUNT_PATH="C:\path\to\your\service-account-key.json"
set DRIVE_FOLDER_ID="YOUR_DRIVE_FOLDER_ID"
$env:SERVICE_ACCOUNT_PATH = "C:\path\to\your\service-account-key.json"
$env:DRIVE_FOLDER_ID = "YOUR_DRIVE_FOLDER_ID"
CREDENTIALS_CONFIG).🏃 Run the Server!
uvx will automatically download and run the latest version of mcp-google-sheets:
uvx mcp-google-sheets@latest
💡 Pro Tip: Always use
@latestto ensure you get the newest version with bug fixes and features. Without@latest,uvxmay use a cached older version.
🔌 Connect your MCP Client
⚡ Optional: Enable Tool Filtering (Reduce Context Usage)
You're ready! Start issuing commands via your MCP client.
uvx (zero-install feel) or clone for development using uv.--include-tools or ENABLED_TOOLS environment variable.Problem: By default, this MCP server exposes all 19 tools, consuming ~13,000 tokens before any conversation begins. If you only need a few tools, this wastes valuable context window space.
Solution: Use tool filtering to enable only the tools you actually use.
You can filter tools using either:
Command-line argument --include-tools:
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": [
"mcp-google-sheets@latest",
"--include-tools",
"get_sheet_data,update_cells,list_spreadsheets,list_sheets"
],
"env": {
"SERVICE_ACCOUNT_PATH": "/path/to/credentials.json"
}
}
}
}
Environment variable ENABLED_TOOLS:
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": ["mcp-google-sheets@latest"],
"env": {
"SERVICE_ACCOUNT_PATH": "/path/to/credentials.json",
"ENABLED_TOOLS": "get_sheet_data,update_cells,list_spreadsheets,list_sheets"
}
}
}
}
When filtering, use these exact tool names (comma-separated, no spaces):
Most Common Tools (recommended subset):
get_sheet_data - Read from spreadsheetsupdate_cells - Write to spreadsheetslist_spreadsheets - Find spreadsheetslist_sheets - Navigate tabsAll Available Tools:
add_columnsadd_rowsbatch_updatebatch_update_cellscopy_sheetcreate_sheetcreate_spreadsheetfind_in_spreadsheetget_multiple_sheet_dataget_multiple_spreadsheet_summaryget_sheet_dataget_sheet_formulaslist_folderslist_sheetslist_spreadsheetsrename_sheetsearch_spreadsheetsshare_spreadsheetupdate_cellsNote: If neither --include-tools nor ENABLED_TOOLS is specified, all tools are enabled (default behavior).
This server exposes the following tools for interacting with Google Sheets:
Refer to the ID Reference Guide for more information about the IDs used below.
(Input parameters are typically strings unless otherwise specified)
list_spreadsheets: Lists spreadsheets in the configured Drive folder (Service Account) or accessible by the user (OAuth).
folder_id (optional string): Google Drive folder ID to search in. Get from its URL. If omitted, uses the configured default folder or searches 'My Drive'.[{id: string, title: string}]create_spreadsheet: Creates a new spreadsheet.
title (string): The desired title for the spreadsheet. Example: "Quarterly Report Q4".folder_id (optional string): Google Drive folder ID where the spreadsheet should be created. Get from its URL. If omitted, uses configured default or root.spreadsheetId, title, and folder.get_sheet_data: Reads data from a range in a sheet/tab.
spreadsheet_id (string): The spreadsheet ID (from its URL).sheet (string): Name of the sheet/tab (e.g., "Sheet1").range (optional string): A1 notation (e.g., 'A1:C10', 'Sheet1!B2:D'). If omitted, reads the whole sheet/tab specified by sheet.include_grid_data (optional boolean, default False): If True, returns full grid data including formatting and metadata (much larger). If False, returns values only (more efficient).include_grid_data=True, full grid data with metadata (get response). If False, a values result object from the Values API (values.get response).get_sheet_formulas: Reads formulas from a range in a sheet/tab.
spreadsheet_id (string): The spreadsheet ID (from its URL).sheet (string): Name of the sheet/tab (e.g., "Sheet1").range (optional string): A1 notation (e.g., 'A1:C10', 'Sheet1!B2:D'). If omitted, reads all formulas in the sheet/tab specified by sheet.values.get response).update_cells: Writes data to a specific range. Overwrites existing data.
spreadsheet_id (string): The spreadsheet ID (from its URL).sheet (string): Name of the sheet/tab (e.g., "Sheet1").range (string): A1 notation range to write to (e.g.