# mcp-gsheets

Connects Google Sheets API to your agent: read and write cells, format ranges, run batch operations.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 104
- Author: freema
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/freema/mcp-gsheets
- Updated: 2026-10-04
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-gsheets

## What it does

The server gives your agent direct access to Google Sheets. Read data from ranges, write values, apply formatting and conditional formatting, work with charts. Batch operations let you update hundreds of rows in one call.

Requires Node.js 22 or higher and a Google Cloud service account with Sheets API enabled. Three authentication methods are supported: JSON key file, full JSON string, or private key plus email pair. You need to share spreadsheets with the service account email and grant editor permissions — without this the server won't have access.

Built with TypeScript, includes error handling and test coverage.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `GOOGLE_PROJECT_ID`, `GOOGLE_APPLICATION_CREDENTIALS`, `GOOGLE_SERVICE_ACCOUNT_KEY`, `GOOGLE_PRIVATE_KEY`, `GOOGLE_CLIENT_EMAIL` — keys and tokens: ask the human for the values, never commit them or put them in shared files.
- Works with: Google Workspace

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env GOOGLE_PROJECT_ID=<GOOGLE_PROJECT_ID> --env GOOGLE_APPLICATION_CREDENTIALS=<GOOGLE_APPLICATION_CREDENTIALS> --env GOOGLE_SERVICE_ACCOUNT_KEY=<GOOGLE_SERVICE_ACCOUNT_KEY> --env GOOGLE_PRIVATE_KEY=<GOOGLE_PRIVATE_KEY> --env GOOGLE_CLIENT_EMAIL=<GOOGLE_CLIENT_EMAIL> --transport stdio mcp-gsheets -- npx -y mcp-gsheets
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add mcp-gsheets --env GOOGLE_PROJECT_ID=<GOOGLE_PROJECT_ID> --env GOOGLE_APPLICATION_CREDENTIALS=<GOOGLE_APPLICATION_CREDENTIALS> --env GOOGLE_SERVICE_ACCOUNT_KEY=<GOOGLE_SERVICE_ACCOUNT_KEY> --env GOOGLE_PRIVATE_KEY=<GOOGLE_PRIVATE_KEY> --env GOOGLE_CLIENT_EMAIL=<GOOGLE_CLIENT_EMAIL> -- npx -y mcp-gsheets
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-gsheets": {
            "command": "npx",
            "args": [
                "-y",
                "mcp-gsheets"
            ],
            "env": {
                "GOOGLE_PROJECT_ID": "<GOOGLE_PROJECT_ID>",
                "GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>",
                "GOOGLE_SERVICE_ACCOUNT_KEY": "<GOOGLE_SERVICE_ACCOUNT_KEY>",
                "GOOGLE_PRIVATE_KEY": "<GOOGLE_PRIVATE_KEY>",
                "GOOGLE_CLIENT_EMAIL": "<GOOGLE_CLIENT_EMAIL>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-gsheets": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "mcp-gsheets"
            ],
            "env": {
                "GOOGLE_PROJECT_ID": "<GOOGLE_PROJECT_ID>",
                "GOOGLE_APPLICATION_CREDENTIALS": "<GOOGLE_APPLICATION_CREDENTIALS>",
                "GOOGLE_SERVICE_ACCOUNT_KEY": "<GOOGLE_SERVICE_ACCOUNT_KEY>",
                "GOOGLE_PRIVATE_KEY": "<GOOGLE_PRIVATE_KEY>",
                "GOOGLE_CLIENT_EMAIL": "<GOOGLE_CLIENT_EMAIL>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e GOOGLE_PROJECT_ID=<GOOGLE_PROJECT_ID> -e GOOGLE_APPLICATION_CREDENTIALS=<GOOGLE_APPLICATION_CREDENTIALS> -e GOOGLE_SERVICE_ACCOUNT_KEY=<GOOGLE_SERVICE_ACCOUNT_KEY> -e GOOGLE_PRIVATE_KEY=<GOOGLE_PRIVATE_KEY> -e GOOGLE_CLIENT_EMAIL=<GOOGLE_CLIENT_EMAIL> mcp-gsheets npx -y mcp-gsheets
```
Replace <…> with your own values

## When to use it
- Read data from cell ranges
- Write and update values in batch
- Apply formatting and conditional rules
- Create charts in spreadsheets
- Fetch sheet and workbook metadata

## Example prompts
- Read range A1:D50 from spreadsheet with ID 1a2b3c4d5e
- Write these rows to the Sales sheet starting at cell B2
- Format column C as currency with two decimal places

## Similar
- [Excel MCP Server](https://affpapa.org/en/nevibecode/mcp/excel-mcp-server.md) — MCP server · ★ 4259
- [kordoc](https://affpapa.org/en/nevibecode/mcp/kordoc.md) — MCP server · ★ 2726
- [Power BI Authoring MCP Server (Local)](https://affpapa.org/en/nevibecode/mcp/power-bi-authoring-mcp-server-local.md) — MCP server · ★ 1247
- [Microsoft 365 MCP Server](https://affpapa.org/en/nevibecode/mcp/microsoft-365-mcp-server.md) — MCP server · ★ 1074
- [anymd](https://affpapa.org/en/nevibecode/mcp/anymd.md) — MCP server · ★ 1051
- [Docling MCP](https://affpapa.org/en/nevibecode/mcp/docling-mcp.md) — MCP server · ★ 777

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
