Google Sheets MCP Server
The Google Sheets MCP Server enables AI agents to interact with Google Sheets (and Google Docs) programmatically through a local Model Context Protocol server. It integrates with AI coding tools like Cursor, VS Code, and Claude Code.
Google Sheets capabilities:
List sheet tabs (
sheets_list_tabs): Discover all tabs in a connected spreadsheet.Read data (
sheets_read_range): Read from any range using A1 notation (e.g.,Users!A1:Z500); returns structured objects or raw 2D arrays, with control over value rendering (formatted, unformatted, or formula).Get metadata (
sheets_get_sheet): Retrieve spreadsheet title, URL, locale, and tab details (row/column counts).Write data (
sheets_write_range): Write a 2D array of values to a specified range for bulk inserts or updates.Create a tab (
sheets_create_tab): Add a new sheet tab to an existing spreadsheet.Append a row (
sheets_append_row): Append a JSON object as a new row, auto-aligning values with existing column headers.
Google Docs capabilities:
List, create, read, and get metadata for Google Docs.
Write or append text to a document.
Find and replace text within a document.
Key traits:
Runs entirely locally β API calls go directly from your machine to Google, with no third-party intermediaries.
Supports both Service Account (for teams/automation) and OAuth2 (for personal use) authentication.
Easy setup via
npx google-mcp initwizard.
Allows AI agents to read, write, and query Google Sheets as a database, including listing sheets, reading ranges, writing data, creating tabs, and appending rows.
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., "@Google Sheets MCP Server Show me the first 10 rows from the Sales sheet."
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.
Google MCP Server
Connect Google Sheets & Docs to Cursor, VS Code, Claude Code and AI agents β in 3 minutes.
Your spreadsheets and documents become data sources that AI agents can read, write, and query.
π― What is this?
A Model Context Protocol (MCP) server that lets AI coding agents (Cursor, Copilot, Claude, Codex) interact with Google Sheets and Google Docs.
Once configured, you can tell your AI agent:
π Sheets:
"Read all users from the Users sheet"
"Add a new order row: name=Anton, total=150"
"Update the status column for row 23"
"List all sheets in my spreadsheet"π Docs:
"Create a new document titled 'Sprint Report'"
"Read the content of my meeting notes"
"Append a summary paragraph to the project doc"
"Find and replace all 'TODO' with 'DONE'"
"List all my Google Docs"Related MCP server: MCP Google Sheets Server
β‘ Quick Start
π·πΊ ΠΠ½ΡΡΡΡΠΊΡΠΈΡ Π½Π° ΡΡΡΡΠΊΠΎΠΌ: docs/quickstart-ru.md β ΠΏΠΎΡΠ°Π³ΠΎΠ²ΠΎ Π΄Π»Ρ Π½ΠΎΠ²ΠΈΡΠΊΠΎΠ².
Pick the auth method that fits your use case:
Service Account (recommended for team/automation)
npx google-mcp initYou'll need:
Google Sheet URL β paste your sheet link
Service Account JSON key β download from Google Cloud Console
Personal Account via OAuth2 (for personal sheets/docs)
Use when you want the AI to act on your behalf β access your private sheets and docs without sharing them with a service account.
npx google-mcp init --auth oauthYou'll go through a browser-based OAuth2 flow. A refresh token is saved and auto-refreshed β you never need to re-login.
π When to use OAuth2 β β detailed guide and scenarios.
2. Connect your IDE
The init wizard will generate IDE configs for you automatically β just pick Project or System-wide when asked.
If you prefer manual setup, add to your IDE config:
{
"mcpServers": {
"google-mcp": {
"command": "npx",
"args": ["google-mcp"]
}
}
}{
"servers": {
"google-mcp": {
"type": "stdio",
"command": "npx",
"args": ["google-mcp"]
}
}
}{
"mcpServers": {
"google-mcp": {
"command": "npx",
"args": ["google-mcp"]
}
}
}{
"mcpServers": {
"google-mcp": {
"command": "npx",
"args": ["-y", "google-mcp"]
}
}
}More configs: examples/ β Cursor, VS Code, Claude, Codex.
3. Restart your IDE
That's it. Your AI agent now has access to your Google Sheets and Docs.
π CLI Commands
Command | Description |
| Interactive setup wizard (service account) |
| Setup with personal Google account (OAuth2) |
| Test connection + list sheets |
| Check OAuth2 refresh token health |
| List all sheets in the spreadsheet |
| Read data from a sheet |
| Create a new sheet tab |
| Append a row |
| Show current configuration |
| List Google Docs in your Drive |
| Read a Google Doc by ID |
| Create a new Google Doc |
π‘ Backward compatible:
npx google-sheet-mcpstill works as an alias fornpx google-mcp.
π§ MCP Tools (for AI Agents)
Once connected, AI agents get these tools:
π Sheets
Tool | What it does |
| List all sheet tabs with row/column counts |
| Read data from a range (returns objects with header keys) |
| Get spreadsheet metadata (title, URL, locale) |
| Write a 2D array of values to a range |
| Create a new sheet tab |
| Append a row (auto-aligns with headers) |
π Docs
Tool | What it does |
| Create a new Google Doc |
| Read document content (plain text or structured) |
| Get document metadata (title, URL, revision, length) |
| Write/append text to a document |
| Find and replace text in a document |
| List Google Docs in your Drive |
π Prerequisites
Google Cloud Setup (3 min)
Go to Google Cloud Console
Create a project (or use existing)
Enable Sheets API: APIs & Services β Library β "Google Sheets API" β Enable
Create Service Account: APIs & Services β Credentials β Create Credentials β Service Account
Give it a name β Create β Done
Click the service account β Keys β Add Key β Create New Key β JSON β Download
Share your sheet: Open your Google Sheet β Share β add the service account email (from the JSON) as Editor
π Detailed guide with screenshots: docs/setup-google.md
OAuth2 Setup (for personal Google accounts)
When to use OAuth2 instead of Service Account:
You want AI to access your personal sheets that you don't want to share with a service account
You're the only user and don't want to create a service account
Your sheets contain sensitive data that shouldn't be accessible via a shared key
Setup:
npx google-sheet-mcp init --auth oauthThe wizard will:
Ask for your OAuth2 Client ID and Client Secret (from Google Cloud Console)
Open a browser for you to grant access
Capture the authorization code automatically
Exchange it for a refresh token (stored locally)
How refresh tokens work:
The refresh token is stored in
.google-sheet-mcp.jsonAccess tokens are auto-refreshed by googleapis β you never need to re-login
If a token becomes invalid, just run
npx google-sheet-mcp init --auth oauthto replace it
Check token health:
npx google-sheet-mcp token-statusπ Key benefit: The AI agent acts as you β it accesses exactly the sheets you have access to. No need to share sheets with a service account email.
π Detailed guide: docs/setup-oauth2.md
π Configuration
Config is stored in .google-sheet-mcp.json (in your project or home directory):
{
"spreadsheetId": "1ABC...xyz",
"credentialsPath": "./credentials.json",
"sheets": ["Users", "Orders", "Payments"]
}Or use environment variables:
export GOOGLE_SPREADSHEET_ID="1ABC...xyz"
export GOOGLE_APPLICATION_CREDENTIALS="./credentials.json"π Architecture
google-sheet-mcp/
βββ src/
β βββ cli/ # CLI commands (init, test, list, read, append)
β βββ server/ # MCP stdio server + Google Sheets client
β βββ config/ # Config loader (.google-sheet-mcp.json + env)
βββ examples/ # MCP configs for Cursor, VS Code, Claude, Codex
βββ docs/ # Setup guides
βββ README.md
βββ package.jsonβ FAQ
Do I need to clone this repo?
No. Just use npx google-sheet-mcp init. No installation required.
What permissions does the service account need?
Only "Editor" on the specific spreadsheet. Not on your entire Google Drive.
Can I connect multiple sheets?
Yes. Use different config files per project, or set env vars per spreadsheet.
Does it work with private sheets?
Yes. Share the sheet with the service account email (found in the JSON key).
Is my data sent to a third party?
No. The MCP server runs locally on your machine. Google Sheets API calls go directly from your machine to Google. No intermediate servers.
π License
MIT
Available Tools
6 toolssheets_append_rowA
Append a row to a sheet. The row is a JSON object with column names as keys. The tool automatically reads the header row to align columns. Example: {"name": "Anton", "email": "anton@example.com"}
Inputs: row (required), sheet (required), spreadsheet.
sheets_create_tabB
Create a new sheet tab in the spreadsheet.
Inputs: sheetName (required), spreadsheet.
sheets_get_sheetB
Get spreadsheet metadata: title, URL, locale, and all tabs with row/column counts.
Inputs: spreadsheet.
sheets_list_tabsA
List all sheet tabs in the connected Google Spreadsheet. Use this to discover available sheets before reading or writing data.
Inputs: spreadsheet.
sheets_read_rangeA
Read data from a Google Sheet range. Range format: 'SheetName!A1:Z100' or just 'SheetName' for the whole sheet. First row is treated as headers and data is returned as an array of objects.
Inputs: range (required), skip_header, spreadsheet, value_render.
sheets_write_rangeA
Write values to a Google Sheet range. Values should be a 2D array: each inner array is a row. Example: [['name','age'],['Anton','30']]
Inputs: range (required), values (required), spreadsheet.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 6 tools
Each tool targets a distinct operation: appending rows, creating tabs, getting metadata, listing tabs, reading ranges, and writing ranges. No two tools overlap in purpose.
All tools follow a consistent 'sheets_verb_noun' pattern (e.g., sheets_append_row, sheets_read_range), making it easy for agents to predict tool names.
With 6 tools, the set is well-scoped for a Google Sheets MCP server. It covers core operations without being bloated or overly minimal.
The tool surface covers basic CRUD for rows and tabs, and metadata retrieval, but lacks deletion operations (remove tab, delete row) and cell-level editing. Minor gaps for a typical spreadsheet workflow.
Maintenance
Related MCP Connectors
Connect AI assistants to Google Sheets through controlled tools for reading and updating rows.
Connect an AI assistant to your Google Sheets, Drive, Docs, PDFs, BigQuery and Gmail.
Teable is an AI spreadsheet for business that combines a familiar spreadsheet interface with a structured database. Its remote MCP server lets AI agents inspect project and table structure, read and update records, and access the Teable API through OAuth with existing project permissions. Website: [teable.ai](https://teable.ai)
AI access to Quadratic spreadsheets: open files, run Python/SQL, query connected databases.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables interaction with Google Spreadsheets through the Model Context Protocol. Supports reading, writing, appending rows, creating sheets, and retrieving spreadsheet information with Google Cloud service account authentication.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables reading, writing, and managing Google Sheets documents with support for batch operations, formatting, charts, and conditional formatting through the Model Context Protocol.MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to access, search, and analyze Google Spreadsheets through the Model Context Protocol. Supports both OAuth 2.0 for private sheets and API key authentication for public sheets, with tools for listing, reading, and searching spreadsheet data.51MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact directly with Google Sheets to create, read, and edit spreadsheets through the Model Context Protocol. It supports a wide range of actions including cell manipulation, row and column management, and sheet organization.MIT