How to connect a Google Drive MCP to Cursor (4 steps)
.png)
Developers building integrations that read from Google Drive, or writing code that needs to reference internal docs, rarely have both open at the same time.
The API spec lives in a Shared Drive folder, the schema doc is somewhere in a teammate's Drive, and the integration code is in Cursor.
Every time you need to check a field name, confirm a folder path, or understand what a real API response looks like, you leave the editor to find the file and return. That context switch compounds across a workay.
To help your developers query Drive files without leaving Cursor, we'll show you how to connect Google Drive with Merge Agent Handler's Google Drive MCP server.
How it works
Merge Agent Handler connects Cursor to the Google Drive API through the Merge CLI.
You install the CLI, authenticate once, and run a single setup command from your project root.
That command writes a ## Merge CLI section to your project's .cursorrules file, which tells Cursor's agent when to call merge search-tools and merge execute-tool to reach Google Drive.
Merge also handles OAuth token storage and refresh on your behalf, so you never configure Drive credentials in your local environment.
Here's the command that registers the connection:
Prerequisites
Before getting started, you'll need the following:
- A Merge Agent Handler account
- Cursor installed
- pipx installed (run
pipx --versionto confirm, or install viapip install pipx) - A Google account with access to the Drive you want to connect
If you want to connect Merge Agent Handler's Google Drive MCP with internal or customer-facing agentic products, you can follow the steps in our docs.
1. Install the Merge CLI
Run the following to install the Merge CLI: pipx install merge-api
Verify your installation: merge --version
Related: How to use a Google Drive MCP in Claude Code
2. Log in to Merge
Authenticate your session by running: merge login
This links the CLI to your Merge Agent Handler account so it can make authorized requests on your behalf.
3. Connect the CLI to Cursor
Run the following from the root of the project where you want to use Merge tools:
This writes a ## Merge CLI section to .cursorrules so Cursor knows to use the CLI for third-party services. The command is idempotent, so it's safe to re-run if you need to reset.
4. Authenticate Google Drive
Open a Cursor chat in your project and try: "Find the folder structure under our /docs directory in Google Drive and list all files modified in the last 7 days."
The first time you invoke a Google Drive tool, a Magic Link will appear to complete connector authentication.

{{this-blog-only-cta}}
Google Drive MCP FAQ
In case you have more questions on setting up and using the Google Drive MCP in Cursor, we've addressed several more commonly-asked questions below.
What can you do once the Google Drive MCP is connected to Cursor?
With Google Drive connected, Cursor can:
- Resolve real file and folder IDs for test fixtures: look up the actual ID of a specific file or folder in your Drive so you can use it in test cases and API calls without hardcoding fake values that won't match production
- Inspect Drive API response shapes: fetch a real file or folder object to see the exact fields and data types the API returns before writing your deserialization or transformation logic
- Look up MIME type mappings: retrieve which MIME types correspond to Google Docs, Sheets, Slides, and other native formats so you can write accurate type-detection and conversion logic without guessing
- Query permission roles on a specific resource: check the permissions structure on a file or folder to understand the role hierarchy (owner, writer, reader, commenter) before implementing access-control logic in your integration code
- Validate pagination behavior against a real directory: pull a large folder listing to see how the API returns nextPageToken and structures paginated responses before writing your pagination handler
Why use Merge Agent Handler vs. a self-hosted Google Drive MCP server?
You can self-host a Google Drive MCP server using open-source packages. For a solo developer working against a single Google account, that path works: create a Google Cloud project, configure OAuth credentials, stand up the server, and point Cursor at it.
The overhead grows in practice.
Google's OAuth setup requires a project with Drive API enabled, credentials scoped correctly, and token refresh logic that survives restarts. If multiple developers need Drive access through Cursor, each one manages their own credential set, or tokens get shared in ways that are hard to audit or revoke cleanly.
There's also no access scoping in a self-hosted setup. Every developer gets the same access to every file the credential can reach.
Merge Agent Handler lets you specify which Drive operations a given agent or user can perform, and Merge enforces it. Every tool call is also logged with the full input and output, so you can trace exactly what your agent read or wrote and when.
Why connect Google Drive to Cursor?
Developers building Drive integrations spend a lot of time looking things up: what folder path to use, what a file ID looks like in a real API response, what fields a Docs API result actually returns.
This lookup work currently happens in a browser, disconnected from the editor where the code lives.
With the Google Drive MCP connected, Cursor can query Drive directly from the chat panel. You can pull a sample API response to validate your parsing logic, browse a folder to understand the file hierarchy your code will traverse, or read a spec doc to confirm field names, all without leaving the editor.
.avif)
.png)


.png)
