Skip to main content
Glama
we2go

Google Sheets MCP Server

by we2go

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:

npx google-mcp init

You'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 oauth

You'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

npx google-mcp init

Interactive setup wizard (service account)

npx google-mcp init --auth oauth

Setup with personal Google account (OAuth2)

npx google-mcp test

Test connection + list sheets

npx google-mcp token-status

Check OAuth2 refresh token health

npx google-mcp list

List all sheets in the spreadsheet

npx google-mcp read -s <name>

Read data from a sheet

npx google-mcp create -s <name>

Create a new sheet tab

npx google-mcp append -s <name> -d '{"col":"val"}'

Append a row

npx google-mcp config

Show current configuration

npx google-mcp docs-list

List Google Docs in your Drive

npx google-mcp docs-read -d <id>

Read a Google Doc by ID

npx google-mcp docs-create -t <title>

Create a new Google Doc

πŸ’‘ Backward compatible: npx google-sheet-mcp still works as an alias for npx google-mcp.

🧠 MCP Tools (for AI Agents)

Once connected, AI agents get these tools:

πŸ“Š Sheets

Tool

What it does

sheets_list_tabs

List all sheet tabs with row/column counts

sheets_read_range

Read data from a range (returns objects with header keys)

sheets_get_sheet

Get spreadsheet metadata (title, URL, locale)

sheets_write_range

Write a 2D array of values to a range

sheets_create_tab

Create a new sheet tab

sheets_append_row

Append a row (auto-aligns with headers)

πŸ“„ Docs

Tool

What it does

docs_create

Create a new Google Doc

docs_read

Read document content (plain text or structured)

docs_get

Get document metadata (title, URL, revision, length)

docs_write

Write/append text to a document

docs_replace

Find and replace text in a document

docs_list

List Google Docs in your Drive

πŸ” Prerequisites

Google Cloud Setup (3 min)

  1. Go to Google Cloud Console

  2. Create a project (or use existing)

  3. Enable Sheets API: APIs & Services β†’ Library β†’ "Google Sheets API" β†’ Enable

  4. Create Service Account: APIs & Services β†’ Credentials β†’ Create Credentials β†’ Service Account

  5. Give it a name β†’ Create β†’ Done

  6. Click the service account β†’ Keys β†’ Add Key β†’ Create New Key β†’ JSON β†’ Download

  7. 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 oauth

The wizard will:

  1. Ask for your OAuth2 Client ID and Client Secret (from Google Cloud Console)

  2. Open a browser for you to grant access

  3. Capture the authorization code automatically

  4. Exchange it for a refresh token (stored locally)

How refresh tokens work:

  • The refresh token is stored in .google-sheet-mcp.json

  • Access 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 oauth to 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 tools
sheets_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"}

ParametersJSON Schema
NameRequiredDescriptionDefault
rowYesRow data as JSON object. Keys = column headers, values = cell values.
sheetYesSheet name (tab name).
spreadsheetNoOptional spreadsheet ID.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It discloses the key behavioral trait: automatic header row reading and column alignment. However, it does not mention side effects, permissions, or error scenarios, which would make it a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences plus an example. Every word adds value. Front-loaded with the core action. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and absence of output schema, the description is mostly complete. It explains the core functionality and parameter semantics. It lacks potential error handling info but is sufficient for typical use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds value by providing an example and explaining the row parameter mapping (keys as column headers). It also clarifies the sheet parameter as 'tab name'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Append' and the resource 'a row to a sheet'. It explains the alignment via header row, which distinguishes it from siblings like write_range. The example further clarifies the purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies use when adding a new row but lacks explicit when-not or comparison to alternatives like sheets_write_range. No direct guidance on when to choose this tool over siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_create_tabB

Create a new sheet tab in the spreadsheet.

ParametersJSON Schema
NameRequiredDescriptionDefault
sheetNameYesName of the new sheet tab.
spreadsheetNoOptional spreadsheet ID.

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description should disclose side effects, prerequisites, and error conditions but only states the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single clear sentence, but could benefit from additional structure (e.g., specifying required vs optional parameters).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lacks details on tab name uniqueness, spreadsheet requirement, and output; for a simple creation tool, more context is expected.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema covers both parameters with descriptions, and the tool description adds no extra semantic value beyond what the schema provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Create'), resource ('sheet tab'), and scope ('in the spreadsheet'), which distinguishes it from sibling tools like sheets_append_row or sheets_read_range.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, such as when to specify the spreadsheet parameter or what happens if the tab name exists.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_get_sheetB

Get spreadsheet metadata: title, URL, locale, and all tabs with row/column counts.

ParametersJSON Schema
NameRequiredDescriptionDefault
spreadsheetNoOptional spreadsheet ID.

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description does not disclose behavioral traits like read-only nature, permissions, or limits. Only states what is retrieved.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single efficient sentence with no wasted words. Front-loaded with verb and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Lists key metadata items. Without output schema, description is sufficient for agent to understand returns. Could mention if all sheets or active sheet, but 'all tabs' is clear.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with parameter description 'Optional spreadsheet ID.' Description adds no additional meaning beyond schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states verb 'get' and resource 'spreadsheet metadata', listing specific items (title, URL, locale, tabs with counts). Distinguishes from siblings which are data operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use versus alternatives. While siblings are different, description doesn't provide context or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

sheets_list_tabsA

List all sheet tabs in the connected Google Spreadsheet. Use this to discover available sheets before reading or writing data.

ParametersJSON Schema
NameRequiredDescriptionDefault
spreadsheetNoOptional spreadsheet ID. Uses the configured default if omitted.

TDQS

A4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, and description lacks details beyond purpose. Does not disclose permissions, return format, or behavior when spreadsheet is missing. Minimal transparency for a simple read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no unnecessary words, front-loaded with action and resource.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with 0 required params, the description is adequate. However, no mention of output format, which could help agents parse results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Only one parameter 'spreadsheet' with description in schema. Description adds value by noting 'Uses the configured default if omitted', which is not in schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'List all sheet tabs' with specific verb and resource, and distinguishes from siblings by mentioning discovery before reading/writing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Use this to discover available sheets before reading or writing data.' Provides clear context for when to use, though no explicit when-not-to or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
rangeYesRange in A1 notation. Examples: 'Users!A1:Z500', 'Orders'.
skip_headerNoIf true, returns raw 2D array instead of objects with header keys.
spreadsheetNoOptional spreadsheet ID.
value_renderNoHow to render values. FORMATTED_VALUE = as seen in UI, UNFORMATTED_VALUE = raw numbers, FORMULA = show formulas.FORMATTED_VALUE

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full behavioral burden. It discloses that the first row is treated as headers and data is returned as an array of objects. It omits details like error handling, access requirements, or rate limits, but covers key expected behavior for a read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the tool's purpose, and no unnecessary words. Every sentence provides essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description explains the return format. Parameters are well-documented in the schema. The description covers the core functionality, though it could mention potential errors or limits. Overall, fairly complete for a read tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by explaining the range format with examples and clarifying header treatment. It does not add significant semantics beyond the schema for other parameters, so a 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool reads data from a Google Sheet range, specifies the range format, and explains the return format (array of objects with headers). This contrasts with sibling write tools like sheets_append_row and sheets_write_range, making its purpose distinct.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives. It implies a read-only use case, but lacks 'when-not' guidance or reference to siblings for writes. The agent must infer usage from context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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']]

ParametersJSON Schema
NameRequiredDescriptionDefault
rangeYesRange to write, e.g., 'Users!A1'.
valuesYes2D array of values. First array = first row.
spreadsheetNoOptional spreadsheet ID.

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. While it indicates mutation ('write'), it doesn't disclose whether the operation overwrites data, affects formatting, or has side effects like sheet creation. Behavior such as error handling or size limits is omitted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences: the first states the purpose, and the second provides a concrete example. It is concise, front-loaded, and contains no extraneous information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has three parameters, no output schema, and no annotations, the description is adequate but incomplete. It covers the basic operation and value format but omits important context like range must exist, what happens on conflict, or success indication.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already describes all three parameters with 100% coverage. The description adds value by explaining the expected structure of 'values' as a 2D array with an example, which clarifies beyond the schema's generic description. It does not elaborate on the 'spreadsheet' parameter but the example aids understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Write values to a Google Sheet range,' specifying the verb and resource. It distinguishes from siblings like sheets_read_range and sheets_append_row by indicating a write operation, and provides an example format for the values.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide guidance on when to use this tool versus alternatives (e.g., when to use write vs append). It lacks prerequisites, such as requiring the sheet to exist, and does not mention when the optional spreadsheet ID is necessary.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 6 tool updatesv1.1.0
    • First observedsheets_append_row
    • First observedsheets_create_tab
    • First observedsheets_get_sheet
    • First observedsheets_list_tabs
    • First observedsheets_read_range
    • First observedsheets_write_range

TDQS

A3.9/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

With 6 tools, the set is well-scoped for a Google Sheets MCP server. It covers core operations without being bloated or overly minimal.

Completeness4/5

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

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/we2go/google-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server