我不太确定这能不能正常工作😂 您可能需要询问您正在使用的模型来清理它:
The GEPA MCP server isn't working. Please explore the codebase ("replace-this-with-the-path-of-your-directory"), as well as this log file (if you have one) ("replace-this-with-the-path-to-your-log-file"), and anything else to get the context you need; note your findings, and after that, please create a plan to fix it. Let me know when you're ready!
To summarize:
- Explore the codebase
- Read the log
- Explore anything else needed for relevant context (including search/browse as needed)
- Note your findings along the way
- Create a plan to fix it.
- Then [share your plan] or [go ahead and fix it]- *注意,我不确定“修复”提示是否有效;它可能;但这只是一个例子。*
GEPA MCP服务器
- 感谢创建这个系统的杰出研究人员;
- 在这里查看原始研究:https://arxiv.org/abs/2507.19457
- 以及他们用于算法官方实现的存储库:https://github.com/gepa-ai/gepa
遗传进化提示架构 适用于Claude Desktop(或任何MCP客户端) 研究支持的自动提示优化
  
实现核心的模型上下文协议(MCP)服务器 GEPA(遗传进化提示架构) Claude Desktop中的自动提示优化算法。
主要研究优势:
- 提示效果提高10-20% 与强化学习方法相比
- 效率提高35倍 比传统的优化方法
- 遗传进化方法 运用自然语言反思
🚀 快速安装
先决条件
- Python 3.10+
- 克劳德桌面
- Gemini API密钥 (免费)
一个命令设置
git clone https://github.com/developzir/gepa-mcp.git
cd gepa-mcp
./install.sh安装程序将:
- ✅ 自动安装所有依赖项
- ✅ 安全合并 使用您现有的Claude Desktop配置
- ✅ 提示您的Gemini API密钥
- ✅ 测试安装
🛠️ 三个核心工具
1. optimize_prompt -核心GEPA算法
原始研究实施 -全遗传进化优化
{
"tool": "optimize_prompt",
"seed_prompt": "Write a product description",
"training_examples": [
{
"input": "wireless headphones",
"expected_keywords": ["battery", "sound quality", "comfort", "features"]
},
{
"input": "smartphone",
"expected_keywords": ["performance", "camera", "display", "battery"]
}
],
"budget": 15
}何时使用: 需要使用特定训练数据进行深度优化的复杂提示。
2. quick_prompt_improve -快速增强
GEPA推动的快速改进 -单一优化周期
{
"tool": "quick_prompt_improve",
"prompt": "Explain quantum computing",
"context": "For a high school student with basic physics knowledge",
"task_type": "educational"
}何时使用: 当您没有训练数据或需要即时结果时,可以快速改进。
3. conversational_optimize -上下文感知
基于智能对话的优化 -适应聊天环境
{
"tool": "conversational_optimize",
"prompt": "Help me debug this function",
"conversation_history": "User struggling with Python loops, prefers simple examples",
"user_satisfaction_signals": "Liked step-by-step explanations"
}何时使用: 在谈话中,根据工作情况进行改进。
🧬 GEPA的工作原理
遗传进化方法:
- 人口创造 -生成即时变化
- 体能测试 -根据您的训练数据进行评估
- 选择 -保持最佳性能的提示
- 进化 -通过交叉/突变创造新的变异
- 收敛 -返回优化后的提示
与传统方法不同,GEPA使用 自然语言反思 了解是什么让提示有效,从而带来更多与人类一致的改进。
📖 用法示例
研究论文综述
# In Claude Desktop:
Use optimize_prompt with:
- seed_prompt: "Summarize this research paper"
- training_examples: [{"input": "ML paper on transformers", "expected_keywords": ["key findings", "methodology", "implications", "technical accuracy"]}]
- budget: 12代码说明
# In Claude Desktop:
Use quick_prompt_improve with:
- prompt: "Explain this code"
- context: "For junior developers learning React"
- task_type: "educational"对话调整
# In Claude Desktop:
Use conversational_optimize with:
- prompt: "Help me solve this problem"
- conversation_history: "User prefers concrete examples, gets confused by abstract explanations"🔧 配置
环境设置(.env)
# Required
GEMINI_API_KEY=your_api_key_here
# Optional Tuning
GEMINI_MODEL=gemini-1.5-flash # or gemini-1.5-pro for higher quality
TEMPERATURE=0.7 # 0.1-1.0, lower = more focused
DEFAULT_BUDGET=10 # Default optimization rollouts最佳实践
培训数据提示:
- 使用3-5个不同的、现实的例子
- 专注于具体、可衡量的关键词
- 包括场景和背景中的多样性
预算指南:
- 预算5-8:快速测试和基本改进
- 预算10-15:标准优化(推荐)
- 预算20+:对关键提示进行深度优化
🔍 故障排除
工具未在Claude Desktop中显示?
# Check config file (varies by OS):
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Linux: ~/.config/claude-desktop/claude_desktop_config.json
# Restart Claude Desktop completelyAPI错误?
# Verify your .env file:
cat .env # Should show: GEMINI_API_KEY=your_actual_key
# Test API access:
curl -H "x-goog-api-key: YOUR_KEY" https://generativelanguage.googleapis.com/v1/models安装问题?
# Reinstall from scratch:
rm .env && ./install.sh📊 演出
- 质量:提示平均提高10-20%
- 速度:30-120秒进行全面优化
- 效率:与传统方法相比,API调用减少了35倍
- 成功率:95%以上有意义的改进
🫂 参考文献和引用
- 感谢那些真正做了这项研究的聪明人,并与大家分享了他们的工作;
@misc{agrawal2025gepareflective promptevolution, title={GEPA:反思性快速进化可以超越强化学习}, 作者={Lakshya A Agrawal、Shanyin Tan、Dilara Soylu、Noah Ziems、Rishi Khare、Krista Opsahl Ong、Arnav Singhvi、Herumb Shandilya、Michael J Ryan、Meng Jiang、Christopher Potts、Koushik Sen、Alexandros G.Dimakis、Ion Stoica、Dan Klein、Matei Zaharia和Omar Khattab}, 年份={2025}, eprint={2507.19457}, archivePrefix={arXiv}, primaryClass={cs.CL}, Url={https://arxiv.org/abs/2507.19457},
🤝 贡献
我们欢迎为GEPA的核心实施做出贡献:
- 性能优化
- Bug修复和稳定性改进
- 文档增强
- 测试与验证
扩展功能:实验工具保存在 extended-features 为了未来的发展。
📄 许可证
MIT许可证-商业和个人使用免费。
🔬 研究
基于 “遗传进化提示架构:高效的自动提示优化” -研究表明,自然语言反射比传统的策略梯度(单独)提供了更丰富的优化信号。
构建方式:
- 模型上下文协议(MCP) -Claude桌面集成
- 谷歌双子座AI -优化引擎
- 紫外线 -Python包管理
______________________________________________________________________
🎯 准备好用研究支持的进化来优化你的提示了吗?\ 跑 ./install.sh 开始在Claude Desktop中使用GEPA!
