Google MCP Server
A locally-hosted MCP server that integrates Gmail, Google Calendar, and Google Drive to provide AI-powered management of emails, events, and files. It enables tool-based interactions like sending emails, creating calendar events, and searching Drive files through clients like Cursor and Claude Desktop.
README
Google MCP Server
A locally-hosted MCP server built with FastMCP 3.x that connects to your personal Google account and exposes Gmail, Google Calendar, and Google Drive as tools.
Available Tools
| Service | Tool | Description |
|---|---|---|
| Gmail | list_emails |
List recent emails from a label |
| Gmail | read_email |
Read full content of an email |
| Gmail | send_email |
Send a new email |
| Gmail | search_emails |
Search emails with Gmail query syntax |
| Calendar | list_calendars |
List all accessible calendars |
| Calendar | list_events |
List upcoming events |
| Calendar | create_event |
Create a new calendar event |
| Drive | list_files |
List files (optionally in a folder) |
| Drive | read_file |
Read text content of a file |
| Drive | search_files |
Search for files by name or query |
Prerequisites
- Python 3.10+
- A Google account
- A Google Cloud project with OAuth 2.0 credentials
Setup
1. Install dependencies
# Using pip
pip install -e .
# Or using uv
uv pip install -e .
2. Set up Google Cloud credentials
- Go to the Google Cloud Console
- Create a new project (or select an existing one)
- Enable the following APIs:
- Configure the OAuth consent screen:
- Go to APIs & Services → OAuth consent screen
- Choose External user type
- Fill in the required fields (app name, support email)
- Add your email address as a test user
- Create OAuth 2.0 credentials:
- Go to APIs & Services → Credentials
- Click + CREATE CREDENTIALS → OAuth client ID
- Application type: Desktop app
- Download the JSON file and save it as
credentials.jsonin the project root
3. (Optional) Configure environment
Copy the example env file and adjust paths if needed:
cp .env.example .env
The defaults (credentials.json and token.json in the project root) work for most setups.
Running the Server
stdio transport (for Cursor / Claude Desktop)
python server.py
On first run, a browser window will open asking you to sign in with your Google account and grant permissions. The token is cached in token.json for subsequent runs.
HTTP transport (for remote/browser clients)
fastmcp run server.py:mcp --transport http --port 8000
The server will be available at http://localhost:8000/mcp.
Connecting to Cursor
Add this to your Cursor MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"google": {
"command": "python",
"args": ["server.py"],
"cwd": "/path/to/mcp-playground"
}
}
}
Connecting to Claude Desktop
Add this to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"google": {
"command": "python",
"args": ["/path/to/mcp-playground/server.py"]
}
}
}
Google API Scopes
This server requests the following OAuth scopes (narrowly scoped for safety):
| Scope | Access |
|---|---|
gmail.readonly |
Read-only access to Gmail |
gmail.send |
Send emails only |
calendar.events |
Read and write calendar events |
drive.readonly |
Read-only access to Drive files |
If you change scopes in auth/google_auth.py, delete token.json and re-authenticate.
Project Structure
mcp-playground/
├── server.py # FastMCP server entry point
├── auth/
│ └── google_auth.py # OAuth2 flow + service builders
├── tools/
│ ├── gmail.py # Gmail tools
│ ├── calendar.py # Calendar tools
│ └── drive.py # Drive tools
├── pyproject.toml # Dependencies
├── .env.example # Environment config template
└── README.md
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。