Gmail MCP
Gmail 多账户管理平台
允许 Claude 从您的 Gmail 帐户搜索和检索电子邮件。
设置
1.获取 Google API 凭证
创建新项目或选择现有项目
为您的项目启用 Gmail API
导航至“API 和服务”>“库”
搜索“Gmail API”并启用它
创建 OAuth 凭证:
前往“API 和服务”>“凭证”
点击“创建凭证”>“OAuth 客户端 ID”
选择“桌面应用程序”作为应用程序类型
为您的客户命名并点击“创建”
下载凭证 JSON 文件
将其保存为项目目录中的
credentials.json
2.授权应用程序
运行授权命令来生成您的令牌:
uv run gmail-mcp auth --creds-path credentials.json --token-path token.json这将打开一个浏览器窗口,您需要在其中登录您的 Google 帐户并授予必要的权限。授权后,将在您的项目目录中创建一个token.json文件。
Related MCP server: Gmail MCP Server
使用 Claude 进行配置
将 Gmail MCP 服务器添加到您的 Claude 配置文件中:
{
"mcpServers": {
"gmail": {
"args": [
"--from",
"git+https://github.com/vinayak-mehta/gmail-mcp",
"gmail-mcp"
],
"command": "/Users/username/.local/bin/uvx",
"env": {
"GMAIL_CREDS_PATH": "/Users/username/path/to/gmail-mcp/credentials.json",
"GMAIL_TOKEN_PATH": "/Users/username/path/to/gmail-mcp/token.json"
}
}
}
}请确保:
将
/Users/username/path/to/gmail-mcp替换为您的实际项目路径调整已安装的
uvx可执行文件的command路径提供
credentials.json和token.json文件的正确路径
克劳德现在可以使用以下工具:
1. 搜索电子邮件
在您的 Gmail 帐户中搜索电子邮件。
示例提示: “搜索来自example@gmail.com的所有电子邮件”
2. 获取电子邮件内容
检索特定电子邮件的完整内容。
提示示例: “显示主题为‘明天开会’的电子邮件的完整内容”
3. 列出消息
列出您的 Gmail 收件箱中的最新消息。
提示示例: “列出我最近的 5 封电子邮件”
环境变量
您可以使用环境变量配置凭证和令牌文件的路径:
GMAIL_CREDS_PATH:您的 credentials.json 文件的路径GMAIL_TOKEN_PATH:token.json 文件的路径
使用这些变量在项目根目录中创建一个.env文件,以便于配置。
This server cannot be deployed
Maintenance
Related MCP Connectors
Email infrastructure for AI agents — send, receive, search, and reply to email over MCP.
A MCP server for Gmail that lets you search, read, and draft emails and replies.
Connect any mailbox to Claude, ChatGPT & AI: read, send, reply, schedule & search emails.
Email inboxes and calendars for AI agents: send, receive, search, draft and schedule.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceServer for Gmail integration in Claude Desktop with auto authentication support. This server enables AI assistants to manage Gmail through natural language interactions.14,617 npm1,167MIT
- AlicenseNot gradedqualityDmaintenanceAn integration server that provides Claude Desktop access to Gmail, enabling users to view recent emails and search their Gmail inbox using natural language commands.8MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables Claude AI to interact with Gmail, supporting email sending, reading, searching, labeling, draft management, and batch operations through natural language commands.2MIT
- -licenseNot gradedqualityNot gradedmaintenanceA Model Context Protocol server that enables Claude to interact with Gmail through a secure OAuth2 connection, providing email management capabilities like listing, sending, deleting, and organizing emails.-