Skip to main content
Glama

@kazuph/mcp-gmail-gas

by kazuph

MCP Gmail

用于 Gmail 集成的模型上下文协议服务器。这允许 Claude Desktop(或任何 MCP 客户端)通过 Google Apps Script 与您的 Gmail 帐户进行交互。

快速入门(针对用户)

先决条件

  • Node.js 18+(通过brew install node安装)
  • Gmail 帐户
  • Google Apps 脚本部署
  • Claude Desktop(从https://claude.ai/desktop安装)

配置

  1. 部署 Google Apps 脚本
  • 访问Google Apps Script并创建一个新项目
  • 复制code.gs的全部内容并将其粘贴到脚本编辑器中
  • 点击“部署”>“新部署”
  • 选择“Web 应用”作为部署类型
  • 配置以下设置:
    • 执行身份:我
    • 谁有访问权限:任何人
    • 点击“部署”
  • 出现提示时,请查看并授权该应用访问您的 Gmail 帐户
  • 复制部署 URL 并生成随机 API 密钥以确保安全

注意:该脚本需要 Gmail 访问权限。首次部署并运行该脚本时,Google 会要求您审核并授予这些权限。请确保:

  1. 点击“审核权限”
  2. 选择您的Google帐户
  3. 如果看到警告,请点击“高级”
  4. 点击“转到[您的项目名称](不安全)”
  5. 点击“允许”授予必要的 Gmail 权限
  6. 打开您的 Claude Desktop 配置文件: ~/Library/Application Support/Claude/claude_desktop_config.json

您可以通过 Claude 桌面菜单找到它:

  1. 打开 Claude 桌面
  2. 在 Mac 菜单栏上单击 Claude
  3. 点击“设置”
  4. 点击“开发者”
  5. 将以下内容添加到您的配置中:
{ "tools": { "gmail": { "command": "npx", "args": ["-y", "@kazuph/mcp-gmail-gas"], "env": { "GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL", "VALID_API_KEY": "YOUR_API_KEY" } } } }

注意:请将YOUR_DEPLOYMENT_URLYOUR_API_KEY替换为您的实际值。

对于开发人员

先决条件

  • Node.js 18+(通过brew install node安装)
  • Gmail 帐户
  • Google Apps脚本
  • Claude Desktop(从https://claude.ai/desktop安装)
  • tsx(通过npm install -g tsx

安装

git clone https://github.com/kazuph/mcp-gmail-gas.git cd mcp-gmail-gas npm install npm run build

开发配置

  1. 确保 Claude Desktop 已安装并正在运行。
  2. 如果还没有安装 tsx,请全局安装:
npm install -g tsx # or pnpm add -g tsx
  1. 修改位于以下位置的 Claude Desktop 配置: ~/Library/Application Support/Claude/claude_desktop_config.json

将以下内容添加到您的 MCP 客户端的配置中:

{ "tools": { "gmail": { "args": ["tsx", "/path/to/mcp-gmail-gas/index.ts"], "env": { "GAS_ENDPOINT": "YOUR_DEPLOYMENT_URL", "VALID_API_KEY": "YOUR_API_KEY" } } } }

可用工具

  • gmail_search_messages :使用 Gmail 搜索查询语法搜索电子邮件(例如“subject:Meeting newer_than:1d”)
  • gmail_get_message :获取特定电子邮件的完整内容和详细信息
  • gmail_download_attachment :从特定电子邮件下载附件

安全说明

请始终对您的VALID_API_KEY保密,切勿将其提交到版本控制中。此密钥有助于确保只有授权的客户端才能通过 Google Apps 脚本部署访问您的 Gmail。

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

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.

用于 Gmail 集成的模型上下文协议服务器。这允许 Claude Desktop(或任何 MCP 客户端)通过 Google Apps Script 与您的 Gmail 帐户进行交互。

  1. 快速入门(针对用户)
    1. 先决条件
    2. 配置
  2. 对于开发人员
    1. 先决条件
    2. 安装
    3. 开发配置
  3. 可用工具
    1. 安全说明

      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
      • -
        security
        F
        license
        -
        quality
        A specialized Model Context Protocol (MCP) server that integrates Google services (Gmail, Calendar, etc.) into your AI workflows. This server enables seamless access to Google services through MCP, allowing AI agents to interact with Gmail, Google Calendar, and other Google services.
        Last updated -
        10
        3
        TypeScript
      • -
        security
        A
        license
        -
        quality
        Integrates with Gmail to enable sending, reading, drafting, and managing emails via the Model Context Protocol (MCP), allowing users to interact with email tasks through automated client prompts.
        Last updated -
        Python
        GPL 3.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/kazuph/mcp-gmail-gas'

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