Skip to main content
Glama
ClaudePost

ClaudePost

by ZilongXue

克劳德·波斯特

模型上下文协议 (MCP) 服务器,通过 Claude 提供无缝的电子邮件管理界面。此集成允许您直接通过与 Claude 进行自然语言对话来处理电子邮件,并支持安全搜索、阅读和发送电子邮件等功能。

功能与演示

电子邮件搜索和阅读

  • 📧 按日期范围和关键字搜索电子邮件

  • 📅 查看每日电子邮件统计信息

  • 📝 通过线程支持阅读完整的电子邮件内容

电子邮件撰写和发送

  • ✉️ 发送带有抄送收件人支持的电子邮件

  • 🔒 使用 TLS 安全处理电子邮件

Related MCP server: IMAP MCP Server

先决条件

  • Python 3.12 或更高版本

  • Gmail 帐户(或其他电子邮件提供商)

  • 如果使用 Gmail:

  • Claude 桌面应用程序

设置

  1. 安装 uv:

    # MacOS/Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Remember to restart your terminal after installation
  2. 克隆并设置项目:

    # Clone the repository
    git clone https://github.com/ZilongXue/claude-post.git
    cd claude-post
    
    # Create and activate virtual environment
    uv venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
    # Install dependencies
    uv pip install -e .
  3. 在项目根目录中创建一个.env文件:

    EMAIL_ADDRESS=your.email@gmail.com
    EMAIL_PASSWORD=your-app-specific-password
    IMAP_SERVER=imap.gmail.com
    SMTP_SERVER=smtp.gmail.com
    SMTP_PORT=587
  4. 配置Claude桌面:

    首先,请确保您已安装 Claude 桌面版。您可以点击此处安装最新版本。如果您已安装 Claude 桌面版,请确保其已更新至最新版本。

    打开您的 Claude Desktop 配置文件:

    # MacOS
    ~/Library/Application Support/Claude/claude_desktop_config.json
    
    # Create the file if it doesn't exist
    mkdir -p ~/Library/Application\ Support/Claude
    touch ~/Library/Application\ Support/Claude/claude_desktop_config.json

    添加以下配置:

    {
      "mcpServers": {
        "email": {
          "command": "/Users/username/.local/bin/uv",
          "args": [
            "--directory",
            "/path/to/claude-post/src/email_client",
            "run",
            "email-client"
          ]
        }
      }
    }

    将/Users/username和/path/to/claude-post替换为您的实际路径。

    更新配置后,重新启动 Claude Desktop 以使更改生效。

运行服务器

服务器通过Claude Desktop自动运行:

  • 如果配置正确,服务器将在 Claude 启动时启动

  • 无需手动服务器管理

  • Claude 关闭时服务器停止

通过克劳德使用

您可以使用自然语言命令与电子邮件进行交互。以下是一些示例:

搜索电子邮件

  • “显示上周的电子邮件”

  • “查找主题包含‘会议’的电子邮件”

  • “搜索 2024 年 1 月 1 日至 2024 年 1 月 7 日期间来自recruiting@linkedin.com的电子邮件”

  • “搜索上个月发送的电子邮件”

阅读电子邮件内容

  • “显示电子邮件 #12345 的内容”

  • “人力资源部最后一封电子邮件的完整内容是什么?”

电子邮件统计

  • “我今天收到了多少封电子邮件?”

  • “显示过去一周的每日电子邮件数量”

发送电子邮件

注意:出于安全原因,Claude 会在实际发送之前始终向您显示电子邮件详细信息以供确认。

项目结构

claude-post/
├── pyproject.toml
├── README.md
├── LICENSE
├── .env                    # Not included in repo
├── .python-version        # Python version specification
└── src/
    └── email_client/
        ├── __init__.py
        ├── __main__.py
        └── server.py       # Main implementation

安全说明

  • 使用应用专用密码代替主账户密码

  • 对于 Gmail 用户:

    1. 在您的 Google 帐户中启用两步验证

    2. 为该应用程序生成应用密码

    3. 使用.env文件中的应用密码

日志记录

应用程序会将详细信息记录到email_client.log中。检查此文件以获取调试信息和错误消息。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

Available Tools

4 tools
count-daily-emailsB

Count emails received for each day in a date range

Inputs: end_date (required), start_date (required).

get-email-contentB

Get the full content of a specific email by its ID

Inputs: email_id (required).

search-emailsC

Search emails within a date range and/or with specific keywords

Inputs: end_date, folder, keyword, start_date.

send-emailA

CONFIRMATION STEP: Actually send the email after user confirms the details. Before calling this, first show the email details to the user for confirmation. Required fields: recipients (to), subject, and content. Optional: CC recipients.

Inputs: content (required), subject (required), to (required), cc.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with no overlap: count-daily-emails aggregates email statistics, get-email-content retrieves a specific email's full content, search-emails finds emails based on criteria, and send-email handles email composition and sending. The descriptions clearly differentiate their functions, making misselection unlikely.

    Naming Consistency4/5

    The tool names follow a consistent verb-noun pattern with hyphens (e.g., count-daily-emails, get-email-content), which is readable and predictable. The minor deviation is that send-email uses a simpler noun form (email instead of email-content or similar), but this does not break the overall consistency significantly.

    Tool Count5/5

    With 4 tools, this server is well-scoped for email management, covering key operations: counting, retrieving, searching, and sending emails. Each tool earns its place by addressing a distinct aspect of the domain without being overly sparse or bloated.

    Completeness4/5

    The tool set provides good coverage for core email workflows, including read (count, get, search) and write (send) operations. A minor gap is the lack of update or delete tools for managing existing emails, but agents can work around this, and the surface is largely complete for the stated purpose.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants like Claude to interact with Gmail through natural language, providing comprehensive email management capabilities including sending, reading, organizing, searching, and managing drafts and labels.
      23
      GPL 3.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables AI assistants to access and manage email through IMAP, supporting browsing, searching, reading, and organizing emails while learning user preferences over time.
      58
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol server that enables Claude AI to interact with Gmail, supporting email sending, reading, searching, labeling, draft management, and batch operations through natural language commands.
      2
      MIT
    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      A Model Context Protocol server that enables Claude to interact with Gmail through a secure OAuth2 connection, providing email management capabilities like listing, sending, deleting, and organizing emails.
      -