# Google Drive MCP

> Google Drive connects your cloud storage directly to your AI agent. Use natural language to search, manage, and organize your files. You can find specific documents, adjust sharing permissions, create new folders, or export Sheets/Docs to PDF—all without opening the web browser.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** file-search, cloud-sync, document-sharing, file-permissions, version-control

## Description

**Google Drive MCP Server - Manage Files with AI**

**Google Drive** connects your cloud storage directly to your AI agent. You'll use natural language to search, manage, and organize your files. You don't need to open the web browser or click around. Your AI agent handles everything.

**Search and Locate Files**

Your agent searches your entire drive using natural language queries, returning a list of matching files and their metadata via `list_files`. You can get detailed info on any single file using `get_file_metadata`. You can also check out the full revision history for a document, seeing who changed it and when, using `list_revisions`. You'll know your Google Drive quota and current usage status by calling `get_drive_about`.

**Structure Folders and Files**

Your agent creates new folders or files using `create_file`. It'll make a duplicate copy of any file you specify with `copy_file`. You can change a file's metadata or actual content using `update_file`, and you'll move files to the trash bin with `delete_file`. When you're done, you can permanently wipe out everything in the trash using `empty_trash`.

**Change Sharing Rights**

Your agent checks who has access to a file using `list_permissions`. You can share a file with a specific email address or group using `create_permission`.

**Export File Content**

You can convert Google Docs, Sheets, or Slides into formats like PDF or CSV using `export_file`. You can also search and list files across your drive based on specific keywords or criteria using `list_files`.

## Tools

### copy_file
Creates a duplicate copy of a specified file.

### create_file
Makes a new file or folder (metadata only).

### create_file_comment
Add a comment to a file

### create_permission
Shares a file with a specific email address or group.

### delete_file
Moves a file to the trash bin.

### empty_trash
Permanently deletes all items currently in your trash.

### export_file
Converts a Google Doc or Sheet into a specific file format, like PDF.

### get_drive_about
Retrieves overall information about your Google Drive account, such as quota usage.

### get_file_metadata
Retrieves detailed information about a single, specific file.

### list_file_comments
List all comments on a file

### list_files
Searches and lists files within your Google Drive based on criteria or keywords.

### list_permissions
Checks and lists all people who have access to a given file.

### list_revisions
Views the complete history of changes and versions for a document.

### search_files
g. "name contains 'report' and mimeType='application/pdf'"

Search for files using Google Drive query syntax

### update_file
Changes the metadata or actual content of an existing file.

## Prompt Examples

**Prompt:** 
```
Find all spreadsheets I created in the last 30 days.
```

**Response:** 
```
Searching files... I found 4 spreadsheets created last month: 'Budget_Q2.xlsx', 'User_Feedback_Raw', 'Inventory_April', and 'Campaign_Results'. Would you like the metadata for any of these?
```

**Prompt:** 
```
Who has access to the file 'Confidential_Roadmap'?
```

**Response:** 
```
Checking permissions... The file 'Confidential_Roadmap' is shared with 3 people: Marcus R. (Owner), Sarah P. (Editor), and Mike T. (Viewer). It is NOT shared publicly.
```

**Prompt:** 
```
Create a new folder named 'Project Apollo Assets'.
```

**Response:** 
```
Creating folder... Success! I've created the folder 'Project Apollo Assets' in your root directory. The folder ID is FOLDER-93021.
```

## Capabilities

### Search and Locate Files
The agent searches your entire drive using natural language queries, returning a list of matching files and their metadata.

### Structure Folders and Files
The agent creates new folders or files, and can copy existing files to new locations.

### Change Sharing Rights
The agent checks existing permissions or adds/removes access for specific users or groups.

### View Document History
The agent retrieves a detailed list of revisions, showing who changed a document and when.

### Export File Content
The agent converts Google Docs, Sheets, or Slides into formats like PDF or CSV.

### Audit Drive Status
The agent checks your Google Drive quota and current usage status.

## Use Cases

### Project Handover Cleanup
A PM needs to hand off a project folder. They ask their agent to 'List all files in the Project X folder that haven't been updated in 90 days.' The agent runs `list_files`, letting the PM audit and then using `delete_file` on outdated assets.

### Compliance Audit
Legal asks who can view the 'Client Agreement' file. The agent runs `list_permissions`, showing the exact list of users and their roles (Owner, Editor, Viewer). This confirms compliance without opening the file.

### Report Generation
A marketing manager needs a final report. They tell the agent to 'Export the Q4 budget sheet to PDF.' The agent uses `export_file` to deliver the required format directly to the chat context.

### Troubleshooting Missing Assets
An engineer can't find the latest version of a document. They ask the agent to 'Show me the three latest revisions for the API spec.' The agent uses `list_revisions` to pinpoint the exact, correct version.

## Benefits

- Find misplaced files instantly. Instead of clicking through nested folders, ask your agent to 'Find all PDFs from last week.' The `list_files` tool handles the deep search, giving you immediate results.
- Control document access without logging into Drive. Use `create_permission` to grant or revoke access to a specific user, checking who has access first with `list_permissions`—all in one conversation.
- Process complex documents quickly. Need a PDF version of a spreadsheet? The `export_file` tool converts Docs, Sheets, and Slides into PDF or CSV formats with a single command.
- Maintain a clean file structure. Use `create_file` or `copy_file` to build out new project folders and assets, ensuring everything is properly organized from the start.
- Audit and track changes. Use `list_revisions` to see the full history of a document, and `get_file_metadata` to check its current details. You never lose track of who changed what.
- Handle cleanup tasks. If you need to permanently delete old assets, `delete_file` moves the item to trash, and `empty_trash` clears the bin permanently.

## How It Works

The bottom line is, your AI agent executes file operations directly against your Google Drive API using the tools provided, without you ever leaving your chat interface.

1. Subscribe to the server and enter your Google OAuth credentials.
2. Complete the secure Google authorization flow to link the service to your Drive account.
3. Your AI client sends a command (e.g., 'List all PDFs from last week') to the MCP server, which executes the necessary tool.

## Frequently Asked Questions

**How do I use the `list_files` tool to find specific document types?**
You ask your agent to list files, specifying criteria like 'Show me all spreadsheets from last month.' The agent uses `list_files` to filter by type and date, providing a targeted list.

**Does `create_permission` only add users, or can it remove access?**
The `create_permission` tool manages sharing. You can use it to both add access and remove permissions for specific emails or groups.

**Can I use `export_file` on any Google Doc or Sheet?**
Yes, the `export_file` tool is designed to convert Google Docs, Sheets, and Slides into various formats, like PDF or CSV.

**What's the difference between `list_files` and `get_file_metadata`?**
Use `list_files` when you need a broad search across many files. Use `get_file_metadata` when you already have the specific file ID and need deep details on just that one file.

**How do I check the document history using `list_revisions`?**
Simply ask the agent to check the revisions for a file ID. The agent executes `list_revisions` and returns a log showing every change, who made it, and when.

**How does `get_file_metadata` help me check file ownership or size?**
It provides detailed information about the file. Specifically, it returns the file owner's email, the file size in bytes, and creation/modification timestamps.

**What happens if I try to use `delete_file` on a file that is currently shared?**
The tool moves the file to the trash, regardless of its sharing status. However, if you are the owner, you must empty the trash using `empty_trash` to permanently remove it.

**Can I use `create_file` to build a structured folder hierarchy?**
Yes, you can. The `create_file` tool allows you to create both files and folders. You simply need to provide the parent folder's ID when you call the tool.

**Can I search for files by their content, not just their name?**
Yes! The `list_files` tool uses Google Drive's powerful search engine. You can use queries like 'fullText contains "marketing plan"' to find files based on the text inside them.

**How do I share a file with someone using the AI agent?**
Use the `create_permission` tool. You just need to provide the File ID, the person's email address, and the role you want to grant (e.g., 'reader', 'commenter', or 'writer').

**Can I export a Google Sheet to a PDF through the chat?**
Yes. The `export_file` tool allows you to specify a Google Doc/Sheet/Slide ID and a target MIME type like `application/pdf`. The agent will initiate the export for you.