Enables searching, retrieving, and managing files in Google Drive, including searching files with query syntax, getting file metadata, listing folder contents, moving files between folders, and creating new folders.
Google Drive MCP Server
An MCP (Model Context Protocol) server that enables searching, retrieving, and managing files in Google Drive. Designed to run as a Google Cloud Function.
Features
search_files - Search for files using Google Drive query syntax
get_file_metadata - Get detailed metadata for a specific file
list_folder - List files in a folder
move_file - Move a file to a different folder
create_folder - Create a new folder
Prerequisites
A Google Cloud project with the Drive API enabled
A service account with access to the files you want to query
Google Cloud CLI (
gcloud) installed and configured
Setup
1. Create a Service Account
2. Share Files/Folders
Share your Google Drive files or folders with the service account email:
Grant "Editor" permission to allow moving files, or "Viewer" for read-only access.
3. Install Dependencies
4. Build
Deploy to Google Cloud Functions
MCP Client Configuration
Tool Usage
search_files
Search for files using Google Drive query syntax:
Common query examples:
name contains 'budget'- Files with "budget" in the namemimeType = 'application/pdf'- PDF files onlyfullText contains 'quarterly'- Files containing "quarterly" in contentmodifiedTime > '2024-01-01'- Files modified after Jan 1, 2024'folder_id' in parents- Files in a specific folder
get_file_metadata
Get detailed metadata for a file:
list_folder
List files in a folder:
Use "root" for the root folder, or a specific folder ID.
move_file
Move a file to a different folder:
This removes the file from its current parent folder(s) and places it in the specified destination folder.
create_folder
Create a new folder:
The parentId is optional. If not specified, the folder is created in the root of the shared drive or the service account's root.
License
MIT