
Gmail
io.github.domdomegg由 GitHub 账号 domdomegg 发布v2.4.0更新于 Oct 24, 2026
Allow AI systems to read, send, archive, and manage emails via Gmail.
概览
本地 MCP 服务器,让助手读取、搜索、发送、归档和管理 Gmail 邮件、会话、草稿、标签、过滤器和假期自动回复设置。
- 可以做什么
- 读取账号资料,搜索或列出邮件与会话,并获取完整会话或单封邮件。
- 发送、转发、加标签、归档、移入回收站、恢复或永久删除邮件与会话,包括批量操作。
- 创建、更新、发送和删除草稿。
- 管理标签和过滤器,并下载附件。
- 读取和设置假期自动回复。
- 适用场景
- 适合让助手直接在 Gmail 收件箱中工作:查找确认邮件、收据或附件,起草并发送回复,用标签和归档整理邮件,或在休假时开启自动回复。
- 运行要求
- 通过 npx 在本地运行(需要 Node.js)。需要启用 Gmail API 的 Google Cloud OAuth 凭据:GOOGLE_CLIENT_ID、GOOGLE_CLIENT_SECRET 和 GOOGLE_ACCESS_TOKEN,以及 MCP_TRANSPORT。README 说明以 HTTP 服务器方式运行在 localhost:3000,并需注册 Google OAuth 重定向 URI。
安装
在 SourceWeft 中
- 打开 控制台中的 Gmail,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
gmail-mcp
MCP server for Gmail - read, send, archive, and manage emails.
Use Cases
Flight check-in: "Check me in for my flight tomorrow" → finds your confirmation email, extracts the booking reference, and completes check-in with browser use.
Expense submission: "Submit my Amazon purchases from last week as expenses" → finds receipts, extracts amounts/categories, and files them in your expense system.
Package tracking: "Where's my package from Acme?" → finds the shipping notification, extracts the tracking number, and fetches current delivery status.
Find that attachment: "What did we settle on for the budget? Michelle sent me something yesterday" → locates the email and opens the attached spreadsheet.
Vacation mode: "I'm on holiday Dec 20-Jan 2" → sets up Gmail auto-reply, blocks your calendar, and updates your Slack status in one go.
Meeting follow-up: After a call, your assistant reads the Gemini transcript, summarizes key decisions, and drafts a follow-up email with action items.
(These are just examples - any workflow that needs email search, reading, or sending can use this.)
Setup
1. Create Google OAuth credentials
- Go to Google Cloud Console
- Create a new project (or use existing)
- Enable the Gmail API
- Go to APIs & Services → OAuth consent screen, set up consent screen
- Go to APIs & Services → Credentials → Create Credentials → OAuth client ID
- Choose Web application
- Add
http://localhost:3000/callbackto Authorized redirect URIs - Note your Client ID and Client Secret
2. Run the server
The server runs on http://localhost:3000 by default. Change with PORT=3001.
3. Add to your MCP client
With the server running, follow the instructions on install-mcp, which generates the right config for your MCP client (Claude Code, Claude Desktop, Cursor, Cline, VS Code, and more).
Architecture
This server acts as an OAuth proxy to Google:
- Server advertises itself as an OAuth authorization server via
/.well-known/oauth-authorization-server /registerreturns the Google OAuth client credentials/authorizeredirects to Google, encoding the client's callback URL in state/callbackreceives the code from Google and forwards to the client's callback/tokenproxies token requests to Google, injecting client credentials/mcphandles MCP requests, using the bearer token to call Gmail API
The server holds no tokens or state - it just proxies OAuth to Google.
Tools
Gmail API Scopes
gmail.readonly- Read messages and labelsgmail.send- Send messagesgmail.modify- Modify messages (archive, labels, trash)
Contributing
Pull requests are welcomed on GitHub! To get started:
- Install Git and Node.js
- Clone the repository
- Install dependencies with
npm install - Run
npm run testto run tests - Build with
npm run build
Releases
Versions follow the semantic versioning spec.
To release:
- Use
npm version <major | minor | patch>to bump the version - Run
git push --follow-tagsto push with tags - Wait for GitHub Actions to publish to the NPM registry.
来源:README.md,提交 32103e7
工具
0版本历史
1- v2.4.0最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。