Skip to main content
RapidDev - Software Development Agency
mcp-tutorial

How to use the Google Drive MCP server

The Google Drive MCP server lets your AI assistant search, read, and manage files in your Google Drive. It authenticates via OAuth 2.0 so your credentials stay secure, and exposes tools to list files, read document contents, search across your Drive, and create new files. This is ideal for having your AI summarize documents, extract data from spreadsheets, search for specific files, and work with your Google Workspace content directly from the chat window.

What you'll learn

  • How to set up Google Cloud OAuth credentials for the MCP server
  • How to configure and authenticate the Google Drive MCP server
  • How to search, read, and manage Google Drive files through AI
  • How to work with Docs, Sheets, and other Google Workspace files
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate7 min read25 minutesClaude Desktop, Cursor, Windsurf, VS Code (Copilot)March 2026RapidDev Engineering Team
TL;DR

The Google Drive MCP server lets your AI assistant search, read, and manage files in your Google Drive. It authenticates via OAuth 2.0 so your credentials stay secure, and exposes tools to list files, read document contents, search across your Drive, and create new files. This is ideal for having your AI summarize documents, extract data from spreadsheets, search for specific files, and work with your Google Workspace content directly from the chat window.

Access and Search Your Google Drive from Your AI Assistant

The Google Drive MCP server connects your AI assistant to your Google Drive account through OAuth 2.0 authentication. It provides tools to search for files by name or content, read document text, list folder contents, and interact with your entire Drive library. This is especially powerful for knowledge workers who store documentation, meeting notes, spreadsheets, and specifications in Google Drive. Instead of manually searching and reading files, you can ask your AI to find, summarize, and extract information from your Drive in seconds.

Prerequisites

  • A Google account with Google Drive access
  • A Google Cloud project with the Drive API enabled
  • OAuth 2.0 client credentials (client ID and client secret)
  • Node.js 18 or later installed on your machine
  • Claude Desktop, Cursor, or another MCP-compatible AI host

Step-by-step guide

1

Create a Google Cloud project and enable the Drive API

Go to console.cloud.google.com and create a new project (or select an existing one). Navigate to APIs & Services > Library, search for 'Google Drive API', and click Enable. This allows your MCP server to make API calls to Google Drive on your behalf.

Expected result: The Google Drive API is enabled in your Google Cloud project.

2

Create OAuth 2.0 credentials

In your Google Cloud project, go to APIs & Services > Credentials. Click 'Create Credentials' > 'OAuth client ID'. Choose 'Desktop app' as the application type and give it a name like 'MCP Google Drive'. Download the JSON credentials file. You will need the client_id and client_secret from this file. If this is a new project, you may need to configure the OAuth consent screen first — choose 'External' user type and add your email as a test user.

typescript
1Steps:
21. Google Cloud Console > APIs & Services > Credentials
32. Create Credentials > OAuth client ID
43. Application type: Desktop app
54. Name: MCP Google Drive
65. Download JSON file
76. Extract client_id and client_secret values

Expected result: You have OAuth client_id and client_secret values from the downloaded credentials JSON.

3

Add the Google Drive MCP server to your configuration

Open your MCP host's configuration file and add a google-drive entry. Pass the client_id and client_secret as environment variables. The server will initiate an OAuth flow on first run, opening a browser window where you authorize access to your Google Drive.

typescript
1{
2 "mcpServers": {
3 "google-drive": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "@anthropic-ai/google-drive-mcp"
8 ],
9 "env": {
10 "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
11 "GOOGLE_CLIENT_SECRET": "your-client-secret"
12 }
13 }
14 }
15}

Expected result: Your configuration file contains the Google Drive MCP server entry with your OAuth credentials.

4

Authenticate and authorize Google Drive access

Restart your AI host. On first launch, the Google Drive MCP server will open a browser window asking you to sign in with your Google account and authorize access to Google Drive. Grant the requested permissions. The server stores the refresh token locally so you only need to authenticate once. Future startups will use the stored token automatically.

Expected result: You have authorized the MCP server to access your Google Drive, and the server shows as connected.

5

Search and read files from Google Drive

Ask your AI to find and read files from your Drive. It can search by filename, content, file type, or folder. When reading Google Docs, the server extracts the text content. For Sheets, it can read cell data. For PDFs and other files, it returns available text content.

typescript
1Example prompts:
2
3"Search my Google Drive for files containing 'Q4 budget'"
4
5"Read the contents of the document called 'Product Requirements v2' in my Drive"
6
7"List all spreadsheets in my 'Project Alpha' folder"

Expected result: The AI finds and reads files from your Google Drive, presenting the content in the chat.

6

Configure for VS Code with the servers key

For VS Code with GitHub Copilot, use the servers key instead of mcpServers. Create a .vscode/mcp.json file in your workspace root with the same command, args, and env values.

typescript
1{
2 "servers": {
3 "google-drive": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "@anthropic-ai/google-drive-mcp"
8 ],
9 "env": {
10 "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
11 "GOOGLE_CLIENT_SECRET": "your-client-secret"
12 }
13 }
14 }
15}

Expected result: VS Code recognizes the Google Drive MCP server and Copilot can search and read your Drive files.

Complete working example

claude_desktop_config.json
1{
2 "mcpServers": {
3 "google-drive": {
4 "command": "npx",
5 "args": [
6 "-y",
7 "@anthropic-ai/google-drive-mcp"
8 ],
9 "env": {
10 "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
11 "GOOGLE_CLIENT_SECRET": "your-client-secret"
12 }
13 }
14 }
15}
16
17// VS Code variant (.vscode/mcp.json):
18// {
19// "servers": {
20// "google-drive": {
21// "command": "npx",
22// "args": ["-y", "@anthropic-ai/google-drive-mcp"],
23// "env": {
24// "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",
25// "GOOGLE_CLIENT_SECRET": "your-client-secret"
26// }
27// }
28// }
29// }
30
31// Setup steps:
32// 1. Google Cloud Console > Enable Google Drive API
33// 2. Create OAuth 2.0 credentials (Desktop app)
34// 3. Add client_id and client_secret to config
35// 4. Restart AI host > authorize in browser
36
37// Available tools:
38// - search_files: Search Drive by name or content
39// - read_file: Read document/sheet/file contents
40// - list_files: List files in a folder
41// - get_file_metadata: Get file details and sharing info
42// - create_file: Create new files in Drive

Common mistakes when using the Google Drive MCP server

Why it's a problem: Not enabling the Google Drive API in the Cloud project

How to avoid: The server will fail to authenticate if the Drive API is not enabled. Go to Google Cloud Console > APIs & Services > Library > search for 'Google Drive API' > click Enable.

Why it's a problem: Using 'Web application' instead of 'Desktop app' for OAuth type

How to avoid: The MCP server runs locally and uses the Desktop app OAuth flow. Web application credentials require a redirect URI and will not work with the local server. Choose 'Desktop app' when creating OAuth credentials.

Why it's a problem: Forgetting to add yourself as a test user on the consent screen

How to avoid: If your OAuth consent screen is in 'Testing' mode, only users listed as test users can authenticate. Go to APIs & Services > OAuth consent screen > Test users and add your Google email.

Why it's a problem: Sharing OAuth credentials in version control

How to avoid: Never commit your client_id and client_secret to a repository. Add your MCP config file to .gitignore. These credentials grant access to anyone's Google Drive who authorizes them.

Best practices

  • Use a dedicated Google Cloud project for MCP access rather than a shared one
  • Keep your OAuth consent screen in 'Testing' mode unless you need external users
  • Search for specific files before asking the AI to read them to save context window space
  • Combine with filesystem MCP server to download and save Drive content locally
  • Ask the AI to summarize long documents rather than reading the entire content
  • Organize Google Drive folders to make AI search more effective
  • Revoke access from Google Account > Security > Third-party apps if you stop using the server
  • Use specific search terms — Drive search supports file type filters and date ranges

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I want to set up the Google Drive MCP server so my AI assistant can search and read my Google Drive files. Walk me through creating a Google Cloud project, getting OAuth credentials, and configuring Claude Desktop.

MCP Prompt

Search my Google Drive for any documents related to 'API design guidelines', read the most recent one, and create a summary of the key design principles mentioned.

Frequently asked questions

Does the AI have access to all files in my Google Drive?

Yes, the OAuth authorization grants access to your entire Drive. The AI can search and read any file your Google account can access, including shared files and team drives. Be mindful of what you ask the AI to read, especially in shared workspaces.

Can the AI edit my Google Docs?

The current MCP server focuses on read and search operations. Write support depends on the specific server implementation. If write access is available, Claude Desktop will show an approval dialog before any modifications.

Do I need to pay for Google Cloud to use this?

No. The Google Drive API has a generous free quota (1 billion queries per day). The OAuth credentials are free to create. You only pay for Google Cloud if you exceed the free tier limits, which is extremely unlikely for MCP use.

Will my Google Drive data be sent to Brave, OpenAI, or other services?

No. The MCP server runs locally on your machine and communicates directly with Google's API. File contents are sent to your AI host (Claude, Cursor, etc.) for processing, following that service's privacy policy. No third-party services receive your Drive data.

Can I connect multiple Google accounts?

Add multiple server entries with different names (like google-drive-personal and google-drive-work), each with its own OAuth credentials. Each entry authenticates independently with a different Google account.

What if I need help building a document processing pipeline with Google Drive and AI?

For complex workflows that combine Google Drive document analysis with database storage, automated reporting, or multi-step processing, RapidDev can help architect and build the integration using MCP servers and custom tooling.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.