G5

gx-55/multi-gmail-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

19 stars 12 forks 质量 79 趋势 30MIT

一个模式背景协议(MCP)服务器,可以同时允许. 在官方Anthropic MCP登记册上被列出,并在npm上公布.

概览

一个模式背景协议(MCP)服务器,可以同时允许. 在官方Anthropic MCP登记册上被列出,并在npm上公布. - 连接 - 个人, 工作, 侧边项目 - 任何使用全 Gmail 搜索语法的收件箱 - 有 MIME 解析的完整电子邮件 -, 和 - 有标签 : 添加, 删除, 列表, 存档 - - 本地存储的 ~. gmail- mcp- tokens.db - 从未承诺 git - 自动刷新 OAuth 令牌 - 节点.js... 22.5.0 - Google Cloud项目,Gmail API启用 - Claude桌面 这注册了两个全局命令:gmail-mcp(MCP服务器)和gmail-mcp-cli(账户管理器). 1. Go to Coper.cloud.google.com → 创建项目 2. 启用(APIs & Services → 库) 3. 配置——外部,将您的Gmail地址添加为测试用户 4. 添加范围: gmail. read only, gmail. send, gmail. modify, gmail. labels (中文(简体) ). 5. 创建OAuth证书 –下载JSON 6. 保存到 ~/.gmail-mcp-oauth 中.

概述(AI 翻译)

一个模式上下文协议(MCP)服务器,允许 ** Claude Desktop 同时管理多个Gmail账户**. 在官方Anthropic MCP登记册上被列出,并在npm上公布.

– – . . .

□ 特性

  • 连接** 无限Gmail账户**——个人、工作、附带项目
  • ** 搜索** 任何使用完整 Gmail 搜索语法的收件箱
  • ** 读取** 完整的电子邮件,其中包含MIME解析
  • ** 发送**、** 重写和 创建草稿**
  • ** 组织** 标签:添加、删除、列表、存档
  • ** 标记为已读/未读**
  • [[T0] 当地储存的托肯斯——从未承诺
  • 自动刷新 OAuth 符号默默地

– – . . .

□ 要求

  • 节点.js 22.5.0
  • Google Cloud项目,Gmail API启用
  • 克劳德桌面

– – . . .

□ 安装

这登记了两个全局命令:[[T1] (MCP服务器)和[[T2] (账户管理器)。

– – . . .

□ 谷歌云设置

你只需要这样做一次。

  1. go to control.cloud.google.com-创建项目.
  2. 启用 Gmail API(APIs & Services ~ 图书馆)
  3. 配置 ** OAuth 同意屏幕 ** — 外部, 添加您的 Gmail 地址作为测试用户
  4. 增加范围:[[T3]、[T4]、[[T5]、`gmail.

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 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.


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

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

# Add accounts (opens browser for Google sign-in)
gmail-mcp-cli add [email protected]
gmail-mcp-cli add [email protected]

# List authenticated accounts
gmail-mcp-cli list

# Remove an account
gmail-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:

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

If you prefer environment variables over ~/.gmail-mcp-oauth.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

Tool Description
list_accounts List all authenticated Gmail accounts
initiate_auth Start OAuth flow — returns a URL to open in browser
complete_auth Finalize auth after completing Google sign-in
remove_account Remove an account and its stored credentials

Reading Email

Tool Description
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

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