# Google Sheets MCP

> Google Sheets (OAuth) lets your agent read, write, create, and manage any spreadsheet data directly from natural language conversation. You can pull data from multiple ranges across different tabs in one go, append new records without deleting old ones, or even audit the sheet's metadata—all without opening Google Drive. It gives you full control over complex, multi-tab datasets.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** spreadsheet, oauth2, batch-processing, data-manipulation, real-time-sync, api-integration

## Description

Managing spreadsheets usually means clicking through dozens of tabs and copy-pasting data sets until you find what you need. This MCP changes that. You connect your Google Sheets account via OAuth2 to any agent and treat the entire spreadsheet as a single database. Need to pull sales figures from 'Q1' and compare them against inventory levels in 'Stock'? Your agent handles it, pulling both datasets simultaneously so you can analyze complex dependencies right away. Want to log ten new records at once? You just tell your agent what needs appending; it adds the data cleanly to the bottom of the table without messing up anything already there. If you're working with Vinkius, this MCP gives your client immediate access to all that sheet power, making data manipulation a simple conversation.

Beyond reading and writing, you can command it to create brand-new spreadsheets for specific projects or simply audit the file—checking its timezone, locale, or listing every sheet tab inside. It handles everything from basic data entry to complex batch processing with precision.

## Tools

### sheets.info
Retrieves metadata about the entire spreadsheet, including its title, timezone, and all sheet tabs present.

### sheets.read
Pulls cell values from a single, defined range using A1 notation (e.g., Sheet1!A1:D10).

### sheets.batch_read
Reads content from multiple, separate ranges across different sheets in one efficient call.

### sheets.write
Updates existing data in a specified sheet range, replacing the old content with new values.

### sheets.append
Adds new rows of data to the bottom of a sheet table without deleting any existing information.

### sheets.clear
Removes all values within a specified range, keeping the formatting and formulas structure untouched.

### sheets.create
Generates a brand-new Google Sheets file instantly with just a title you provide.

## Prompt Examples

**Prompt:** 
```
Create a new spreadsheet titled 'Sales Forecast Q2'
```

**Response:** 
```
Spreadsheet created! I've successfully initialized 'Sales Forecast Q2' in your Google Drive. The spreadsheet ID is 'spreadsheet_abc123'. Would you like me to add headers to the first sheet?
```

**Prompt:** 
```
Write these values to 'Sheet1!A1': [['Date', 'Amount'], ['2026-03-30', 500]]
```

**Response:** 
```
Data written! I've successfully populated Sheet1!A1:B2 with your provided values. The spreadsheet is now updated with the correct date and amount information.
```

**Prompt:** 
```
Get info for spreadsheet 'abc-123'
```

**Response:** 
```
Retrieving spreadsheet info... Title: 'Budget 2026'. Sheets: 'Jan-March', 'April-June'. Locale: en_US. Timezone: UTC. I can also retrieve the grid properties or specific range data for you.
```

## Capabilities

### Create new spreadsheets
Starts a blank Google Sheets document instantly using only a title.

### Read specific cell values
Pulls data from precise ranges across the sheet, allowing you to focus on exactly what you need.

### Batch read multiple sheets
Retrieves content from several different sections or tabs in one efficient request.

### Overwrite data ranges
Writes new values into a specific area of the sheet, replacing whatever was there before.

### Append new rows
Adds new rows to the bottom of existing data without deleting or overwriting anything above it.

### Clear cell contents
Wipes out values from a specified range while keeping all formatting and formulas intact.

### Audit sheet details
Gathers metadata like the title, timezone, and list of all tabs within the spreadsheet.

## Use Cases

### The Monthly Financial Reconciliation
A financial analyst needs to pull the current month's sales data (Sheet 1: A2:Z50) and compare it against last year’s budget figures (Sheet 3: B2:K40). Instead of running two separate API calls, they tell their agent to `sheets.batch_read` both ranges simultaneously, getting a unified dataset for comparison.

### The Project Tracker Update
A product manager has 15 new project milestones and needs to log them into the master tracker. They instruct their agent to `sheets.append` these records; the MCP ensures they are added cleanly to the bottom of the 'Milestones' tab without disrupting existing data.

### The Clean-Up Job
An ops engineer needs to reset a reporting sheet before starting fresh, but must keep the formulas. They tell their agent to use `sheets.clear` on the main data block, which removes values while preserving all formatting and structure.

### The Audit Check
A team needs to know if the master spreadsheet is using the right time zone for reporting. They ask their agent to use `sheets.info` on the file ID, instantly confirming the locale and timezone without opening the file.

## Benefits

- Stop reading single ranges manually. Use `sheets.batch_read` to pull necessary data from multiple tabs or sections in one go, speeding up cross-sheet analysis dramatically.
- Need to log new records? Instead of risking overwriting old data with `sheets.write`, use `sheets.append` to safely add rows to the bottom of your table every time.
- Start a fresh project instantly. Use `sheets.create` when you need a clean slate, giving you a brand-new spreadsheet ID and edit link immediately.
- Before running any big update, check the file's health using `sheets.info`. This lets you audit critical metadata like timezones or sheet tabs without opening anything.
- Accidentally wrote over data? Use `sheets.clear` to zero out values in a specific area without touching the underlying formulas or formatting.

## How It Works

The bottom line is that you manage complex spreadsheet operations simply by talking to it, without ever touching the Google Sheets UI.

1. First, subscribe to this MCP and provide your Google OAuth2 Access Token.
2. Next, tell your agent exactly what you need—for example, 'Read the sales totals from Sheet 1' or 'Append these new user records.'
3. Your client executes the command directly against your sheets data and returns the structured result to you.

## Frequently Asked Questions

**How does sheets.batch_read work for multiple tabs?**
sheets.batch_read lets you list several ranges separated by commas (e.g., 'Sheet1!A1:B10, Sheet2!C1:D10'). It pulls all the data from those distinct locations in one single API call.

**Should I use sheets.write or sheets.append?**
Use `sheets.write` when you need to completely overwrite a specific area of existing data. Use `sheets.append` only when you are adding new records and want to guarantee they go at the end.

**What if I need to know what sheets exist in my workbook?**
You use `sheets.info`. This command fetches metadata for the entire file, giving you a full list of all sheet tabs and their dimensions so you know exactly what's inside.

**Can I create new sheets using sheets.create?**
Yes. You just tell your agent the desired title for the new spreadsheet, and it generates the file ID and a direct link for you to use immediately.

**How do I use sheets.write to update a specific cell range without affecting other data?**
sheets.write overwrites existing values in a defined A1 range. You must provide the exact coordinates (e.g., 'Sheet1!B5:C7') and the new data array. Always confirm with your user before running this, as it deletes whatever content was previously there.

**If I only need to read a small section of a sheet, should I use sheets.read or sheets.batch_read?**
Use sheets.read for single ranges and specific coordinates; it's simpler than batch reading. Specify the range using standard A1 notation (e.g., 'SheetName!A1:B5'). If you need data from multiple, non-contiguous areas, then sheets.batch_read is better.

**What are the safety precautions before running sheets.clear?**
sheets.clear removes cell contents but preserves formatting and formulas. Because this action is irreversible, you must confirm with your user first. You can target a specific range or clear an entire sheet by providing just the sheet name.

**What kind of general metadata can I pull using sheets.info?**
sheets.info pulls core spreadsheet details, including the title, locale, and timezone. It's useful for auditing or setting up context before manipulating data. You pass either a full URL or just the ID to get this system information.

**How do I get a Google OAuth2 access token for this server?**
You can use the Google OAuth Playground (select Sheets API v4 and authorize) or run 'gcloud auth print-access-token' in your terminal. Note that these tokens are typically valid for 1 hour.

**Can my agent create a new spreadsheet and add data to it in one go?**
Yes. The agent can orchestrate multiple operations. First, use 'create_spreadsheet' to get the new ID, and then use 'write_data' or 'append_data' to populate it with your JSON arrays natively.

**What is the benefit of batch reading through the agent?**
Batch reading allowing your agent to retrieve data from multiple non-contiguous ranges (e.g., 'Sheet1!A1:B10' and 'Sheet2!C5:D15') in a single request, improving context efficiency and reasoning accuracy flawlessly.