使用说明
一个由人工智能驱动的智能开发人员生产力平台。
管理电子邮件、分析GitHub存储库和定制简历——所有这些都可以在一个本地服务器上完成。
概述
Hermes是一个完全在本地机器上运行的双界面AI生产力服务器。它通过两个界面同时展示了五个由人工智能驱动的工具—— 模型上下文协议(MCP)服务器 对于克劳德桌面,以及 Flask HTTP API 支持内置的web UI。
服务器由以下设备供电 格罗克 (llama-3.3-70b-versatile)对于所有AI任务 女服务员 (Windows)或 独角兽 (Linux/macOS)作为生产WSGI层——在运行时自动选择,无需配置。
除了对Gmail、GitHub、Groq和arXiv/HuggingFace/PassWithCode的API调用外,没有任何数据离开您的机器。
能力
| 模块 | 说明 |
|---|---|
| 收件箱分拣机 | 获取Gmail并使用主题、发件人和内容的AI分析按优先级(关键、高、中或低)对每条消息进行分类。 |
| 电子邮件编辑器 | 通过Groq以可配置的语气生成专业电子邮件。支持通过Gmail API一键发送。 |
| AI/ML搜索 | 深入研究arXiv、HuggingFace和PapersWithCode。返回排名论文、模型和结构化见解。 |
| GitHub分析器 | 8个操作的完整投资组合分析:回购概述、提交活动、README质量评分、过时回购检测、AI代码审查、技术栈映射和依赖性审计。 |
| 简历定制 | 两阶段人工智能定制——JD分析,然后用比赛得分、差距分析和面试技巧重写简历。 |
建筑
通过MCP/HTTP层、工具、服务和外部API从Claude Desktop和浏览器UI进行完整的数据流。
项目结构
hermes/
├── main.py # Flask app + MCP server (WSGI entry point)
├── serve.py # Smart launcher — auto-detects OS and WSGI server
├── gunicorn.conf.py # Gunicorn configuration (Linux/macOS)
├── logger.py # Structured logging
├── check_groq.py # API key diagnostic utility
│
├── tools/
│ ├── mail_fetcher.py # Gmail fetch + Groq classification
│ ├── mail_writer.py # Email generation + Gmail send
│ ├── ai_search.py # Multi-source AI/ML research
│ ├── github_analyzer.py # GitHub analysis — 8 actions
│ └── resume_tailor.py # Two-phase resume tailoring
│
├── services/
│ ├── claude_service.py # Groq client + shared AI helpers
│ ├── gmail_service.py # Gmail OAuth 2.0 + API wrapper
│ └── github_service.py # PyGithub wrapper — 8 analysis functions
│
├── ui/
│ └── index.html # Single-file dark UI — no build step required
│
├── tests/
│ ├── test_imports.py # Module import smoke tests
│ ├── test_flask_routes.py # HTTP endpoint tests (mocked)
│ ├── test_github_analyzer.py # GitHub tool unit tests
│ └── test_resume_tailor.py # Resume tailor unit tests
│
├── .github/
│ └── workflows/
│ └── ci.yml # CI pipeline — lint, imports, unit tests
│
├── .env # Local secrets — never committed
├── .env.example # Environment variable template
└── requirements.txt
入门指南
先决条件
- Python 3.11或更高版本
- Groq API密钥 --免费等级足够
- Gmail OAuth 2.0凭据(
credentials.json从谷歌云控制台) - GitHub个人访问令牌
repo范围
安装
git clone https://github.com/rayyan666/MAIL-MCP.git hermes
cd hermes
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux / macOS
pip install -r requirements.txt
配置
cp .env.example .env
编辑 .env:
GROQ_API_KEY=gsk_your_key_here
GH_TOKEN=ghp_your_token_here
地方 credentials.json (Gmail OAuth)在项目根目录中。
验证设置
python check_groq.py
跑
python serve.py
打开 http://localhost:5000 在您的浏览器中。
注: 从普通终端窗口而不是VS Code集成终端运行,以确保
.env变量通过以下方式正确加载python-dotenv.
运行模式
| 命令 | 描述 |
|---|---|
python serve.py |
生产HTTP服务器——Windows上的服务员,Linux上的Gunicorn |
python serve.py --mcp |
Claude Desktop的MCP stdio模式,HTTP服务器在后台运行 |
python serve.py --dev |
启用调试模式的Flask开发服务器 |
PORT=8080 python serve.py |
在自定义端口上运行 |
MCP集成
要将Hermes用作Claude Desktop的MCP服务器,请添加以下内容 %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"hermes": {
"command": "C:\\path\\to\\hermes\\venv\\Scripts\\python.exe",
"args": ["C:\\path\\to\\hermes\\serve.py", "--mcp"],
"env": {
"GROQ_API_KEY": "gsk_your_key",
"GH_TOKEN": "ghp_your_token"
}
}
}
}
重新启动克劳德桌面。将提供以下工具: get_emails, compose_email, search_ai_ml, github_analyzer, tailor_resume_tool.
API 参考
所有端点均可在 http://localhost:5000 并接受/返回JSON。
健康检查
GET /health
{ "status": "ok", "server": "waitress" }
收件箱分拣机
POST /tools/get_emails
{ "max_results": 10, "filter_priority": "all" }
电子邮件编辑器
POST /tools/compose_email
{
"to": "recipient@example.com",
"purpose": "Project status update",
"key_points": ["Milestone completed", "Next steps"],
"tone": "professional",
"auto_send": false
}
AI/ML搜索
POST /tools/search_ai_ml
{ "query": "LoRA fine-tuning efficiency", "depth": "advanced", "max_results": 10 }
GitHub分析器
POST /tools/analyze_github
{ "action": "repo_overview", "ai_summary": true }
{ "action": "review_code", "repo": "hermes", "file_path": "main.py" }
可用操作: list_repos · repo_overview · commit_activity · readme_quality · stale_repos · review_code · tech_stack · audit_dependencies
简历定制
POST /tools/tailor_resume
{
"role": "Senior ML Engineer",
"company": "Google DeepMind",
"job_description": "...",
"existing_resume": "...",
"mode": "full"
}
可用模式: full · quick · batch
环境变量
| 变量 | 必填 | 描述 |
|---|---|---|
GROQ_API_KEY |
✅ | Groq API密钥-从获取 console.groq.com |
GH_TOKEN |
✅ | GitHub个人访问令牌 repo 范围 |
GMAIL_CREDENTIALS |
✅ | 路径 credentials.json --默认为项目根目录 |
PORT |
❌ | HTTP服务器端口--默认为 5000 |
GUNICORN_RELOAD |
❌ | 吃起来 true 在Linux上启用Gunicorn自动重新加载 |
重要提示: 使用
GH_TOKEN而不是GITHUB_TOKENTheGITHUB_前缀由GitHub Actions保留,不能用作自定义密钥名称。
发展
# Run full test suite
venv\Scripts\python -m pytest tests/ -v
# Run with coverage report
venv\Scripts\python -m pytest tests/ -v --cov=tools --cov=services --cov-report=term-missing
# Lint
venv\Scripts\python -m flake8 tools/ services/ main.py serve.py --max-line-length=130
# Diagnose API key issues
python check_groq.py
故障排除
ModuleNotFoundError: No module named 'fcntl'
Gunicorn不支持Windows。使用 python serve.py 或 waitress-serve --port=5000 main:app 相反。
Groq 401 API密钥无效
密钥已过期或被吊销。跑 python check_groq.py 进行全面诊断。从以下位置获取替换密钥 console.groq.com/keys请注意,VS Code可能会缓存过时的代码 .env values——从普通终端窗口运行可以解决这个问题。
UI呈现为原始CSS文本
使用执行硬刷新 Ctrl+Shift+R。如果问题仍然存在,请确认Flask正在使用 send_from_directory(os.path.join(BASE_DIR, "ui"), "index.html") 在 main.py.
MCP工具未出现在Claude Desktop中
验证 serve.py --mcp 在中指定 claude_desktop_config.json。确保所有路径在Windows上使用双反斜杠。更改任何配置后重新启动Claude Desktop。
VS Code终端未加载 .env
添加 "python.terminal.useEnvFile": true 转换为VS代码用户设置(JSON),或从纯文本运行 cmd VS Code外的窗口。
路线图
- []GitHub操作监视器——工作流状态和故障警报
- []电子邮件至Issue桥——直接从电子邮件中创建GitHub问题
- []批量恢复模式UI
- []将结果导出为PDF
- []暗/亮主题切换
许可证
该项目根据MIT许可证获得许可。看 许可证 了解详情。
建造于 雷扬666 ·技术支持: 格罗克 llama-3.3-70b·由服务员/Gunicorn服务·MCP通过 FastMCP
