# Connect Google Sheets to Claude Code

Claude Code can read a Google Sheet over MCP straight from your terminal. Register the endpoint once with the CLI and the agent can query your data while it works.

*Last updated: 2026-07-15 · Source: <https://pastesheet.com/guides/google-sheets-mcp-claude-code>*

## Key facts

- Claude Code registers remote MCP servers from the CLI — `claude mcp add --transport http <name> <url>` — and manages them with `claude mcp list` and `claude mcp remove`. ([source](https://support.claude.com/en/articles/10065433-installing-and-using-a-mcp-server))
- MCP is an **open protocol** built on JSON-RPC 2.0. A server exposes Resources, Prompts and Tools to any MCP client — Claude, Cursor, ChatGPT, VS Code and Windsurf all speak it. ([source](https://modelcontextprotocol.io/specification/2025-06-18))
- PasteSheet's MCP server exposes three tools — `list_tabs`, `get_schema` and `query_rows` — and is **read-only by design**: an agent can query your sheet but can never modify it.
- It needs **no Google Cloud project, no OAuth consent screen and no service-account JSON**. You paste a share URL, and MCP is included on the Free plan.

## How do you add Google Sheets to Claude Code?

Run `claude mcp add --transport http pastesheet <your-mcp-url>`. Claude Code registers HTTP MCP servers from the CLI, and PasteSheet turns any Google Sheet into one of those URLs, so your terminal agent can query the spreadsheet without a Google Cloud project or a local server.

Once it is registered, Claude Code can list the sheet's tabs, read its schema, and run filtered queries against it mid-task — useful when the data you need (fixtures, config, a content table) lives in a spreadsheet rather than the repo.

## Connect in three steps

From a connected endpoint to a querying agent:

1. In PasteSheet, open the endpoint's **Connect via MCP** panel and copy its MCP URL.
2. Register it with `claude mcp add --transport http pastesheet <your-mcp-url>` (add a `--header` for a private endpoint).
3. Run `claude`, confirm the server with `claude mcp list`, and ask a question about your sheet — the agent calls the read tools for you.

## Add the server with one command

Claude Code registers HTTP MCP servers from the CLI. Point it at your endpoint's MCP URL:

```bash
claude mcp add --transport http pastesheet \
  https://pastesheet.com/mcp/sheets/your-endpoint-id
```

## Private endpoints

For a private endpoint, pass a bearer header when you add the server:

```bash
claude mcp add --transport http pastesheet \
  https://pastesheet.com/mcp/sheets/your-endpoint-id \
  --header "Authorization: Bearer YOUR_KEY"
```

## Use it

Run `claude` and ask about your data — the agent calls `list_tabs`, `get_schema`, and `query_rows` as needed. Manage the connection later with `claude mcp list` and `claude mcp remove pastesheet`.

For the full picture of how the MCP connection works, see the [Google Sheets MCP overview](https://pastesheet.com/guides/google-sheets-mcp).

## What Claude Code can do with your sheet

With the endpoint registered, the agent can, mid-task:

- Read a specific tab or a filtered slice of rows without leaving the terminal.
- Check whether a metric crossed a threshold before it writes code or a report.
- Cross-reference fixtures, config, or a content table that lives in a sheet rather than the repo.
- Look up a single value — an ID, a price, a feature flag — on demand.

## No install, just a URL

Unlike managed connectors that make you `pip`-install a CLI, log into a broker, and authorize Google, PasteSheet is **one `claude mcp add` command against a URL**. There is no Google Cloud project, no OAuth consent screen, and no local server to keep running — and because the connection is read-only, the agent can query your sheet but never change it.

## Requirements

**MCP is included on the Free plan.** Connect any **public** endpoint over MCP with no Google Cloud project and no credit card. Private endpoints and the account-wide workspace server need a paid plan (from **Starter ($9/mo)**) for the keys and OAuth they authenticate with.

Pro adds full-text search and aggregation (`count`, `sum`, `avg`, `group_by`) that your AI agent can call through `query_rows`.

**Starter — $9/month.** For indie makers shipping a real app.

- Endpoints: 10
- Requests: 50,000 / month
- Rows per endpoint: 5,000
- Tabs per endpoint: 5
- Rate limit: 300 / minute

## Frequently asked questions

### How do I add a Google Sheet to Claude Code?

Run claude mcp add --transport http pastesheet . The agent then exposes the sheet's read tools automatically.

### How do I authenticate a private endpoint?

Pass --header "Authorization: Bearer YOUR_KEY" when running claude mcp add. Public endpoints need no header.

### How do I check the connection worked?

Run claude mcp list to see pastesheet registered, then ask Claude Code a question about your data. Remove it later with claude mcp remove pastesheet.

### Claude Code is not connecting to the server — what is wrong?

Make sure you passed --transport http and the full MCP URL, and that a private endpoint includes the Authorization: Bearer header. Open the endpoint's Connect via MCP panel in PasteSheet to copy the exact URL.

### Is it read-only, and does it work in the VS Code extension?

Yes to read-only — the agent can query but never edit the sheet. The same MCP URL works anywhere Claude Code runs, including the VS Code and JetBrains extensions.

## Sources

- [Installing and using an MCP server](https://support.claude.com/en/articles/10065433-installing-and-using-a-mcp-server) — Anthropic
- [Model Context Protocol specification](https://modelcontextprotocol.io/specification/2025-06-18) — Model Context Protocol

## Related guides

- [Google Sheets MCP Server for Claude & ChatGPT](https://pastesheet.com/guides/google-sheets-mcp) — Turn any public or private Google Sheet into an MCP server so Claude, Cursor, and ChatGPT can read and query it in plain English. No code, no backend.
- [Connect Google Sheets to Claude via MCP](https://pastesheet.com/guides/google-sheets-mcp-claude) — Connect a public or private Google Sheet to Claude via MCP. Step-by-step setup for Claude Desktop and Claude web to query spreadsheet rows in plain English.
- [Google Sheets MCP Server for Cursor](https://pastesheet.com/guides/google-sheets-mcp-cursor) — Add a Google Sheet to Cursor as an MCP server so the editor's AI can query your spreadsheet while you code. No backend — copy one URL and you are connected.
- [Google Sheets MCP for VS Code & Copilot](https://pastesheet.com/guides/google-sheets-mcp-vscode) — Connect a Google Sheet to VS Code and GitHub Copilot over MCP. Paste one URL into mcp.json and your editor's agent can query the spreadsheet live.

---

[PasteSheet](https://pastesheet.com) turns any Google Sheet into a live REST API and MCP server for AI agents — no backend, no code. Canonical HTML version of this page: <https://pastesheet.com/guides/google-sheets-mcp-claude-code>
