ConnectGet API Key API Key https://gateway.mewcp.com/google-drive/mcp Copy Infrastructure You Can Trust for Agentic Products
© 2026 MewCP. All rights reserved.
Manage files and folders in Google Drive via API.
A Model Context Protocol (MCP) server that exposes Google Drive's API for managing, uploading, downloading, and sharing files seamlessly.
Overview
The Google Drive MCP Server provides stateless, multi-user access to Google Drive's core operations:
File Management — Create, list, search, and delete files and folders
File Operations — Upload and download files with full control over destinations
Sharing & Permissions — Share files with users or make them publicly accessible
Perfect for:
Automated file organization and bulk operations
Building AI-driven document workflows
Integrating cloud storage into multi-agent systems
list_files — List files in Google Drive with filtering optionsInputs:
oauth_token (object, required) — Valid Google OAuth token object with credentials
folder_id (string, optional) — Specific folder ID to list files from (default: null)
query (string, optional) — Search query string for filtering (default: "")
page_size (integer, optional) — Maximum items per page (default: 10)
Output:
{
"result" : {
"count" : 5 ,
"files" : [
{
"id" : "file-id-123" ,
"name" : "document.pdf" ,
"mimeType" : "application/pdf"
}
]
}
} Usage Example:
POST /mcp/google-drive/list_files
{
"oauth_token" : {
"token" : "ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"folder_id" : "abc123xyz",
"page_size" : 10
get_file_metadata — Get metadata for a specific file by IDInputs:
oauth_token (object, required) — Valid Google OAuth token object
file_id (string, required) — The file ID to retrieve metadata for
Output:
{
"result" : {
"id" : "file-id-123" ,
"name" : "document.pdf" ,
"mimeType" : "application/pdf" ,
"size" : "1024000" ,
"createdTime" : "2026-03-19T10:00:00Z" ,
download_file — Download a file from Google Drive to local diskInputs:
oauth_token (object, required) — Valid Google OAuth token object
file_id (string, required) — The file ID to download
destination_path (string, required) — Local file path where file will be saved
Output:
{
"result" : {
"message" : "File downloaded successfully to /path/to/file"
}
} Usage Example:
upload_file — Upload a file to Google DriveInputs:
oauth_token (object, required) — Valid Google OAuth token object
file_path (string, required) — Local file path to upload
name (string, optional) — Custom name for the file in Drive (default: null)
folder_id (string, optional) — Target folder ID in Drive (default: null)
mime_type (string, optional) — MIME type of the file (default: null)
Output:
{
"result" : {
"message" : "File uploaded successfully" ,
"file" : {
"id" :
create_folder — Create a new folder in Google DriveInputs:
oauth_token (object, required) — Valid Google OAuth token object
name (string, required) — Name of the new folder
parent_folder_id (string, optional) — Parent folder ID (default: null, creates in root)
Output:
{
"result" : {
"message" : "Folder created successfully" ,
"folder" : {
"id" : "folder-id-456" ,
"name" : "New Folder" ,
"mimeType" :
delete_file — Delete a file or folder from Google DriveInputs:
oauth_token (object, required) — Valid Google OAuth token object
file_id (string, required) — The file or folder ID to delete
Output:
{
"result" : {
"message" : "File deleted successfully"
}
} Usage Example:
POST /mcp/google-drive/delete_file
{
"oauth_token"
search_files — Search for files in Google Drive using advanced queriesInputs:
oauth_token (object, required) — Valid Google OAuth token object
query (string, required) — Search query using Drive API query syntax
page_size (integer, optional) — Maximum items per page (default: 10)
Output:
{
"result" : {
"count" : 3 ,
"files" : [
{
"id" : "file-id-789" ,
"name" : "report.docx" ,
share_file — Share a file with a user or make it publicly accessibleInputs:
oauth_token (object, required) — Valid Google OAuth token object
file_id (string, required) — The file ID to share
email (string, optional) — Email address to share with (default: null)
role (string, optional) — Permission level: "reader", "commenter", or "writer" (default: "reader")
share_type (string, optional) — Type of sharing: "user", "group", "domain", or "anyone" (default: null)
Output:
{
"result" : {
"message" : "File shared successfully" ,
"permission_id" : "perm-id-123"
get_file_content — Get the content of a text file from Google DriveInputs:
oauth_token (object, required) — Valid Google OAuth token object
file_id (string, required) — The text file ID to retrieve content from
Output:
{
"result" : "File content as raw text string"
} Usage Example:
POST /mcp/google-drive/get_file_content
{
"oauth_token" : {
"token"
Reference & Support
API Parameters Reference
page_size — Maximum results per page (default: 10)
page_token — Token from previous response for paginating through results
Query & Filtering
query — Drive API query filter (e.g., name contains 'report' , mimeType = 'application/pdf' )
File Resource:
files/{FILE_ID}
Example: files/abc123xyz789def456 Folder Resource:
OAuth Guide All tools require a valid Google OAuth token. Here's how to obtain one:
Step 1: Create Google Cloud Project
Go to Google Cloud Console
Create a new project or select an existing one
Enable the Google Drive API from the API Library
Step 2: Create OAuth 2.0 Credentials
Navigate to Credentials in Google Cloud Console
Click + Create Credentials → OAuth client ID
Select your application type (Desktop, Web, or other)
Download the credentials JSON file
Step 3: Authenticate with Google Use your Google account to authenticate and obtain the OAuth token. Refer to Google OAuth 2.0 Documentation for detailed authentication steps specific to your use case.
Step 4: Required Scopes Ensure your OAuth token has these scopes:
https://www.googleapis.com/auth/drive — Full Drive access (read, write, delete)
https://www.googleapis.com/auth/drive.file — Access only to files created by the app
https://www.googleapis.com/auth/drive.readonly — Read-only access to all files
Troubleshooting Missing or Invalid API Key
Cause: API key not provided in request headers or incorrect format
Solution:
Verify Authorization: Bearer YOUR_API_KEY header is present
Check API key is active in your Curious Layer account
Regenerate API key if expired
Rate Limit Exceeded
Cause: Too many requests sent to the API gateway
Solution:
Check rate limit headers in response: X-RateLimit-Remaining
Implement exponential backoff for retries
Spread requests over time
Insufficient Credits
Cause: API calls have exceeded your requests limits
Solution:
Check credit usage in your Curious Layer dashboard
Upgrade to a paid plan or add credits for higher limits
Contact support for credit adjustments
Cause: JSON payload is invalid or missing required fields
Solution:
Validate JSON syntax before sending
Ensure all required tool parameters are included
}
"modifiedTime" : "2026-03-19T12:00:00Z"
}
}
POST /mcp/google-drive/get_file_metadata
{
"oauth_token" : {
"token" : "ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"file_id" : "file-id-123"
} POST
/mcp/google-drive/download_file
{
"oauth_token" : {
"token" : "ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"file_id" : "file-id-123",
"destination_path" : "/home/user/downloads/document.pdf"
}
"new-file-id-123"
,
"name" : "document.pdf" ,
"webViewLink" : "https://drive.google.com/file/d/new-file-id-123"
}
}
}
POST /mcp/google-drive/upload_file
{
"oauth_token" : {
"token" : "ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"file_path" : "/home/user/documents/report.pdf",
"folder_id" : "abc123xyz",
"name" : "Q1 Report"
} "application/vnd.google-apps.folder"
}
}
}
POST /mcp/google-drive/create_folder
{
"oauth_token" : {
"token" : "ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"name" : "Project Files",
"parent_folder_id" : "abc123xyz"
} :
{
"token" : "ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"file_id" : "file-id-123"
}
"mimeType"
:
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
]
}
}
POST /mcp/google-drive/search_files
{
"oauth_token" : {
"token" : "ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"query" : "name contains 'report' and mimeType = 'application/pdf'",
"page_size" : 20
} ,
"webViewLink" : "https://drive.google.com/file/d/file-id-123" ,
"webContentLink" : "https://drive.google.com/uc?id=file-id-123&export=download"
}
}
POST /mcp/google-drive/share_file
{
"oauth_token" : {
"token" : "ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"file_id" : "file-id-123",
"email" : "user@example.com",
"role" : "reader"
} :
"ya29.a0AfH6SMxxxxxxxxxxxxxx",
"refresh_token" : "1//0xxxxx",
"token_uri" : "https://oauth2.googleapis.com/token",
"client_id" : "xxx.apps.googleusercontent.com",
"client_secret" : "xxxxx",
"scopes" : [ "https://www.googleapis.com/auth/drive" ]
},
"file_id" : "file-id-123"
}
folders/{FOLDER_ID}
Example: folders/abc123xyz789def456
application/pdf — PDF document
application/vnd.google-apps.document — Google Docs
application/vnd.google-apps.spreadsheet — Google Sheets
application/vnd.openxmlformats-officedocument.wordprocessingml.document — Word Document
text/plain — Plain text file
Check parameter types match expected values (string, integer, etc.)
Server Not Found
Cause: Incorrect server name in the API endpoint
Solution:
Verify endpoint format: /mcp/{server-name}/{tool-name}
Use lowercase server name: /mcp/google-drive/...
Check available servers in documentation
OAuth Token Invalid or Expired
Cause: Token rejected by Google API or has expired
Solution:
Obtain a fresh OAuth token from Google
Verify token has all required scopes
Check token expiration and refresh if needed