DEV Community

Cover image for Connect Google Sheets to Claude Code in 5 minutes
Jay from PasteSheet
Jay from PasteSheet

Posted on • Originally published at pastesheet.com

Connect Google Sheets to Claude Code in 5 minutes

I wanted Claude Code to read a Google Sheet while it worked. Some of my test fixtures and a small config table live in a spreadsheet a teammate maintains, and I was tired of copying values out of it by hand every time the agent needed one. The obvious path was to give Claude Code access to the sheet directly, so it could look things up itself.

Then I read the setup instructions. Almost every "Google Sheets for AI" option wants the same thing first: a Google Cloud project, the Sheets API enabled, an OAuth consent screen, and a downloaded service-account JSON file. That is a lot of ceremony before an agent reads a single row, and it is exactly where this kind of side task usually dies.

There is a shorter route. PasteSheet takes a Google Sheet you have shared with "Anyone with the link" and hosts it as an MCP endpoint, which is just a URL an AI client can connect to. You paste the share URL once, and then Claude Code connects to it with a single command. No Cloud project, no OAuth screen, no JSON file. This post is the five-minute version of getting there.

Skipping the Google Cloud project

The reason the usual setup is heavy is that Google's own API and the community servers built on it need credentials to read your account. A service account is a robot Google login, and wiring one up means a project, an enabled API, and a key file you have to keep somewhere safe.

PasteSheet sidesteps all of it because a link-shared sheet is already readable by anyone with the URL. Instead of authenticating as you, PasteSheet just fetches the public sheet, caches the rows, and serves them. There is nothing to authorize on Google's side, which is the whole point of connecting it without any Google Cloud setup. The trade is real and I will come back to it: this path works when the sheet can be link-shared.

What MCP gives Claude Code

MCP, the Model Context Protocol, is the standard way an AI client like Claude Code connects to an outside data source. The server hands the agent a small set of tools, and the agent decides when to call them.

For a PasteSheet endpoint those tools are read-only, and there are three of them:

  • list_tabs shows the tabs in the sheet and which one is the default.
  • get_schema shows each column's name and type.
  • query_rows reads rows, with filtering, full-text search, sorting, and pagination.

The middle one does more than it looks. If the agent does not know your real column names, it guesses them, and half its queries come back empty. When it can call get_schema first, it writes queries against the actual columns and they work on the first try. If you want the fuller picture of how the connection works, the Google Sheets MCP overview covers it.

The one command

Claude Code registers remote MCP servers straight from the CLI, so there is no config file to hand-edit. Open your endpoint's Connect via MCP panel in PasteSheet, copy its URL, and run:

claude mcp add --transport http pastesheet \
  https://pastesheet.com/mcp/sheets/your-endpoint-id
Enter fullscreen mode Exit fullscreen mode

Confirm it registered:

claude mcp list
Enter fullscreen mode Exit fullscreen mode

You should see pastesheet in the list. If you ever want it gone, claude mcp remove pastesheet does it.

A public endpoint needs no key. For a private one, pass a bearer header when you add the server:

claude mcp add --transport http pastesheet \
  https://pastesheet.com/mcp/sheets/your-endpoint-id \
  --header "Authorization: Bearer YOUR_KEY"
Enter fullscreen mode Exit fullscreen mode

If you would rather not type the flags at all, the MCP config generator builds the exact command for you from your endpoint URL. Paste, copy, done.

Asking it something

Once the server is registered, you just talk to Claude Code as usual and it reaches for the tools when it needs the data. Here is a real exchange against a small pricing sheet:

Me:     What's the monthly price on our Pro plan, and is annual cheaper?
Claude: [calls get_schema, sees columns: plan, period, price]
        [calls query_rows filter plan=Pro]
        Pro is $19/month, or $180/year. Annual works out to $15/month, so about 21% cheaper.
Enter fullscreen mode Exit fullscreen mode

I never told it the column names. It read the schema, ran the query, and answered in one turn. That is the part that makes it useful mid-task: the agent can check a value, cross-reference a config table, or confirm a number lives in the sheet before it writes code, all without leaving the terminal.

Where it stops

The no-Cloud trick depends on the Google Sheet being shared with "Anyone with the link," and that is true on every plan. PasteSheet reads the sheet through its public link instead of logging into your Google account, so the spreadsheet itself is never truly private. A paid plan adds a private endpoint, which puts a bearer key in front of your PasteSheet URL so not just anyone can query the API or MCP server. That gates who can reach your PasteSheet endpoint, not who can reach the sheet. Anyone holding the sheet's share link can still open it directly. So the honest rule is simple: don't put genuinely sensitive data in a link-shared sheet.

Two more limits worth knowing. The connection is read-only, so Claude Code can query and analyze the sheet but can never write back to it. And PasteSheet caches the rows for a window you choose, so an edit you made a moment ago might not show up until the cache refreshes. For a lot of workflows that staleness is a feature, not a bug, but if you need write-back or real-time reads, this is the wrong tool.

For the common case, though, reading a spreadsheet from your agent, it is about as low-friction as it gets. MCP is included on the free plan, so the read-only version costs nothing to try.


I build PasteSheet. Share a Google Sheet, paste the URL, and get a cached JSON API plus a read-only MCP server your agent can query. Free tier, no credit card, and no Google Cloud project to set up.

Top comments (1)

Collapse
 
komo profile image
Reid Marlow

Skipping the Google Cloud OAuth setup is a huge win for local agent workflows. Google's Cloud Console is always a multi-step friction point when you just want a quick proof of concept. The read-only constraint is actually a solid default security boundary for agents too—keeps them from accidentally overwriting config sheets. Are you planning to add support for other spreadsheet engines, or keeping it strictly focused on Google Sheets?