gdrive-mcp
A Model Context Protocol server that provides tools to search, list, and read files from Google Drive.
README
Google Drive MCP Server
A Model Context Protocol (MCP) server that provides tools to search, list, and read files from Google Drive. Use it with Claude Desktop, Cursor, or any MCP-compatible client.
Features
| Tool | Description |
|---|---|
search_drive |
Full-text search across file names and contents |
list_recent_files |
Show recently modified files |
get_file_content |
Download and return file content as text |
get_file_metadata |
Get detailed file information |
list_folder_contents |
Browse folder contents |
list_shared_with_me |
Files others have shared with you |
list_starred_files |
Your starred/important files |
get_file_comments |
Read comments and discussions on a file |
Prerequisites
- Python 3.11+
- A Google account with Google Drive access
Setup
1. Clone the Repository
git clone https://github.com/YOUR_USERNAME/gdrive-mcp.git
cd gdrive-mcp
2. Install Dependencies
pip install -r requirements.txt
3. Create Google OAuth Credentials
- Go to Google Cloud Console
- Create a new project (or select an existing one)
- Enable the Google Drive API:
- Go to APIs & Services → Library
- Search for "Google Drive API" → Click Enable
- Create OAuth credentials:
- Go to APIs & Services → Credentials
- Click + Create Credentials → OAuth client ID
- If prompted, configure the OAuth consent screen:
- User Type: External
- Add your email as a test user
- Application type: Desktop app
- Click Create
- Download the JSON file and save it as
client_secrets.jsonin the project root
4. Configure Your MCP Client
For Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"gdrive": {
"command": "python3",
"args": ["/path/to/gdrive-mcp/server.py"]
}
}
}
For Claude Desktop
Add to your Claude Desktop config:
{
"mcpServers": {
"gdrive": {
"command": "python3",
"args": ["/path/to/gdrive-mcp/server.py"]
}
}
}
Note: Replace /path/to/gdrive-mcp with the actual path where you cloned the repo.
5. Authenticate
On first use, the server will:
- Open a browser window for Google OAuth
- Ask you to sign in and grant "View files in Google Drive" permission
- Save the token to
token.jsonfor future use
Usage Examples
Once configured, you can ask your AI assistant:
- "Search my Google Drive for quarterly reports"
- "Show me files I've modified in the last 48 hours"
- "Get the content of file with ID xyz123"
- "List the contents of my Drive root folder"
File Structure
gdrive-mcp/
├── server.py # MCP server (main entry point)
├── requirements.txt # Python dependencies
├── client_secrets.json # Your OAuth credentials (do not commit!)
├── client_secrets.example.json # Template for credentials
├── token.json # Auth token (auto-generated, do not commit!)
├── README.md # This file
└── _tools/ # Standalone CLI scripts (optional)
├── gdrive_download.py
└── gdrive_recent.py
Security Notes
- Never commit
client_secrets.jsonortoken.json— they contain sensitive credentials - Each user must create their own Google Cloud project and OAuth credentials
- The server only requests read-only access (
drive.readonlyscope)
Troubleshooting
"Access blocked" error during OAuth
- Go to Google Cloud Console → APIs & Services → OAuth consent screen
- Add your email to Test Users
Token expired
- Delete
token.jsonand restart the server to re-authenticate
Module not found errors
- Ensure you're using the same Python that has the dependencies installed
- Try using the full path to Python:
/usr/bin/python3or similar
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
E2B
Using MCP to run code via e2b.