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
Create a Google Cloud project and enable the Drive API
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.
Create OAuth 2.0 credentials
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.
1Steps:21. Google Cloud Console > APIs & Services > Credentials32. Create Credentials > OAuth client ID43. Application type: Desktop app54. Name: MCP Google Drive65. Download JSON file76. Extract client_id and client_secret valuesExpected result: You have OAuth client_id and client_secret values from the downloaded credentials JSON.
Add the Google Drive MCP server to your configuration
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.
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.
Authenticate and authorize Google Drive access
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.
Search and read files from Google Drive
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.
1Example prompts:23"Search my Google Drive for files containing 'Q4 budget'"45"Read the contents of the document called 'Product Requirements v2' in my Drive"67"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.
Configure for VS Code with the servers key
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.
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
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}1617// 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// }3031// Setup steps:32// 1. Google Cloud Console > Enable Google Drive API33// 2. Create OAuth 2.0 credentials (Desktop app)34// 3. Add client_id and client_secret to config35// 4. Restart AI host > authorize in browser3637// Available tools:38// - search_files: Search Drive by name or content39// - read_file: Read document/sheet/file contents40// - list_files: List files in a folder41// - get_file_metadata: Get file details and sharing info42// - create_file: Create new files in DriveCommon 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.
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.
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.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation