Table of contents

Developers building Sheets integrations have to leave Cursor, make test API calls, and copy response JSON back in just to understand the data structure.
To help your developers inspect live Sheets API responses more easily within Cursor, we'll show you how to connect Google Sheets with Merge Agent Handler's Google Sheets MCP server.
Merge Agent Handler connects Cursor to the Google Sheets API through the Merge CLI.
Install the CLI, authenticate once, and run a single setup command from your project root.
That command writes a ## Merge CLI section to the project's .cursorrules file, which tells Cursor's agent when to call merge search-tools and merge execute-tool to reach Google Sheets.
Once connected, Merge will handle OAuth token storage and refresh so you never configure a Google Cloud project or manage credential rotation yourself.
Here's the registration command:
Related: A guide to integrating a Google Sheets MCP with Codex
Before getting started, you'll need the following:
pipx --version to confirm, or install via pip install pipx)If you want to connect Merge Agent Handler's Google Sheets MCP with internal or customer-facing agentic products, you can follow the steps in our docs.
Run the following to install the Merge CLI and confirm it's ready: pipx install merge-api
Verify your installation: merge --version
Authenticate the CLI with your Merge Agent Handler account: merge login
This links the CLI to your account so it can make authorized requests to Google Sheets on your behalf.
Run the following from the root of the project where you want to use Merge tools: merge setup cursor
This writes a ## Merge CLI section to .cursorrules so Cursor knows to use the CLI for third-party services. The command is idempotent, safe to re-run if you need to reset.
Related: How to use a Google Sheets MCP in Claude Code
Open a Cursor chat in your project and start with a query that reflects real development work. For example: "Fetch the first 5 rows from my project tracking spreadsheet and show me the exact JSON response, including how empty cells are represented in the values array, so I can write a row parser that handles sparse data correctly."
The first time you invoke a Google Sheets tool, a Magic Link will appear to complete connector authentication.

{{this-blog-only-cta}}
In case you have more questions on setting up and using the Google Sheets MCP in Cursor, we've addressed several more commonly-asked questions below.
With Google Sheets connected, Cursor can:
You can build a self-hosted MCP server on top of the Google Sheets API. For a solo developer working against their own spreadsheets, the setup is manageable: create a Google Cloud project, configure OAuth credentials, write tool schemas for the ranges and operations you need, and connect it to Cursor.
The scope problem shows up immediately.
Google OAuth credentials at the project level carry access to every spreadsheet the account can reach, not just the ones you intend to expose to the agent. There's no mechanism to restrict a tool to specific sheet IDs or to prevent a write-capable agent from modifying tabs it has no reason to touch. When a developer leaves and their credentials need to be rotated, there's no clean path to revoke their agent's access without rebuilding the credential setup.
At team scale, each developer manages their own OAuth flow with their own tokens and their own version of the tool schemas. There's no shared view of what queries agents are running or what data they're reading across the team's spreadsheets.
Merge Agent Handler adds a control layer on top.
It lets you control exactly which Sheets operations each agent can call: a read-only parser development agent, for example, can only get value and metadata read tools, not batch update or clear operations. Every call is also logged with the timestamp, tool name, and inputs.
For teams where spreadsheets hold operational or financial data, that combination of scoped access and audit logging gives you a deployment you can reason about.
Developers building Google Sheets integrations need to understand what the API actually returns before the parsing code can be correct.
The Sheets API documentation describes the values array structure in the abstract. A real response shows you how a specific sheet's data behaves: where the sparse array gaps appear, what the header row actually contains, and how the API serializes the value types your integration needs to handle.
With the Google Sheets MCP connected, Cursor can fetch that reference data inline during the session where the integration is being written.
Use Merge Agent Handler’s 150+ connectors (including Google Sheets) to power reliable, secure, and powerful agents.