Skip to main content
Glama

Gmail MCP

Gmail 多账户管理平台

允许 Claude 从您的 Gmail 帐户搜索和检索电子邮件。

设置

1.获取 Google API 凭证

  1. 访问Google Cloud Console
  2. 创建新项目或选择现有项目
  3. 为您的项目启用 Gmail API
    • 导航至“API 和服务”>“库”
    • 搜索“Gmail API”并启用它
  4. 创建 OAuth 凭证:
    • 前往“API 和服务”>“凭证”
    • 点击“创建凭证”>“OAuth 客户端 ID”
    • 选择“桌面应用程序”作为应用程序类型
    • 为您的客户命名并点击“创建”
  5. 下载凭证 JSON 文件
  6. 将其保存为项目目录中的credentials.json

2.授权应用程序

运行授权命令来生成您的令牌:

uv run gmail-mcp auth --creds-path credentials.json --token-path token.json

这将打开一个浏览器窗口,您需要在其中登录您的 Google 帐户并授予必要的权限。授权后,将在您的项目目录中创建一个token.json文件。

使用 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.jsontoken.json文件的正确路径

克劳德现在可以使用以下工具:

1. 搜索电子邮件

在您的 Gmail 帐户中搜索电子邮件。

示例提示: “搜索来自example@gmail.com的所有电子邮件”

2. 获取电子邮件内容

检索特定电子邮件的完整内容。

提示示例: “显示主题为‘明天开会’的电子邮件的完整内容”

3. 列出消息

列出您的 Gmail 收件箱中的最新消息。

提示示例: “列出我最近的 5 封电子邮件”

环境变量

您可以使用环境变量配置凭证和令牌文件的路径:

  • GMAIL_CREDS_PATH :您的 credentials.json 文件的路径
  • GMAIL_TOKEN_PATH :token.json 文件的路径

使用这些变量在项目根目录中创建一个.env文件,以便于配置。

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

允许 Claude 从您的 Gmail 帐户搜索和检索电子邮件的服务器,支持搜索电子邮件、检索特定电子邮件的完整内容以及列出最近消息等功能。

  1. 设置
    1. 1.获取 Google API 凭证
    2. 2.授权应用程序
  2. 使用 Claude 进行配置
    1. 搜索电子邮件
    2. 获取电子邮件内容
    3. 列出消息
  3. 环境变量

    Related MCP Servers

    • -
      security
      A
      license
      -
      quality
      Server for Gmail integration in Claude Desktop with auto authentication support. This server enables AI assistants to manage Gmail through natural language interactions.
      Last updated -
      57,424
      283
      JavaScript
      MIT License
      • Linux
      • Apple
    • A
      security
      F
      license
      A
      quality
      A server that enables Claude Desktop users to access the Claude API directly, allowing them to bypass Professional Plan limitations and use advanced features like custom system prompts and conversation management.
      Last updated -
      1
      5
      Python
      • Apple
    • -
      security
      A
      license
      -
      quality
      An email assistant server that connects Claude Desktop to notmuch email databases, allowing users to search emails, view threads, compose new messages, and reply to conversations with markdown formatting.
      Last updated -
      2
      Python
      Mozilla Public License 2.0
    • -
      security
      F
      license
      -
      quality
      An integration server that provides Claude Desktop access to Gmail, enabling users to view recent emails and search their Gmail inbox using natural language commands.
      Last updated -
      6
      Python

    View all related MCP servers

    MCP directory API

    We provide all the information about MCP servers via our MCP API.

    curl -X GET 'https://glama.ai/api/mcp/v1/servers/vinayak-mehta/gmail-mcp'

    If you have feedback or need assistance with the MCP directory API, please join our Discord server