Google Drive MCP
Enables Claude to read, create, update, and manage files in Google Drive through MCP tools.
README
Google Drive MCP Server
Connect Google Drive to Claude Code with a simple double-click setup. This MCP server allows Claude to read, create, update, and manage files in your Google Drive.
Prerequisites
- Python 3.10 or higher
- A Google Account (personal or Google Workspace)
- Google Cloud Console access
Step 1: Create Google Cloud Credentials
1.1 Create a Google Cloud Project
- Go to Google Cloud Console
- Click the project dropdown at the top of the page
- Click New Project
- Enter a project name (e.g., "Google Drive MCP")
- Click Create
- Wait for the project to be created, then select it
1.2 Enable the Google Drive API
- In the Google Cloud Console, go to APIs & Services > Library
- Search for "Google Drive API"
- Click on Google Drive API
- Click Enable
1.3 Configure OAuth Consent Screen
- Go to APIs & Services > OAuth consent screen
- Select External (or Internal if using Google Workspace)
- Click Create
- Fill in the required fields:
- App name: Google Drive MCP
- User support email: Your email
- Developer contact email: Your email
- Click Save and Continue
- On the Scopes page, click Add or Remove Scopes
- Add these scopes:
https://www.googleapis.com/auth/drive.readonlyhttps://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/drive
- Click Update, then Save and Continue
- On the Test users page, click Add Users
- Add your email address
- Click Save and Continue
1.4 Create OAuth Client ID
- Go to APIs & Services > Credentials
- Click Create Credentials > OAuth client ID
- Select Desktop app as the application type
- Enter a name (e.g., "Google Drive MCP Desktop")
- Click Create
- Click Download JSON on the popup
- Rename the downloaded file to
credentials.json - Place
credentials.jsonin the project root directory
Important: The credentials must be of type "Desktop app", not "Web application".
Step 2: Install Dependencies
Option A: Using Virtual Environment (Recommended)
# Clone the repository
git clone https://github.com/david-valdivia/GoogleDriveMCP.git
cd GoogleDriveMCP
# Create virtual environment (Python 3.10+ required)
python3 -m venv .venv
# Activate virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
.venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
Option B: Global Installation
pip install -r requirements.txt
Step 3: Run the Setup GUI
# With virtual environment activated
python -m src.main
This opens the setup window where you can:
- Select your permission level (Read Only, Read + Create, or Full Access)
- Click "Connect to Google" to authenticate
- Complete the OAuth flow in your browser
- Click "Configure MCP" to select a project directory for Claude Code
Step 4: Build the Executable (Optional)
Build a standalone executable that doesn't require Python:
# With virtual environment activated
python build/build.py
Build Output
| Platform | Output |
|---|---|
| macOS | build/dist/Google Drive MCP.app and build/dist/googledrive-mcp |
| Windows | build/dist/googledrive-mcp.exe |
| Linux | build/dist/googledrive-mcp |
macOS Additional Requirements
If building on macOS, you need Tcl/Tk for the GUI:
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Python with Tcl/Tk support
brew install python-tk@3.12
Step 5: Configure Claude Code
After authentication, the app automatically creates a .mcp.json file in your selected project directory. Alternatively, create it manually:
{
"mcpServers": {
"googledrive": {
"command": "/path/to/googledrive-mcp",
"args": ["--serve"]
}
}
}
Replace /path/to/googledrive-mcp with:
- Built executable: Full path to
googledrive-mcporgoogledrive-mcp.exe - From source: Full path to Python and script, e.g.:
{ "mcpServers": { "googledrive": { "command": "/path/to/.venv/bin/python", "args": ["/path/to/GoogleDriveMCP/src/main.py", "--serve"] } } }
Permission Levels
| Level | Scopes | Capabilities |
|---|---|---|
| Read Only | drive.readonly |
View and search files |
| Read + Create | drive.file |
Above + create new files |
| Full Access | drive |
Read, create, update, delete, share |
Available MCP Tools
| Tool | Description | Required Permission |
|---|---|---|
list_files |
List files in a folder or root | Read Only |
read_file |
Read file contents (exports Google Docs to text) | Read Only |
search_files |
Full-text search across Drive | Read Only |
list_folders |
List all folders for navigation | Read Only |
get_sharing_info |
View who has access to a file | Read Only |
create_file |
Create a new file or Google Doc | Read + Create |
create_folder |
Create a new folder | Read + Create |
update_file |
Update file contents | Full Access |
delete_file |
Move file to trash | Full Access |
move_file |
Move file to different folder | Full Access |
copy_file |
Copy a file | Full Access |
share_file |
Share file with email address | Full Access |
Development
Run Tests
# With virtual environment activated
pytest -v
Project Structure
GoogleDriveMCP/
├── src/
│ ├── main.py # Entry point, mode detection
│ ├── gui.py # Setup GUI with tkinter
│ ├── server.py # MCP server implementation
│ ├── drive.py # Google Drive API wrapper
│ ├── auth.py # OAuth flow and token management
│ └── config.py # Platform-specific config paths
├── tests/ # Test files
├── build/
│ ├── build.py # Build script
│ └── googledrive-mcp.spec # PyInstaller spec
├── credentials.json # Your OAuth credentials (not committed)
├── requirements.txt # Python dependencies
└── README.md
Token Storage Location
Tokens are stored in platform-specific locations:
| Platform | Location |
|---|---|
| macOS | ~/Library/Application Support/GoogleDriveMCP/ |
| Windows | %APPDATA%\GoogleDriveMCP\ |
| Linux | ~/.config/GoogleDriveMCP/ |
Troubleshooting
"credentials.json not found"
Make sure credentials.json is in the project root directory (same folder as src/).
"Error 400: redirect_uri_mismatch"
Your OAuth credentials are configured as "Web application" instead of "Desktop app". Create new credentials with type "Desktop app".
"Access blocked: This app's request is invalid"
- Make sure you added yourself as a test user in the OAuth consent screen
- Verify the app is in "Testing" mode (not "In production")
"ModuleNotFoundError: No module named 'tkinter'"
On macOS with Homebrew Python:
brew install python-tk@3.12
On Ubuntu/Debian:
sudo apt-get install python3-tk
MCP server not connecting in Claude Code
- Verify the path in
.mcp.jsonis correct and absolute - Restart Claude Code after creating/modifying
.mcp.json - Check that the executable has execute permissions:
chmod +x googledrive-mcp
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。