Multi Gmail Mcp

io.github.gx-55由 GitHub 账号 gx-55 发布v1.0.1更新于 Oct 24, 2026

Manage multiple Gmail accounts in Claude Desktop — search, send, reply, draft, and organize.

已验证STDIO仅桌面效率与工作流沟通与协作

概览

AI 生成的概览

一个本地 MCP 服务器,让 Claude Desktop 管理多个 Gmail 账户:搜索、读取、发送、回复、起草和整理邮件。

可以做什么
账户管理:列出已认证的 Gmail 账户、发起并完成 OAuth 登录、移除账户及其保存的凭据。读取邮件:用 Gmail 搜索语法检索任意收件箱,并按消息 ID 获取完整内容。撰写邮件:发送、在会话中回复、保存草稿。整理邮件:列出、添加和移除标签,归档邮件,标记已读或未读。
适用场景
适合同时使用多个 Gmail 账户(个人、工作、副业项目),希望助手在一处搜索、汇总、回复或整理邮件时使用。
运行要求
通过 npm 包 multi-gmail-mcp 以 stdio 在本地运行;需要 Node.js 22.5.0 或更高版本以及 Claude Desktop。需要一个启用 Gmail API 的 Google Cloud 项目和一个桌面应用 OAuth 凭据,保存为本地 JSON 文件,或通过 GOOGLE_CLIENT_ID 和 GOOGLE_CLIENT_SECRET 环境变量提供。每个账户需在浏览器中认证一次。
安装前请注意
会在用户主目录中保存 Google OAuth 凭据和各账户令牌,客户端密钥也可能写入 Claude Desktop 配置。申请的权限允许读取、发送和修改邮件,因此助手可以发送、回复、归档和更改标签。在允许其发送或删除前请检查提示内容,并可通过移除账户来撤销已保存的令牌。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Multi Gmail Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

multi-gmail-mcp

A Model Context Protocol (MCP) server that lets Claude Desktop manage multiple Gmail accounts simultaneously. Listed on the official Anthropic MCP registry and published on npm.

[demo]


Features

  • Connect unlimited Gmail accounts — personal, work, side projects
  • Search any inbox using full Gmail search syntax
  • Read complete emails with MIME parsing
  • Send, reply in thread, and create drafts
  • Organize with labels: add, remove, list, archive
  • Mark as read / unread
  • Tokens stored locally in ~/.gmail-mcp-tokens.db — never committed to git
  • Auto-refreshes OAuth tokens silently

Requirements

  • Node.js >= 22.5.0
  • A Google Cloud project with the Gmail API enabled
  • Claude Desktop

Installation

bash
npm install -g multi-gmail-mcp

This registers two global commands: gmail-mcp (the MCP server) and gmail-mcp-cli (account manager).


Google Cloud Setup

You only need to do this once.

  1. Go to console.cloud.google.com → create a project
  2. Enable the Gmail API (APIs & Services → Library)
  3. Configure the OAuth consent screen — External, add your Gmail addresses as test users
  4. Add scopes: gmail.readonly, gmail.send, gmail.modify, gmail.labels
  5. Create a Desktop app OAuth credential → download the JSON
  6. Save it to ~/.gmail-mcp-oauth.json

Alternatively, set environment variables in the Claude Desktop config (see below).


Authenticating Gmail Accounts

bash
# Add accounts (opens browser for Google sign-in)gmail-mcp-cli add [email protected]gmail-mcp-cli add [email protected]
# List authenticated accountsgmail-mcp-cli list
# Remove an accountgmail-mcp-cli remove [email protected]

Tokens are saved to ~/.gmail-mcp-tokens.db and refreshed automatically.


Claude Desktop Configuration

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "multi-gmail": {      "command": "gmail-mcp"    }  }}

If you prefer environment variables over ~/.gmail-mcp-oauth.json:

json
{  "mcpServers": {    "multi-gmail": {      "command": "gmail-mcp",      "env": {        "GOOGLE_CLIENT_ID": "your-client-id.apps.googleusercontent.com",        "GOOGLE_CLIENT_SECRET": "your-client-secret"      }    }  }}

Restart Claude Desktop after saving. Click the hammer icon to confirm 19 tools are loaded.


Available Tools

Account Management

ToolDescription
list_accountsList all authenticated Gmail accounts
initiate_authStart OAuth flow — returns a URL to open in browser
complete_authFinalize auth after completing Google sign-in
remove_accountRemove an account and its stored credentials

Reading Email

ToolDescription
search_emailsSearch with Gmail syntax (is:unread, from:, after:, etc.)
get_emailFetch full email content by message ID

Writing Email

ToolDescription
send_emailSend an email (supports To, CC, BCC)
reply_to_emailReply in thread, preserving References headers
create_draftSave an email as a draft

Organization

ToolDescription
list_labelsList all Gmail labels for an account
add_labelAdd one or more labels to a message
remove_labelRemove one or more labels from a message
archive_emailRemove from Inbox
mark_as_readRemove the UNREAD label
mark_as_unreadAdd the UNREAD label

Example Prompts

List all my authenticated Gmail accounts.
Search my [email protected] inbox for unread emails from this week.
Reply to that email from my personal account saying I'll be there Saturday.
Send an email from [email protected] to [email protected]with subject "Dinner plans" and body "Are you free Saturday?"
Archive everything older than a week in my side-project inbox that's already read.
Check both my accounts for emails from GitHub and summarize them.

Security

  • ~/.gmail-mcp-oauth.json and ~/.gmail-mcp-tokens.db live in your home directory — outside the project, never committed
  • .gitignore excludes *.db, .gmail-mcp-oauth.json, and .env
  • The server runs over stdio only — no network port is opened
  • OAuth scopes are limited to the minimum required

See SECURITY.md for full details: token storage, network behavior, scope rationale, revocation steps, and how to report a vulnerability.


Registry

Listed on the official Anthropic MCP registry:

io.github.gx-55/multi-gmail-mcp
bash
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.gx-55"

Project Structure

multi-gmail-mcp/├── bin/│   ├── gmail-mcp.js        # Entry point for the MCP server command│   └── gmail-mcp-cli.js    # Entry point for the CLI command├── src/│   ├── server.js           # MCP server — all 19 tools│   ├── gmail-client.js     # Gmail API wrapper│   ├── auth.js             # OAuth2 flow with auto-refresh│   ├── db.js               # SQLite token storage (node:sqlite)│   └── cli.js              # Account management CLI└── package.json

Troubleshooting

"No OAuth credentials found" Make sure ~/.gmail-mcp-oauth.json exists or set GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET in the Claude Desktop config.

"Account not found. Authenticate it first" Run gmail-mcp-cli add [email protected] before using that account in Claude.

Tools not appearing in Claude Desktop Confirm gmail-mcp is in your PATH (which gmail-mcp) and restart Claude Desktop.

Token expired errors Tokens auto-refresh if a valid refresh token is stored. If refresh fails, remove the account and re-authenticate: gmail-mcp-cli remove [email protected] && gmail-mcp-cli add [email protected].

来源:README.md,提交 7c28cb2

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分