Skip to main content
← Back to Articles
MCPGoogle DriveClaude DesktopCursor IDEOAuthAI integration

How to Set Up the Google Drive MCP Server (2026)

Connect Google Drive to Claude, Cursor, and VS Code with MCP. Search Docs, read Sheets, and pull files into your AI workflow — full setup with OAuth config and troubleshooting.

By Web MCP GuideJune 23, 20268 min read

Most teams keep their real documentation in Google Drive — design docs, spreadsheets, contracts, onboarding guides, and meeting notes. The Google Drive MCP server lets Claude, Cursor, or VS Code search and read those files directly, so your AI assistant works from your actual documents instead of guessing. This guide walks through the complete setup, including the Google Cloud OAuth flow that trips most people up.

What This Integration Enables

With the Google Drive MCP server connected, your AI assistant can:

  • Search your entire Drive by filename, content, or type
  • Read Google Docs as clean Markdown
  • Export Google Sheets as CSV for analysis
  • Pull plain files (PDF, TXT, JSON) into context
  • Cross-reference a spec, contract, or spreadsheet while you write code or draft a reply

Prerequisites

  • Node.js 18+ installed and on your PATH
  • A Google account with Drive access
  • A Google Cloud project (free) — created in step 1
  • An MCP client: Claude Desktop, Cursor, or VS Code

Step 1: Create a Google Cloud Project

  1. Go to console.cloud.google.com and create a new project named "MCP Drive".
  2. In APIs & Services → Library, search for Google Drive API and click Enable.

Step 2: Configure OAuth Credentials

  1. Open APIs & Services → OAuth consent screen, choose External, and add yourself as a test user.
  2. Add the scope .../auth/drive.readonly.
  3. Go to Credentials → Create Credentials → OAuth client ID, choose Desktop app, and download the JSON.
  4. Save it as gcp-oauth.keys.json in a private folder, e.g. ~/.config/mcp-gdrive/.

Step 3: Authenticate the Server

Run the one-time authentication flow. This opens a browser, you approve access, and the server saves a token locally:

GDRIVE_OAUTH_PATH=~/.config/mcp-gdrive/gcp-oauth.keys.json \
GDRIVE_CREDENTIALS_PATH=~/.config/mcp-gdrive/credentials.json \
npx -y @modelcontextprotocol/server-gdrive auth

After approving in the browser, you should see a confirmation that credentials were saved to credentials.json.

Step 4: Add the Server to Your Client

Claude Desktop

Edit claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/):

{
  "mcpServers": {
    "gdrive": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-gdrive"],
      "env": {
        "GDRIVE_OAUTH_PATH": "/Users/you/.config/mcp-gdrive/gcp-oauth.keys.json",
        "GDRIVE_CREDENTIALS_PATH": "/Users/you/.config/mcp-gdrive/credentials.json"
      }
    }
  }
}

Cursor & VS Code

Use the identical block in ~/.cursor/mcp.json or your VS Code MCP settings. See our VS Code MCP setup guide for the exact file location.

Step 5: Restart and Verify

Fully quit and reopen your client. Then test it:

Search my Google Drive for "Q3 roadmap" and summarize the latest version

Getting a real result confirms the integration is live.

Real-World Use Cases

  • Summarize a Google Doc spec before implementing a feature
  • Pull a Sheet of survey data and have the AI compute trends
  • Find the latest contract revision and extract the key clauses
  • Cross-reference an onboarding doc while answering a teammate's question

Troubleshooting

redirect_uri_mismatch

Use a Desktop app credential type, which handles the loopback redirect. If you created a Web application credential, add http://localhost as an authorized redirect URI.

Access blocked / app not verified

Add your Google account as a test user on the OAuth consent screen. Apps in testing mode only allow listed test users until verified.

Tools don't appear after setup

Confirm Node 18+ is installed, that the paths in your config are absolute, and re-run the auth step so a valid credentials.json exists.

Security

  • Keep the drive.readonly scope unless you truly need writes
  • Store credentials outside any repo and run chmod 600 on them
  • Use a dedicated Cloud project so you can revoke access independently

Frequently Asked Questions

Is there an official Google Drive MCP server?

The reference Google Drive MCP server is maintained in the Model Context Protocol servers collection and published as @modelcontextprotocol/server-gdrive. It uses Google OAuth 2.0 and supports searching files, reading Google Docs, Sheets, and Slides, and fetching plain files from your Drive.

Does the Google Drive MCP server have write access?

The reference server is read-only by default and uses the drive.readonly scope. This is intentional: it lets your AI assistant search and read files without the risk of modifying or deleting them. If you need write access, you must add broader scopes and use a server build that exposes write tools.

Can I use the Google Drive MCP server with Cursor and VS Code?

Yes. The same server binary works with any MCP-compatible client. In Cursor you add it to ~/.cursor/mcp.json, in VS Code you add it to your MCP settings, and in Claude Desktop you add it to claude_desktop_config.json. The command and OAuth credentials are identical across clients.

Why do I get a redirect_uri_mismatch error?

This means the redirect URI you registered in the Google Cloud Console OAuth consent screen does not match the one the MCP server requests. For desktop OAuth, use http://localhost as an authorized redirect URI, or register the server as a Desktop App credential type, which handles the loopback redirect automatically.

How do I keep my Google credentials secure?

Store your OAuth client secret JSON and the saved token outside any git repository, restrict file permissions with chmod 600, and never commit your MCP config file. Use a dedicated Google Cloud project so you can revoke the integration independently, and request the narrowest scope your workflow needs.

More MCP Integrations

Browse the full MCP server directory to connect Slack, Notion, GitHub, the local filesystem, and 50+ more tools to your AI workflow.