
关于
轻量级 Gmail 集成,带独立 OAuth 认证。无需 MCP 服务器,支持邮件读取、发送、标签管理等操作。
name: gmail-automation description: "轻量级 Gmail 集成,带独立 OAuth 认证。无需 MCP 服务器。" license: Apache-2.0 risk: critical source: community metadata: author: sanjay3290 version: "1.0"
Gmail
轻量级 Gmail 集成,带独立 OAuth 认证。无需 MCP 服务器。
需要 Google Workspace 账户。 不支持个人 Gmail 账户。
何时使用
- 需要从命令行搜索、阅读或发送 Gmail 消息而无需 MCP 服务器时。
- 为 Google Workspace 账户自动化收件箱工作流时。
- 需要由独立 OAuth 脚本支持的轻量级 Gmail 集成时。
首次设置
使用 Google 认证(打开浏览器):
python scripts/auth.py login
检查认证状态:
python scripts/auth.py status
需要时登出:
python scripts/auth.py logout
命令
所有操作通过 scripts/gmail.py。首次使用时如未登录会自动认证。
搜索邮件
# Search with Gmail query syntax
python scripts/gmail.py search "from:someone@example.com is:unread"
# Search recent emails (no query returns all)
python scripts/gmail.py search --limit 20
# Filter by label
python scripts/gmail.py search --label INBOX --limit 10
# Include spam and trash
python scripts/gmail.py search "subject:important" --include-spam-trash
阅读邮件内容
# Get full message content
python scripts/gmail.py get MESSAGE_ID
# Get just metadata (headers)
python scripts/gmail.py get MESSAGE_ID --format metadata
# Get minimal response (IDs only)
python scripts/gmail.py get MESSAGE_ID --format minimal
发送邮件
# Send a simple email
python scripts/gmail.py send --to "user@example.com" --subject "Hello" --body "Message body"
# Send with CC and BCC
python scripts/gmail.py send --to "user@example.com" --cc "cc@example.com" --bcc "bcc@example.com" \
--subject "Team Update"
兼容工具
Claude CodeCursor
标签
前端开发