mcp-google-sheets
Allows listing spreadsheets within a specified Google Drive folder and creating new spreadsheets in a given folder.
Provides tools for managing Google Sheets, including creating, reading, updating, and deleting spreadsheets and sheets, as well as batch operations, formatting, and formula support.
Click on "Deploy 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., "@mcp-google-sheets List all my Google Sheets spreadsheets."
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.
🤔 What is this?
mcp-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.
Related MCP server: sheets-mcp-server
🚀 Quick Start (Using 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
You must configure Google Cloud Platform credentials and enable the necessary APIs first. We strongly recommend using a Service Account.
➡️ Jump to the Detailed Google Cloud Platform Setup guide below.
🐍 Install
uvuvxis part ofuv, 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 uvFollow instructions in the installer output to add
uvto your PATH if needed.
🔑 Set Essential Environment Variables (Service Account Recommended)
You need to tell the server how to authenticate. Set these variables in your terminal:
(Linux/macOS)
# 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"(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"➡️ See Detailed Authentication & Environment Variables for other options (OAuth,
CREDENTIALS_CONFIG).
🏃 Run the Server!
uvxwill automatically download and run the latest version ofmcp-google-sheets:uvx mcp-google-sheets@latestThe server will start and print logs indicating it's ready.
💡 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
Configure your client (e.g., Claude Desktop) to connect to the running server.
Depending on the client you use, you might not need step 4 because the client can launch the server for you. But it's a good practice to test run step 4 anyway to make sure things are set up properly.
➡️ See Usage with Claude Desktop for examples.
⚡ Optional: Enable Tool Filtering (Reduce Context Usage)
By default, all 19 tools are enabled (~13K tokens). To reduce context usage, enable only the tools you need.
➡️ See Tool Filtering for details.
You're ready! Start issuing commands via your MCP client.
✨ Key Features
Seamless Integration: Connects directly to Google Drive & Google Sheets APIs.
Comprehensive Tools: Offers a wide range of operations (CRUD, listing, batching, sharing, formatting, etc.).
Flexible Authentication: Supports Service Accounts (recommended), OAuth 2.0, and direct credential injection via environment variables.
Easy Deployment: Run instantly with
uvx(zero-install feel) or clone for development usinguv.AI-Ready: Designed for use with MCP-compatible clients, enabling natural language spreadsheet interaction.
Tool Filtering: Reduce context window usage by enabling only the tools you need with
--include-toolsorENABLED_TOOLSenvironment variable.
🎯 Tool Filtering (Reduce Context Usage)
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.
How to Enable Tool Filtering
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" } } } }
Available Tool Names
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 tabs
All 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_cells
Note: If neither --include-tools nor ENABLED_TOOLS is specified, all tools are enabled (default behavior).
🛠️ Available Tools & Resources
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'.Returns: List of objects
[{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.Returns: Object with spreadsheet info, including
spreadsheetId,title, andfolder.
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 bysheet.include_grid_data(optional boolean, defaultFalse): IfTrue, returns full grid data including formatting and metadata (much larger). IfFalse, returns values only (more efficient).Returns: If
include_grid_data=True, full grid data with metadata (getresponse). IfFalse, a values result object from the Values API (values.getresponse).
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 bysheet.Returns: 2D array of cell formulas (array of arrays) (
values.getresponse).
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., 'A1:C3').data(array of arrays): 2D array of values to write. Example:[[1, 2, 3], ["a", "b", "c"]].Returns: Update result object (
values.updateresponse).
batch_update_cells: Updates multiple ranges in one API call.spreadsheet_id(string): The spreadsheet ID (from its URL).sheet(string): Name of the sheet/tab (e.g., "Sheet1").ranges(object): Dictionary mapping range strings (A1 notation) to 2D arrays of values. Example:{ "A1:B2": [[1, 2], [3, 4]], "D5": [["Hello"]] }.Returns: Result of the operation (
values.batchUpdateresponse).
add_rows: Adds (inserts) empty rows to a sheet/tab at a specified index.spreadsheet_id(string): The spreadsheet ID (from its URL).sheet(string): Name of the sheet/tab (e.g., "Sheet1").count(integer): Number of empty rows to insert.start_row(optional integer, default0): 0-based row index to start inserting rows. If omitted, defaults to0(inserts at the beginning).Returns: Result of the operation (
batchUpdateresponse).
list_sheets: Lists all sheet/tab names within a spreadsheet.spreadsheet_id(string): The spreadsheet ID (from its URL).Returns: List of sheet/tab name strings. Example:
["Sheet1", "Sheet2"].
create_sheet: Adds a new sheet/tab to a spreadsheet.spreadsheet_id(string): The spreadsheet ID (from its URL).title(string): Name for the new sheet/tab.Returns: New sheet properties object.
get_multiple_sheet_data: Fetches data from multiple ranges across potentially different spreadsheets in one call.queries(array of objects): Each object needsspreadsheet_id,sheet, andrange. Example:[{"spreadsheet_id": "abc", "sheet": "Sheet1", "range": "A1:B2"}, ...].Returns: List of objects, each containing the query params and fetched
dataor anerror. Eachdatais avalues.getresponse.
get_multiple_spreadsheet_summary: Gets titles, sheet/tab names, headers, and first few rows for multiple spreadsheets.spreadsheet_ids(array of strings): IDs of the spreadsheets (from their URLs).rows_to_fetch(optional integer, default5): How many rows (including header) to preview. Example:5.Returns: List of summary objects for each spreadsheet.
share_spreadsheet: Shares a spreadsheet with specified users/emails and roles.spreadsheet_id(string): The spreadsheet ID (from its URL).recipients(array of objects):[{"email_address": "user@example.com", "role": "writer"}, ...]. Roles:reader,commenter,writer.send_notification(optional boolean, defaultTrue): Send email notifications to recipients.Returns: Dictionary with
successesandfailureslists.
add_columns: Adds (inserts) empty columns to a sheet/tab at a specified index.spreadsheet_id(string): The spreadsheet ID (from its URL).sheet(string): Name of the sheet/tab (e.g., "Sheet1").count(integer): Number of empty columns to insert.start_column(optional integer, default0): 0-based column index to start inserting. If omitted, defaults to0(inserts at the beginning).Returns: Result of the operation (
batchUpdateresponse).
copy_sheet: Duplicates a sheet/tab from one spreadsheet to another and optionally renames it.src_spreadsheet(string): Source spreadsheet ID (from its URL).src_sheet(string): Source sheet/tab name (e.g., "Sheet1").dst_spreadsheet(string): Destination spreadsheet ID (from its URL).dst_sheet(string): Desired sheet/tab name in the destination spreadsheet.Returns: Result of the copy and optional rename operations.
rename_sheet: Renames an existing sheet/tab.spreadsheet(string): The spreadsheet ID (from its URL).sheet(string): Current sheet/tab name (e.g., "Sheet1").new_name(string): New sheet/tab name (e.g., "Transactions").Returns: Result of the operation (
batchUpdateresponse).
add_chart: Creates a chart in a Google Spreadsheet from specified data.spreadsheet_id(string): The spreadsheet ID (from its URL).sheet(string): Name of the sheet/tab containing the data (e.g., "Sheet1").chart_type(string): Type of chart to create. Options:COLUMN(vertical bars),BAR(horizontal bars),LINE,AREA,PIE,SCATTER,COMBO,HISTOGRAM.data_range(string): A1 notation range for the chart data (e.g., "A1:C10"). First row is treated as headers.title(optional string): Chart title.x_axis_label(optional string): Label for the X axis (bottom axis). Not applicable for pie charts.y_axis_label(optional string): Label for the Y axis (left axis). Not applicable for pie charts.position_x(optional integer, default0): Horizontal position offset in pixels from the top-left corner.position_y(optional integer, default0): Vertical position offset in pixels from the top-left corner.width(optional integer, default600): Width of the chart in pixels.height(optional integer, default400): Height of the chart in pixels.Returns: Result object with success status, chart ID, and operation details.
MCP Resources:
spreadsheet://{spreadsheet_id}/info: Get basic metadata about a Google Spreadsheet.Returns: JSON string with spreadsheet information.
☁️ Google Cloud Platform Setup (Detailed)
This setup is required before running the server.
Create/Select a GCP Project: Go to the Google Cloud Console.
Enable APIs: Navigate to "APIs & Services" -> "Library". Search for and enable:
Google Sheets APIGoogle Drive API
Configure Credentials: You need to choose one authentication method below (Service Account is recommended).
🔑 Authentication & Environment Variables (Detailed)
The server needs credentials to access Google APIs. Choose one method:
Refer to the ID Reference Guide for more information about the IDs used below.
Method A: Service Account (Recommended for Servers/Automation) ✅
Why? Headless (no browser needed), secure, ideal for server environments. Doesn't expire easily.
Steps:
Create Service Account: In GCP Console -> "IAM & Admin" -> "Service Accounts".
Click "+ CREATE SERVICE ACCOUNT". Name it (e.g.,
mcp-sheets-service).Grant Roles: Add
Editorrole for broad access, or more granular roles (likeroles/drive.fileand specific Sheets roles) for stricter permissions.Click "Done". Find the account, click Actions (⋮) -> "Manage keys".
Click "ADD KEY" -> "Create new key" -> JSON -> "CREATE".
Download and securely store the JSON key file.
Create & Share Google Drive Folder:
In Google Drive, create a folder (e.g., "AI Managed Sheets").
Note the Folder ID from the URL:
https://drive.google.com/drive/folders/THIS_IS_THE_FOLDER_ID.Right-click the folder -> "Share" -> "Share".
Enter the Service Account's email (from the JSON file
client_email).Grant Editor access. Uncheck "Notify people". Click "Share".
Set Environment Variables:
SERVICE_ACCOUNT_PATH: Full path to the downloaded JSON key file.DRIVE_FOLDER_ID: The ID of the shared Google Drive folder. (See Ultra Quick Start for OS-specific examples)
Method B: OAuth 2.0 (Interactive / Personal Use) 🧑💻
Why? For personal use or local development where interactive browser login is okay.
Steps:
Configure OAuth Consent Screen: In GCP Console -> "APIs & Services" -> "OAuth consent screen". Select "External", fill required info, add scopes (
.../auth/spreadsheets,.../auth/drive), add test users if needed.Create OAuth Client ID: In GCP Console -> "APIs & Services" -> "Credentials". "+ CREATE CREDENTIALS" -> "OAuth client ID" -> Type: Desktop app. Name it. "CREATE". Download JSON.
Set Environment Variables:
CREDENTIALS_PATH: Path to the downloaded OAuth credentials JSON file (default:credentials.json).TOKEN_PATH: Path to store the user's refresh token after first login (default:token.json). Must be writable.
Method C: Direct Credential Injection (Advanced) 🔒
Why? Useful in environments like Docker, Kubernetes, or CI/CD where managing files is hard, but environment variables are easy/secure. Avoids file system access.
How? Instead of providing a path to the credentials file, you provide the content of the file, encoded in Base64, directly in an environment variable.
Steps:
Get your credentials JSON file (either Service Account key or OAuth Client ID file). Let's call it
your_credentials.json.Generate the Base64 string:
(Linux/macOS):
base64 -w 0 your_credentials.json(Windows PowerShell):
$filePath = "C:\path\to\your_credentials.json"; # Use actual path $bytes = [System.IO.File]::ReadAllBytes($filePath); $base64 = [System.Convert]::ToBase64String($bytes); $base64 # Copy this output(Caution): Avoid pasting sensitive credentials into untrusted online encoders.
Set the Environment Variable:
CREDENTIALS_CONFIG: Set this variable to the full Base64 string you just generated.# Example (Linux/macOS) - Use the actual string generated export CREDENTIALS_CONFIG="ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb..."
Method D: Application Default Credentials (ADC) 🌐
Why? Ideal for Google Cloud environments (GKE, Compute Engine, Cloud Run) and local development with
gcloud auth application-default login. No explicit credential files needed.How? Uses Google's Application Default Credentials chain to automatically discover credentials from multiple sources.
ADC Search Order:
GOOGLE_APPLICATION_CREDENTIALSenvironment variable (path to service account key) - Google's standard variablegcloud auth application-default logincredentials (local development)Attached service account from metadata server (GKE, Compute Engine, etc.)
Setup:
Local Development:
Run
gcloud auth application-default login --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/driveonceSet a quota project:
gcloud auth application-default set-quota-project <project_id>(replace<project_id>with your Google Cloud project ID)
Google Cloud: Attach a service account to your compute resource
Environment Variable: Set
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json(Google's standard)
No additional environment variables needed - ADC is used automatically as a fallback when other methods fail.
Note: GOOGLE_APPLICATION_CREDENTIALS is Google's official standard environment variable, while SERVICE_ACCOUNT_PATH is specific to this MCP server. If you set GOOGLE_APPLICATION_CREDENTIALS, ADC will find it automatically.
Authentication Priority & Summary
The server checks for credentials in this order:
CREDENTIALS_CONFIG(Base64 content)SERVICE_ACCOUNT_PATH(Path to Service Account JSON)CREDENTIALS_PATH(Path to OAuth JSON) - triggers interactive flow if token is missing/expiredApplication Default Credentials (ADC) - automatic fallback
Environment Variable Summary:
Variable | Method(s) | Description | Default |
| Service Account | Path to the Service Account JSON key file (MCP server specific). | - |
| ADC | Path to service account key (Google's standard variable). | - |
| Service Account | ID of the Google Drive folder shared with the Service Account. | - |
| OAuth 2.0 | Path to the OAuth 2.0 Client ID JSON file. |
|
| OAuth 2.0 | Path to store the generated OAuth token. |
|
| Service Account / OAuth 2.0 | Base64 encoded JSON string of credentials content. | - |
⚙️ Running the Server (Detailed)
Refer to the ID Reference Guide for more information about the IDs used below.
Method 1: Using uvx (Recommended for Users)
As shown in the Ultra Quick Start, this is the easiest way. Set environment variables, then run:
uvx mcp-google-sheets@latestuvx handles fetching and running the package temporarily.
Method 2: For Development (Cloning the Repo)
If you want to modify the code:
Clone:
git clone https://github.com/yourusername/mcp-google-sheets.git && cd mcp-google-sheets(Use actual URL)Set Environment Variables: As described above.
Run using
uv: (Uses the local code)uv run mcp-google-sheets # Or via the script name if defined in pyproject.toml, e.g.: # uv run start
Method 3: Docker (SSE transport)
Run the server in a container using the included Dockerfile:
# Build the image
docker build -t mcp-google-sheets .
# Run (SSE on port 8000)
# NOTE: Prefer CREDENTIALS_CONFIG (Base64 credentials content) in containers.
docker run --rm -p 8000:8000 ^
-e HOST=0.0.0.0 ^
-e PORT=8000 ^
-e CREDENTIALS_CONFIG=YOUR_BASE64_CREDENTIALS ^
-e DRIVE_FOLDER_ID=YOUR_DRIVE_FOLDER_ID ^
mcp-google-sheetsUse
CREDENTIALS_CONFIGinstead ofSERVICE_ACCOUNT_PATHinside Docker to avoid mounting secrets as files.The container starts with
--transport sseand listens onHOST/PORT. Point your MCP client tohttp://localhost:8000using SSE transport.
🔌 Usage with Claude Desktop
Add the server config to claude_desktop_config.json under mcpServers. Choose the block matching your setup:
Refer to the ID Reference Guide for more information about the IDs used below.
⚠️ Important Notes:
🍎 macOS Users: use the full path:
"/Users/yourusername/.local/bin/uvx"instead of just"uvx"
{
"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"
}
}
}
}🍎 macOS Note: If you get a spawn uvx ENOENT error, use the full path to uvx:
{
"mcpServers": {
"google-sheets": {
"command": "/Users/yourusername/.local/bin/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"
}
}
}
}Replace yourusername with your actual username.
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": ["mcp-google-sheets@latest"],
"env": {
"CREDENTIALS_PATH": "/full/path/to/your/credentials.json",
"TOKEN_PATH": "/full/path/to/your/token.json"
}
}
}
}Note: A browser may open for Google login on first use. Ensure TOKEN_PATH is writable.
🍎 macOS Note: If you get a spawn uvx ENOENT error, replace "command": "uvx" with "command": "/Users/yourusername/.local/bin/uvx" (replace yourusername with your actual username).
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": ["mcp-google-sheets@latest"],
"env": {
"CREDENTIALS_CONFIG": "ewogICJ0eXBlIjogInNlcnZpY2VfYWNjb3VudCIsCiAgInByb2plY3RfaWQiOiAi...",
"DRIVE_FOLDER_ID": "your_shared_folder_id_here"
}
}
}
}Note: Paste the full Base64 string for CREDENTIALS_CONFIG. DRIVE_FOLDER_ID is still needed for Service Account folder context.
🍎 macOS Note: If you get a spawn uvx ENOENT error, replace "command": "uvx" with "command": "/Users/yourusername/.local/bin/uvx" (replace yourusername with your actual username).
Option 1: With GOOGLE_APPLICATION_CREDENTIALS
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": ["mcp-google-sheets@latest"],
"env": {
"GOOGLE_APPLICATION_CREDENTIALS": "/path/to/service-account.json"
}
}
}
}Option 2: With gcloud auth (no env vars needed)
{
"mcpServers": {
"google-sheets": {
"command": "uvx",
"args": ["mcp-google-sheets@latest"],
"env": {}
}
}
}Prerequisites:
Run
gcloud auth application-default login --scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/drivefirst.Set quota project:
gcloud auth application-default set-quota-project <project_id>
🍎 macOS Note: If you get a spawn uvx ENOENT error, replace "command": "uvx" with "command": "/Users/yourusername/.local/bin/uvx" (replace yourusername with your actual username).
{
"mcpServers": {
"mcp-google-sheets-local": {
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/your/mcp-google-sheets",
"mcp-google-sheets"
],
"env": {
"SERVICE_ACCOUNT_PATH": "/path/to/your/mcp-google-sheets/service_account.json",
"DRIVE_FOLDER_ID": "your_drive_folder_id_here"
}
}
}
}Note: Use --directory flag to specify the project path, and adjust paths to match your actual workspace location.
💬 Example Prompts for Claude
Once connected, try prompts like:
"List all spreadsheets I have access to." (or "in my AI Managed Sheets folder")
"Create a new spreadsheet titled 'Quarterly Sales Report Q3 2024'."
"In the 'Quarterly Sales Report' spreadsheet, get the data from Sheet1 range A1 to E10."
"Add a new sheet named 'Summary' to the spreadsheet with ID
1aBcDeFgHiJkLmNoPqRsTuVwXyZ.""In my 'Project Tasks' spreadsheet, Sheet 'Tasks', update cell B2 to 'In Progress'."
"Append these rows to the 'Log' sheet in spreadsheet
XYZ:[['2024-07-31', 'Task A Completed'], ['2024-08-01', 'Task B Started']]""Get a summary of the spreadsheets 'Sales Data' and 'Inventory Count'."
"Share the 'Team Vacation Schedule' spreadsheet with
team@example.comas a reader andmanager@example.comas a writer. Don't send notifications.""Create a column chart in my 'Sales Report' spreadsheet showing monthly revenue from data in range A1:B13."
"Add a pie chart to the 'Market Analysis' sheet with data from A1:B5 titled 'Market Share by Product'."
"In spreadsheet
abc123, create a line chart on Sheet1 from range A1:C10 with title 'Growth Trends' and labels 'Month' and 'Revenue'."
🆔 ID Reference Guide
Use the following reference guide to find the various IDs referenced throughout the docs:
Google Cloud Project ID:
https://console.cloud.google.com/apis/dashboard?project=sheets-mcp-server-123456
└───── Project ID ─────┘
Google Drive Folder ID:
https://drive.google.com/drive/u/0/folders/1xcRQCU9xrNVBPTeNzHqx4hrG7yR91WIa
└────────── Folder ID ──────────┘
Google Sheets Spreadsheet ID:
https://docs.google.com/spreadsheets/d/25_-_raTaKjaVxu9nJzA7-FCrNhnkd3cXC54BPAOXemI/edit
└───────────── Spreadsheet ID ─────────────┘🤝 Contributing
Contributions are welcome! Please open an issue to discuss bugs or feature requests. Pull requests are appreciated.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Credits
Built with FastMCP.
Inspired by kazz187/mcp-google-spreadsheet.
Uses Google API Python Client libraries.
Available Tools
40 toolsadd_chartADestructive
Add a chart to a Google Spreadsheet.
Creates a chart from the specified data range with customizable type, title, and positioning. The chart is added as a floating element on the sheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet containing the data chart_type: Type of chart to create. Supported types: - COLUMN: Vertical bar chart - BAR: Horizontal bar chart - LINE: Line chart - AREA: Area chart - PIE: Pie chart - SCATTER: Scatter plot - COMBO: Combination chart - HISTOGRAM: Histogram data_range: A1 notation range for chart data (e.g., 'A1:C10'). The first row is typically treated as headers. title: Optional title for the chart x_axis_label: Optional label for the X axis (bottom axis) y_axis_label: Optional label for the Y axis (left axis) position_x: Horizontal position offset in pixels from the top-left corner (default: 0) position_y: Vertical position offset in pixels from the top-left corner (default: 0) width: Width of the chart in pixels (default: 600) height: Height of the chart in pixels (default: 400)
Returns: Result of the chart creation operation
Examples: Create a column chart showing sales data: add_chart( spreadsheet_id="abc123", sheet="Sales", chart_type="COLUMN", data_range="A1:B13", title="Monthly Sales", x_axis_label="Month", y_axis_label="Revenue ($)" )
Create a pie chart for market share:
add_chart(
spreadsheet_id="abc123",
sheet="Market",
chart_type="PIE",
data_range="A1:B5",
title="Market Share by Product"
)
Inputs: spreadsheet_id (required), sheet (required), chart_type (required), data_range (required), +7 more. Returns: result
add_columnsADestructive
Add columns to a sheet in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet count: Number of columns to add start_column: 0-based column index to start adding. If not provided, adds at the beginning.
Returns: Result of the operation
Inputs: spreadsheet_id (required), sheet (required), count (required), start_column. Returns: result
add_commentADestructive
Add a comment to a spreadsheet. Optionally anchor it to a specific cell.
Args: spreadsheet_id: The ID of the spreadsheet content: The comment text anchor_cell: Cell reference in 'Sheet1!A1' format. If omitted, adds a file-level comment.
Returns: The created comment
Inputs: spreadsheet_id (required), content (required), anchor_cell. Returns: result
add_conditional_formatADestructive
Add a conditional formatting rule to a range.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'B2:B100') rule_type: Condition type — 'NUMBER_GREATER', 'NUMBER_LESS', 'NUMBER_EQ', 'TEXT_CONTAINS', 'TEXT_NOT_CONTAINS', 'BLANK', 'NOT_BLANK', 'NUMBER_BETWEEN', 'NUMBER_NOT_BETWEEN' values: Condition values (e.g., ['100'] for greater than 100, ['10','50'] for between) background_color: Hex color to apply when condition is met (e.g., '#FF0000')
Returns: Result of the conditional formatting operation
Inputs: spreadsheet_id (required), sheet (required), range (required), rule_type, +2 more. Returns: result
add_filterBDestructive
Add a basic filter (auto-filter) to a range.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'A1:E100')
Returns: Result of the filter operation
Inputs: spreadsheet_id (required), sheet (required), range (required). Returns: result
add_pivot_tableBDestructive
Create a pivot table from source data.
Args: spreadsheet_id: The ID of the spreadsheet source_sheet: Sheet name containing source data source_range: A1 range of source data (e.g., 'A1:E100') target_sheet: Sheet name to place the pivot table target_cell: Cell to anchor the pivot table (default 'A1') row_columns: List of 0-based column indices for row grouping (e.g., [0, 1]) value_columns: List of 0-based column indices to aggregate (e.g., [3, 4]) aggregation: Aggregation function — 'SUM', 'COUNTA', 'AVERAGE', 'MAX', 'MIN'
Returns: Result of the pivot table creation
Inputs: spreadsheet_id (required), source_sheet (required), source_range (required), target_sheet (required), +4 more. Returns: result
add_rowsBDestructive
Add rows to a sheet in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet count: Number of rows to add start_row: 0-based row index to start adding. If not provided, adds at the beginning.
Returns: Result of the operation
Inputs: spreadsheet_id (required), sheet (required), count (required), start_row. Returns: result
append_rowsADestructive
Append rows of data after the last row with content in a sheet. Useful for adding log entries or new records without knowing the exact row number.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name values: List of rows, each row is a list of cell values. Example: [["Alice", 30, "Seoul"], ["Bob", 25, "Busan"]]
Returns: The range where data was appended and number of rows added
Inputs: spreadsheet_id (required), sheet (required), values (required). Returns: result
auto_resizeADestructive
Auto-resize columns or rows to fit content.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name dimension: 'COLUMNS' or 'ROWS' start_index: 0-based start index end_index: 0-based end index (exclusive). Omit to resize all.
Returns: Result of the resize operation
Inputs: spreadsheet_id (required), sheet (required), dimension, start_index, +1 more. Returns: result
batch_updateADestructive
Execute a batch update on a Google Spreadsheet using the full batchUpdate endpoint. This provides access to all batchUpdate operations including adding sheets, updating properties, inserting/deleting dimensions, formatting, and more.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) requests: A list of request objects. Each request object can contain any valid batchUpdate operation. Common operations include: - addSheet: Add a new sheet - updateSheetProperties: Update sheet properties (title, grid properties, etc.) - insertDimension: Insert rows or columns - deleteDimension: Delete rows or columns - updateCells: Update cell values and formatting - updateBorders: Update cell borders - addConditionalFormatRule: Add conditional formatting - deleteConditionalFormatRule: Remove conditional formatting - updateDimensionProperties: Update row/column properties - and many more...
Example requests:
[
{
"addSheet": {
"properties": {
"title": "New Sheet"
}
}
},
{
"updateSheetProperties": {
"properties": {
"sheetId": 0,
"title": "Renamed Sheet"
},
"fields": "title"
}
},
{
"insertDimension": {
"range": {
"sheetId": 0,
"dimension": "ROWS",
"startIndex": 1,
"endIndex": 3
}
}
}
]Returns: Result of the batch update operation, including replies for each request
Inputs: spreadsheet_id (required), requests (required). Returns: result
batch_update_cellsADestructive
Batch update multiple ranges in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet ranges: Dictionary mapping range strings to 2D arrays of values e.g., {'A1:B2': [[1, 2], [3, 4]], 'D1:E2': [['a', 'b'], ['c', 'd']]}
Returns: Result of the batch update operation
Inputs: spreadsheet_id (required), sheet (required), ranges (required). Returns: result
clear_rangeADestructive
Clear data from a range of cells. Optionally clear formatting too.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'A1:C10') clear_format: If True, also clears formatting. If False (default), only clears values.
Returns: Result of the clear operation
Inputs: spreadsheet_id (required), sheet (required), range (required), clear_format. Returns: result
copy_sheetBDestructive
Copy a sheet from one spreadsheet to another.
Args: src_spreadsheet: Source spreadsheet ID src_sheet: Source sheet name dst_spreadsheet: Destination spreadsheet ID dst_sheet: Destination sheet name
Returns: Result of the operation
Inputs: src_spreadsheet (required), src_sheet (required), dst_spreadsheet (required), dst_sheet (required). Returns: result
create_sheetADestructive
Create a new sheet tab in an existing Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet title: The title for the new sheet
Returns: Information about the newly created sheet
Inputs: spreadsheet_id (required), title (required). Returns: result
create_spreadsheetADestructive
Create a new Google Spreadsheet.
Args: title: The title of the new spreadsheet folder_id: Optional Google Drive folder ID where the spreadsheet should be created. If not provided, uses the configured default folder or creates in root.
Returns: Information about the newly created spreadsheet including its ID
Inputs: title (required), folder_id. Returns: result
delete_rows_columnsADestructive
Delete rows or columns from a sheet.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name dimension: 'ROWS' or 'COLUMNS' start_index: 0-based start index (inclusive) end_index: 0-based end index (exclusive)
Returns: Result of the delete operation
Inputs: spreadsheet_id (required), sheet (required), dimension (required), start_index (required), +1 more. Returns: result
duplicate_sheetADestructive
Duplicate a sheet/tab within the same spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Name of the sheet to duplicate new_name: Name for the duplicated sheet (defaults to 'Copy of ')
Returns: The new sheet's properties
Inputs: spreadsheet_id (required), sheet (required), new_name. Returns: result
export_sheetARead-only
Export (download) a Google Spreadsheet as Excel, CSV, or PDF.
Args: spreadsheet_id: The ID of the spreadsheet format: Export format — 'xlsx', 'csv', 'pdf', or 'ods' output_path: Local file path to save to. Auto-generated if omitted.
Returns: The local file path where the file was saved
Inputs: spreadsheet_id (required), format, output_path. Returns: result
find_in_spreadsheetARead-only
Find cells containing a specific value in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) query: The text to search for in cell values sheet: Optional sheet name to search in. If not provided, searches all sheets. case_sensitive: Whether the search should be case-sensitive (default False) max_results: Maximum number of results to return (default 50)
Returns: List of found cells with their location (sheet, cell in A1 notation) and value
Inputs: spreadsheet_id (required), query (required), sheet, case_sensitive, +1 more. Returns: result
format_cellsADestructive
Apply formatting to a range of cells.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'A1:C10') bold: Make text bold italic: Make text italic font_size: Font size in pt font_color: Hex color for text (e.g., '#FF0000') background_color: Hex color for cell background (e.g., '#FFFF00') number_format: Number format pattern (e.g., '#,##0.00', '0%', 'yyyy-mm-dd') horizontal_alignment: 'LEFT', 'CENTER', or 'RIGHT'
Returns: Result of the formatting operation
Inputs: spreadsheet_id (required), sheet (required), range (required), bold, +6 more. Returns: result
get_commentsARead-only
Get all comments on a spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet include_resolved: Whether to include resolved comments (default False) max_results: Maximum number of comments to return (default 50)
Returns: List of comments with author, content, anchor cell, and resolved status
Inputs: spreadsheet_id (required), include_resolved, max_results. Returns: result
get_multiple_sheet_dataARead-only
Get data from multiple specific ranges in Google Spreadsheets.
Args: queries: A list of dictionaries, each specifying a query. Each dictionary should have 'spreadsheet_id', 'sheet', and 'range' keys. Example: [{'spreadsheet_id': 'abc', 'sheet': 'Sheet1', 'range': 'A1:B5'}, {'spreadsheet_id': 'xyz', 'sheet': 'Data', 'range': 'C1:C10'}]
Returns: A list of dictionaries, each containing the original query parameters and the fetched 'data' or an 'error'.
Inputs: queries (required). Returns: result
get_multiple_spreadsheet_summaryARead-only
Get a summary of multiple Google Spreadsheets, including sheet names, headers, and the first few rows of data for each sheet.
Args: spreadsheet_ids: A list of spreadsheet IDs to summarize. rows_to_fetch: The number of rows (including header) to fetch for the summary (default: 5).
Returns: A list of dictionaries, each representing a spreadsheet summary. Includes spreadsheet title, sheet summaries (title, headers, first rows), or an error.
Inputs: spreadsheet_ids (required), rows_to_fetch. Returns: result
get_revision_historyARead-only
Get the revision (edit) history of a spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet max_results: Maximum number of revisions to return (default 20)
Returns: List of revisions with author, date, and modification details
Inputs: spreadsheet_id (required), max_results. Returns: result
get_sheet_dataARead-only
Get data from a specific sheet in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet range: Optional cell range in A1 notation (e.g., 'A1:C10'). If not provided, gets all data. include_grid_data: If True, includes cell formatting and other metadata in the response. Note: Setting this to True will significantly increase the response size and token usage when parsing the response, as it includes detailed cell formatting information. Default is False (returns values only, more efficient).
Returns: Grid data structure with either full metadata or just values from Google Sheets API, depending on include_grid_data parameter
Inputs: spreadsheet_id (required), sheet (required), range, include_grid_data. Returns: result
get_sheet_formulasARead-only
Get formulas from a specific sheet in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet range: Optional cell range in A1 notation (e.g., 'A1:C10'). If not provided, gets all formulas from the sheet.
Returns: A 2D array of the sheet formulas.
Inputs: spreadsheet_id (required), sheet (required), range. Returns: result
list_foldersARead-only
List all folders in the specified Google Drive folder. If no parent folder is specified, lists folders from 'My Drive' root.
Args: parent_folder_id: Optional Google Drive folder ID to search within. If not provided, searches the root of 'My Drive'.
Returns: List of folders with their ID, name, and parent information
Inputs: parent_folder_id. Returns: result
list_sheetsARead-only
List all sheets in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL)
Returns: List of sheet names
Inputs: spreadsheet_id (required). Returns: result
list_spreadsheetsARead-only
List all spreadsheets in the specified Google Drive folder. If no folder is specified, uses the configured default folder or lists from 'My Drive'.
Args: folder_id: Optional Google Drive folder ID to search in. If not provided, uses the configured default folder or searches 'My Drive'.
Returns: List of spreadsheets with their ID and title
Inputs: folder_id. Returns: result
merge_cellsADestructive
Merge (or unmerge) cells in a range.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range (e.g., 'A1:C3') merge_type: 'MERGE_ALL', 'MERGE_COLUMNS', 'MERGE_ROWS', or 'UNMERGE'
Returns: Result of the merge operation
Inputs: spreadsheet_id (required), sheet (required), range (required), merge_type. Returns: result
move_sheetADestructive
Move a sheet/tab to a different position (reorder tabs).
Args: spreadsheet_id: The ID of the spreadsheet sheet: Name of the sheet to move index: New 0-based position index
Returns: Result of the move operation
Inputs: spreadsheet_id (required), sheet (required), index (required). Returns: result
protect_rangeBDestructive
Protect a range or entire sheet from editing.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range to protect. Omit to protect the entire sheet. description: Description of the protection warning_only: If True, shows a warning but allows editing editors: List of email addresses allowed to edit
Returns: Result of the protection operation
Inputs: spreadsheet_id (required), sheet (required), range, description, +2 more. Returns: result
rename_sheetCDestructive
Rename a sheet in a Google Spreadsheet.
Args: spreadsheet: Spreadsheet ID sheet: Current sheet name new_name: New sheet name
Returns: Result of the operation
Inputs: spreadsheet (required), sheet (required), new_name (required). Returns: result
resolve_commentBDestructive
Resolve a comment, optionally adding a reply before resolving.
Args: spreadsheet_id: The ID of the spreadsheet comment_id: The comment ID (from get_comments) reply_content: Optional reply to add before resolving
Returns: Result of the resolve operation
Inputs: spreadsheet_id (required), comment_id (required), reply_content. Returns: result
search_spreadsheetsARead-only
Search for spreadsheets in Google Drive by name or content.
Args: query: Search query string. Searches in file name and content. Examples: "budget 2024", "sales report", "project tracker" max_results: Maximum number of results to return (default 20, max 100)
Returns: List of matching spreadsheets with their ID, name, and metadata
Inputs: query (required), max_results. Returns: result
set_tab_colorADestructive
Change the color of a sheet tab.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name color: Hex color (e.g., '#FF0000' for red, '#00FF00' for green). Use '#FFFFFF' or 'none' to remove color.
Returns: Result of the color change operation
Inputs: spreadsheet_id (required), sheet (required), color (required). Returns: result
sort_rangeADestructive
Sort a range of cells by a column.
Args: spreadsheet_id: The ID of the spreadsheet sheet: Sheet/tab name range: A1 notation range to sort (e.g., 'A1:D100') sort_column: Column letter to sort by (e.g., 'B') order: 'ASCENDING' or 'DESCENDING'
Returns: Result of the sort operation
Inputs: spreadsheet_id (required), sheet (required), range (required), sort_column (required), +1 more. Returns: result
update_cellsBDestructive
Update cells in a Google Spreadsheet.
Args: spreadsheet_id: The ID of the spreadsheet (found in the URL) sheet: The name of the sheet range: Cell range in A1 notation (e.g., 'A1:C10') data: 2D array of values to update
Returns: Result of the update operation
Inputs: spreadsheet_id (required), sheet (required), range (required), data (required). Returns: result
upload_excelADestructive
Upload an Excel (.xlsx/.xls) or CSV file and convert it to a Google Spreadsheet.
Args: file_path: Local file path to the Excel or CSV file title: Optional title for the new spreadsheet (defaults to the filename) folder_id: Optional Google Drive folder ID to place the file in
Returns: The created spreadsheet's ID, title, and URL
Inputs: file_path (required), title, folder_id. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 40 tools
Most tools have distinct purposes, but some overlap exists between append_rows and add_rows, and between multiple data retrieval functions like get_sheet_data, get_multiple_sheet_data, and get_sheet_formulas. The batch_update tool is a catch-all that could duplicate many operations, causing potential confusion.
All tool names follow a consistent snake_case pattern with a verb_noun structure (e.g., add_chart, list_sheets, update_cells). The naming is predictable and easy to understand, with no mixing of conventions.
With 40 tools, this server is significantly over-scoped for typical usage. Many tools are highly specialized (e.g., set_tab_color, merge_cells, protect_range) and could be combined or offered via the batch_update tool, making the surface area overwhelming.
The tool set is extremely comprehensive, covering nearly all common Google Sheets operations including charts, pivot tables, comments, sharing, and import/export. Minor gaps like lack of explicit conditional format deletion or multi-column sorting exist but can be addressed via batch_update.
Maintenance
Related MCP Connectors
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables interaction with Google Sheets through natural language, allowing users to create, read, update, and manage spreadsheet data via the Google Sheets API v4.-
- AlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that lets AI agents read and write Google Sheets using the Google Sheets API v4.MIT
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI assistants to interact with Google Docs, Sheets, and Drive using the user's own Google account.-
- AlicenseNot gradedqualityDmaintenanceMCP server enabling AI agents to read, write, and manage Google Sheets, including sheet manipulation, row/column operations, dropdowns, checkboxes, and conditional formatting.11 npmMIT