Google Sheets and MCP from Python
Two very different jobs get called "Google Sheets MCP in Python": building a server, and calling one. This covers both, and is honest about when writing your own is a waste of an afternoon.
Last updated
Key facts
- Google's API requires a Google Cloud project plus OAuth credentials or a service account before it will return a single row. source
-
The Google Sheets API allows 300 read requests per minute per project and 60 per minute per user. Past that it returns
429 RESOURCE_EXHAUSTED. source -
Google's Sheets API is cell-oriented: it reads ranges like
A1:D50, not records. Reassembling those into row objects is work you do yourself. source - The MCP half is the easy half. The expensive half is Google — credentials, quota, and the cache you end up writing because agents are chatty: one question becomes a schema read plus several queries.
Do you want to build a server, or use one?
If you want to build a Google Sheets MCP server in Python, the MCP Python SDK plus gspread will get you there — you define tools, authenticate to Google, and run the process. Do this when you need custom tools or write access.
If you want to use one, you do not need Python at all: MCP clients take a URL. But Python is often how you consume the same data outside the agent, and PasteSheet serves the identical rows over plain HTTP.
Reading the same sheet from Python
The endpoint your agent queries over MCP is also a REST API. No client library, no credentials:
import requests
rows = requests.get(
"https://pastesheet.com/api/your-endpoint-id",
params={"status": "shipped", "sort": "-date", "limit": 50},
).json()
for row in rows["data"]:
print(row["customer"], row["total"])What building it yourself actually costs
The MCP part is the easy half — the SDK is pleasant and a few tools is not much code. The expensive half is Google: a Cloud project, the Sheets API enabled, a service account and its JSON key, and then quota management.
That quota is the part people underestimate. Google allows 300 read requests per minute per project and 60 per minute per user, then returns a 429 (published limits). Agents are chatty — one question becomes a schema read plus several queries — so a naive server hits this quickly, and now you are writing a cache too.
What it costs
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.
Free
For side projects and trying things out.
- Endpoints
- 3
- Requests / mo
- 2,000
- Row cap
- 500
- MCP for AI agents
- Aggregation & grouping
Frequently asked questions
Can I write my own Google Sheets MCP server in Python?
Yes. The MCP Python SDK plus a library like gspread is a reasonable stack. Expect the Google side — Cloud project, service account, API quota, caching — to take more of your time than the MCP side.
Do I need Python to use PasteSheet with an AI agent?
No. MCP clients connect to a URL, so no code is involved. Python only enters the picture if you also want to read the same rows from a script, which you can do with a plain HTTP request.
What is gspread?
A popular Python library for the Google Sheets API. It is a good choice if you are talking to Google directly, and it still requires a Google Cloud project with credentials.
How do I avoid Google's API rate limits?
Cache. Google allows 300 reads per minute per project and 60 per user, then returns 429. Reading the sheet once and serving repeat queries from a cache removes the problem — which is what PasteSheet does for you.
Sources
- Authorize requests — Google Sheets API — Google
- Usage limits — Google Sheets API — Google
Related guides
How to Read a Google Sheet in Python
Three ways to read a Google Sheet from Python: gspread, the official API, and a plain HTTP endpoint. Working code and the gotchas for each approach.
Self-Hosted Google Sheets MCP Alternative
A hosted alternative to self-hosted Google Sheets MCP servers: no service account, Docker, or uvx — paste a share URL and get a read-only endpoint.
Google Sheets API Rate Limits (60/min)
Google Sheets API rate limits are 300 reads per minute per project and 60 per user. Here is why read-heavy apps hit a 429 — and how caching removes the wall.
Google Sheets MCP Server for Claude & ChatGPT
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.
Turn your sheet into an API in minutes
Paste a Google Sheet URL and get a live REST API and MCP server — no backend, no code, free to start.