google-mcp-server
An MCP server that enables AI assistants to read, search, and act on Google Workspace services including Gmail, Drive, Docs, YouTube, and Calendar.
README
Google MCP Server — AI agent for Gmail, Drive, Docs, YouTube & Calendar
This is an MCP (Model Context Protocol) server that lets an AI assistant read, search, and act on your Google Workspace account. It works with any MCP-compatible client (Claude, VS Code, Cursor, custom apps, etc.).
What it can do
Gmail
- Show your email address
- Read unread messages from your inbox
- Search emails by keyword, sender, date, etc.
- Get the full content of any email by ID
- List all your Gmail labels
- Send emails
- Bulk-modify messages matching a Gmail query (archive, mark read/unread, star, label, or trash)
Google Drive
- List files you have access to
- Search files by name
- Read text content of documents, spreadsheets, or files
- See file metadata (size, owner, dates)
- Browse recently modified files
- List what's inside a folder
Google Docs
- Read the full content of a document
- List your recent documents
- Get a summary (title, ID, revision, paragraph count)
- Search for specific text inside a document
YouTube
- Search for videos
- Get video details (views, likes, duration, description)
- List your subscriptions
- Get info on any channel
- Show your own channel stats
- List your playlists
- Download videos to local storage (mp4, webm, audio-only)
- List all videos from any channel (by URL, @username, or channel ID)
- Download entire channels (all videos from a channel to local disk)
Google Calendar
- List upcoming events
- Search events by keyword
- Show today's schedule
- Show this week's schedule
- List all your calendars
- Get event details by ID
Quick Start (one-time setup)
# 1. Run the setup script (installs everything automatically):
bash setup.sh
# 2. Activate the virtual environment:
source .venv/bin/activate
# 3. Run the interactive OAuth setup (opens a browser tab):
python -m vertex auth
What happens: A browser opens, you sign into Google, grant permissions, and credentials get saved to .env automatically.
Alternative: Manual credential setup
If you already have Google Cloud credentials:
- Create an OAuth 2.0 Desktop Client ID at https://console.cloud.google.com/apis/credentials
- Download the JSON and save it as
client_secrets.jsonin the project root - Run
python -m vertex auth - Or manually add to
.env(see.env.example)
How to use it
Check your credentials work
python -m vertex verify
This tests connectivity to all 5 Google APIs. You'll see checkmarks or errors for each one.
Start the server
# Option A — using the module directly:
python -m vertex
# Option B — using the installed command:
google-mcp-server
The server starts and listens for MCP connections from your AI client.
Run the OAuth flow again
python -m vertex auth
Available CLI commands
| Command | What it does |
|---|---|
python -m vertex |
Start the MCP server (default) |
python -m vertex auth |
Run the OAuth consent flow to get/renew a refresh token |
python -m vertex verify |
Check your credentials work with all Google APIs |
YouTube Video & Live Stream Downloads
Simple downloader - just paste a YouTube link!
./download_youtube.py
Supports:
- ✅ Single video downloads (any quality)
- ✅ Live streams (current/ongoing)
- ✅ Past live streams
- ✅ Audio extraction (MP3)
See YOUTUBE_QUICK_START.md for usage guide.
Email Cleanup Helper
Clean up newsletters, promotions, and mass emails safely:
# See what can be cleaned up
python cleanup_emails.py stats
# Stage emails for review (adds _Review label)
python cleanup_emails.py stage
# Review what was labeled
python cleanup_emails.py review
# Delete confirmed emails
python cleanup_emails.py delete
See EMAIL_CLEANUP_GUIDE.md for detailed instructions.
Running tests
# Unit tests (no internet needed, ~15s):
python -m pytest tests/unit/ -q
# Integration tests (requires real Google credentials):
python -m pytest tests/integration/test_real_connection.py -v
# All tests:
python -m pytest tests/ -q
# Shell-based CLI tests:
bash tests/scripts/test_cli.sh
How it works
The server is built on the Model Context Protocol — a standard that lets AI tools communicate with external services. When an AI assistant calls a tool (like gmail_list_unread), the server:
- Gets the right OAuth credentials for that service
- Makes the Google API call
- Returns the result as readable text
- The AI reads it and can use it in its response or chain more calls
The server handles authentication automatically using saved refresh tokens — no need to re-authorize each time.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。