Google Drive MCP Server
This server integrates Google Drive with AI agents using secure keyless authentication via Application Default Credentials (ADC), with dynamic access control by sharing files with the Service Account. It supports Google Workspace and Shared Drives. Key capabilities:
List files: Search and list files/folders with optional query and page size (up to 100).
Upload text files: Create text files in Drive, optionally under a parent folder. (Service Account storage limits apply on personal drives; best used with Shared Drives.)
Create folders: Create folders, optionally nested under a parent.
Download files: Download binary or regular files to a local path, auto-creating directories. Google Workspace Docs/Sheets are automatically exported to text/plain for AI processing.
Additional features: identity audit logging, and seamless compatibility with AI agents like Gemini, Claude, and Cursor.
Allows AI agents to search, list, read, create, and update files in a specified Google Drive folder, with automatic conversion of Google Docs/Sheets to plain text.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Google Drive MCP ServerList all files in my Google Drive folder"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Google Drive MCP Server Integration (Keyless Auth)
Model Context Protocol (MCP) server providing seamless, secure Google Drive integration for AI agents (Gemini, Hermes, Claude, Cursor) using Keyless Authentication (Application Default Credentials / ADC).
✨ Fully compatible with MCP Specification v2.0.0 (2026-07-28) ✨
KEYLESS AUTHENTICATION (ADR-0007)
DO NOT use Service Account Private Key files (
.json).REQUIRED: Authentication uses gcloud Application Default Credentials. Run:
gcloud auth application-default login [--impersonate-service-account=...]The server relies 100% natively on Google Auth Application Default Credentials (ADC) and does not read
GOOGLE_APPLICATION_CREDENTIALSdirectly.
🌟 Key Features
🛡️ Keyless Security: Eliminates long-lived private keys. Uses short-lived Google Cloud access tokens.
🎯 Zero-Config Access Control: Accessible files and folders are determined dynamically by sharing folders/files with the Service Account email directly in Google Drive.
🏢 Google Workspace & Shared Drive Support: Full support for enterprise Shared Drives (
supportsAllDrives: true) for 24/7 background automation.📂 Auto-Directory Creation: Automatically creates missing local destination folders when downloading files.
📄 Auto-Text Export: Automatically converts Google Workspace Docs/Sheets to
text/plainfor easy processing by AI agents.🔍 Identity Audit: Logs the actual human user identity (impersonator) for complete auditability.
Related MCP server: mcp-google-drive
🚀 Quick Start (3-Step Setup)
Prerequisite: Ensure you have Node.js
>=20.0.0installed.
Step 1: One-Time Google Cloud IAM Setup
Set Active Project & Enable Required APIs:
gcloud config set project <PROJECT_ID> gcloud services enable drive.googleapis.com iamcredentials.googleapis.com --project="<PROJECT_ID>"Create a Service Account (e.g.
mcp-drive-sa@<PROJECT_ID>.iam.gserviceaccount.com). Do NOT create or download a JSON key!Grant Impersonation Permission to Your Account: Grant your user account the
Service Account Token Creatorrole on the Service Account:gcloud iam service-accounts add-iam-policy-binding <SERVICE_ACCOUNT_EMAIL> \ --member="user:<YOUR_WORKSPACE_EMAIL>" \ --role="roles/iam.serviceAccountTokenCreator" \ --project="<PROJECT_ID>"
Step 2: Share Google Drive Folder
Open Google Drive (Google Workspace Shared Drive recommended).
Share target folders or Shared Drives with your Service Account email (e.g.
mcp-drive-sa@...) as Content Manager or Editor.No extra MCP config required! The server dynamically accesses whatever folders you share with it.
Step 3: Authenticate & Run
Authenticate gcloud CLI:
gcloud auth loginLogin Application Default Credentials (ADC) with Impersonation:
gcloud auth application-default login --impersonate-service-account="<SERVICE_ACCOUNT_EMAIL>"Verify Setup:
./scripts/verify-setup.sh
🛠️ Available MCP Tools
Tool Name | Parameters | Description |
|
| List files and folders in Google Drive accessible to the Service Account. |
|
| Upload a text file to Google Drive. (Note: Requires Google Workspace Shared Drive for storage quota). |
|
| Create a new folder in Google Drive. |
|
| Download a binary or regular file to the local file system (automatically creates missing local destination folders). |
⚙️ AI Agent Configurations
No environment variables are required in the agent configuration (env is empty).
Gemini CLI (.gemini/config.json)
{
"mcpServers": {
"googledrive": {
"command": "npx",
"args": ["-y", "@hydrochlorix/googledrive-mcp-server"]
}
}
}Hermes Agent (~/.hermes/config.yaml)
mcp_servers:
googledrive:
command: "npx"
args: ["-y", "@hydrochlorix/googledrive-mcp-server"]Claude Desktop / Cursor (claude_desktop_config.json)
{
"mcpServers": {
"googledrive": {
"command": "npx",
"args": ["-y", "@hydrochlorix/googledrive-mcp-server"]
}
}
}❓ Troubleshooting & Limitations
1. PERMISSION_DENIED / iam.serviceAccounts.getAccessToken Errors
If you encounter permission denied errors during impersonation:
Ensure
gcloud auth loginwas run with your workspace email.Ensure you executed the IAM policy binding command in Step 1:
gcloud iam service-accounts add-iam-policy-binding <SERVICE_ACCOUNT_EMAIL> \ --member="user:<YOUR_WORKSPACE_EMAIL>" \ --role="roles/iam.serviceAccountTokenCreator" \ --project="<PROJECT_ID>"Re-run
gcloud auth application-default login --impersonate-service-account="<SERVICE_ACCOUNT_EMAIL>".
2. Service Account Storage Quota on Personal (@gmail.com) Drives
Service Accounts have 0 Bytes personal storage quota.
Supported on
@gmail.com:drive_list_files,drive_download_file, anddrive_create_folder(folders consume 0 Bytes quota).Upload Limitation:
drive_upload_text_fileto a personal@gmail.comfolder will fail withService Accounts do not have storage quotabecause file ownership defaults to the Service Account.Recommended Solution: Use a Google Workspace Shared Drive (where storage quota belongs to the Shared Drive) for seamless 100% upload support.
🧪 Verification & Smoke Test
To verify your setup:
Start your AI agent with this MCP server configured.
Prompt the agent: "List the most recent files in my Google Drive."
Success: The agent returns the list of files from your shared Drive folder.
📜 License
This project is licensed under the MIT License.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -license-qualityBmaintenanceThis MCP server integrates with Google Drive to allow listing, reading, and searching over files.Last updated5,88489,135MIT
- AlicenseBqualityDmaintenanceMCP server for Google Drive integration with file management, search, sharing, and full CRUD operations.Last updated153802MIT
- Flicense-qualityBmaintenanceA read-only Google Drive MCP server that allows searching files, reading file content (with auto-export for Google Docs, Sheets, Slides), and retrieving file metadata via OAuth authentication.Last updated402
- Alicense-qualityCmaintenanceMCP server for Google Drive that enables listing, searching, uploading, downloading, and managing files and folders, as well as handling comments and permissions.Last updated1634MIT
Related MCP Connectors
MCP server for Google search results via SERP API
Streamable HTTP MCP server for Google Calendar and Sheets with OAuth login.
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/HydroChlorix/googledrive-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server