Google Drive MCP Server
List, search, read, and create Google Drive files from your AI assistant
The Google Drive MCP Server connects Claude and other MCP-compatible agents to your Google Drive via the official Google Drive API. List folder contents, search across your Drive, read file contents, and create new files — all from within your AI chat session. By default the server operates read-only; write access requires an opt-in flag.
Installation & Configuration
This server uses uvx (part of the uv Python toolchain). Install uv first if you don't have it: curl -LsSf https://astral.sh/uv/install.sh | sh
Add this block to your claude_desktop_config.json:
{
"mcpServers": {
"gdrive": {
"command": "uvx",
"args": ["mcp-server-gdrive"],
"env": {
"GDRIVE_CREDENTIALS_FILE": "/path/to/credentials.json"
}
}
}
}
To enable write access, add "--allow-writes" to the args array.
Getting your credentials file:
- Go to Google Cloud Console → APIs & Services → Credentials
- Create an OAuth 2.0 Client ID (Desktop app type)
- Download the JSON file and set its path in
GDRIVE_CREDENTIALS_FILE - On first run, a browser window opens for you to authorise access
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
Available Tools (4)
list_drive_filesread_filecreate_filesearch_files
Use Cases
- Document Q&A — ask Claude to summarise or answer questions about Docs/Sheets stored in Drive
- Report generation — have Claude draft a report and create it directly in a shared Drive folder
- File discovery — search across thousands of Drive files to surface the one you need
- Meeting prep — pull recent docs from a project folder before a meeting for instant context
Gotchas
- OAuth consent screen must be published: If your Google Cloud project is in "Testing" mode, only test users you explicitly list can authorise. Switch to "Published" or add yourself as a test user.
- Google Workspace vs personal accounts: Workspace admins sometimes restrict third-party OAuth apps. If authorisation fails, check your org's OAuth policies in the Admin Console.
- Write mode is off by default: Forgetting
--allow-writescauses all write calls to fail silently (the tool appears in the list but returns an error). Add the flag explicitly when you need it. - Token refresh: The OAuth token is cached locally. If it expires and auto-refresh fails (e.g., credentials file was moved), you'll need to re-run the auth flow manually.
Security Note
The OAuth credentials grant access to everything in your Google Drive. In read-only mode the risk is limited to data exposure. With --allow-writes enabled, the server can create and modify files. Store the credentials JSON file outside version control and restrict filesystem permissions (chmod 600).
Source & Documentation
GitHub Repository: https://github.com/modelcontextprotocol/servers/tree/main/src/gdrive
Protocol: Model Context Protocol (MCP) — modelcontextprotocol.io
20 ready-to-paste server configs + installer + doctor script