Wayfound MCP主管-股票研究代理示例
使用模型上下文协议(MCP)在几分钟内将AI监督添加到任何代理系统中
此示例演示了如何集成 Wayfound的 使用模型上下文协议将AI监督员引入代理工作流。只需几行代码,您的代理就可以:
- 📋 在开始工作之前访问质量指南和最佳实践
- 🎯 获取主管分析,确定要避免的常见陷阱
- 💡 从历史会话数据中接收改进建议
- ✅ 根据字母等级的质量标准评估输出
- 🔄 根据主管反馈自动迭代,直到达到质量阈值
挑战
构建可靠的代理系统是困难的。代理可能会产生不一致的输出,错过关键需求,或者随着时间的推移养成坏习惯。传统方法要求:
- 手动提示工程和测试
- 不进化的硬编码验证规则
- 没有持续改进的反馈回路
- 无透明度的黑盒评估
Wayfound解决方案
Wayfound扮演着 AI主管 实时培训、指导和评估您的代理。通过MCP连接,您的代理可以:
- 表演前先学习 -查询主管指南和常见问题
- 接受评估 -提交课程成绩单进行综合质量评分
- 迭代改进 -使用详细的反馈自动优化输出
最好的? 这只是配置。 不需要进行重大的代码重构。
实时示例输出
此回购包含一个生成投资报告的股票研究代理。观看Wayfound监督如何提高质量:
$ npm start AAPL
================================================================================
STOCK RESEARCH AGENT - Analyzing AAPL
================================================================================
[ASSISTANT] I'll help you research AAPL and produce a comprehensive investment
research report, following the Wayfound quality standards. Let me start by
gathering the necessary guidance...
[ASSISTANT] Requested tool: mcp__wayfound__get_agent_details
[ASSISTANT] Requested tool: mcp__wayfound__get_supervisor_analysis_for_agent
[ASSISTANT] Requested tool: mcp__wayfound__get_improvement_suggestions_for_agent
[ASSISTANT] Perfect! I now have the quality guidelines and context:
**Quality Guidelines:**
1. Reports must include an executive summary
2. Financial data must cite sources
3. Investment recommendations must be clearly stated
4. Risk factors must be disclosed
5. Professional, unbiased tone required
**Key Issues from Past Reports:**
- Missing source citations for financial data (56% of sessions)
- Internal inconsistencies between metadata and report body
- Incomplete quality review execution
- Missing balance sheet metrics and valuation methodology
Now let me delegate to the specialized agents...
[SUBAGENT] Delegating to: web-researcher
[SUBAGENT] Delegating to: report-writer
[ASSISTANT] Perfect! The report looks good with proper citations. Now I need
to submit it to Wayfound for evaluation...
[ASSISTANT] Requested tool: mcp__wayfound__evaluate_session
[ASSISTANT] Excellent! The report received an **A grade** from Wayfound! 🎉
================================================================================
[RESULT] Research completed!
[RESULT] Cost: $0.7041
[RESULT] Status: SUCCESS
================================================================================
## ✅ AAPL Research Report Complete - Grade: A
**Wayfound Grade: A** (exceeds the A- threshold requirement)
**All Guidelines Met:**
- ✅ Executive Summary included
- ✅ Financial data properly cited with sources
- ✅ Clear investment recommendation stated
- ✅ Comprehensive risk factors disclosed
- ✅ Professional, unbiased tone throughout
### 🔍 Process Followed
1. **Reviewed Wayfound guidelines** upfront to understand quality requirements
2. **Delegated to web-researcher** agent to gather current AAPL data
3. **Delegated to report-writer** agent to create professional report
4. **Submitted to Wayfound** for evaluation with complete session transcript
5. **Achieved A grade** on first submission - no iteration needed!为什么这对您的业务很重要
传统代理开发
- ❌ 手动快速工程需要数周时间
- ❌ 在生产之前无法了解质量问题
- ❌ 随着时间的推移,代理人会养成坏习惯
- ❌ 不一致的输出需要人工审查
- ❌ 无自动改进循环
通过Wayfound MCP监督
- ✅ 5分钟整合 -只需添加MCP配置
- ✅ 实时引导 -代理人在采取行动之前学习最佳实践
- ✅ 自动化质量门 -仅A级输出船
- ✅ 持续改进 -系统从每个会话中学习
- ✅ 完全透明 -详细的评估明细
运作原理
建筑
┌─────────────────────────────────────────────────────────────┐
│ Stock Research Agent (Claude Sonnet) │
│ │
│ 1. Query Wayfound guidelines via MCP │
│ 2. Delegate to web-researcher subagent │
│ 3. Delegate to report-writer subagent │
│ 4. Submit transcript to Wayfound for evaluation │
│ 5. Iterate if grade < A-, or finish if grade ≥ A- │
└─────────────────────────────────────────────────────────────┘
│
│ MCP Connection
↓
┌─────────────────────────────────────────────────────────────┐
│ Wayfound Supervisor (via MCP) │
│ │
│ Tools Available: │
│ • mcp__wayfound__get_agent_details │
│ • mcp__wayfound__get_supervisor_analysis_for_agent │
│ • mcp__wayfound__get_improvement_suggestions_for_agent │
│ • mcp__wayfound__evaluate_session │
│ • mcp__wayfound__get_session_analysis │
└─────────────────────────────────────────────────────────────┘整合(就是这样!)
将Wayfound监督添加到您的Claude Agent SDK工作流中只需要 3行配置:
const response = query({
prompt: "Research AAPL and produce an investment report...",
options: {
// 👇 Add Wayfound MCP Server - that's it!
mcpServers: {
wayfound: {
type: "sse",
url: "https://app.wayfound.ai/sse",
headers: {
Authorization: `Bearer ${process.env.WAYFOUND_MCP_KEY}`,
},
},
},
// Your agents can now call Wayfound tools
agents: {
"report-writer": {
description: "Writes investment research reports",
prompt: `You are a professional report writer...`,
},
},
},
});就是这样!您的代理现在可以访问:
mcp__wayfound__get_agent_details-获取质量指南mcp__wayfound__get_supervisor_analysis_for_agent-了解常见问题mcp__wayfound__get_improvement_suggestions_for_agent-从过去的课程中学习mcp__wayfound__evaluate_session-提交成绩单进行评分mcp__wayfound__get_session_analysis-获取详细的评估明细
是什么让它如此强大
Wayfound之前:
Agent → Generate Report → Hope it's good → Manual review neededWayfound:
Agent → Get Guidelines → Generate Report → Evaluate → Grade A? → Done
↓ Grade < A-
Revise with Feedback代理人 学习 根据主管的反馈和 自动改进 直到达到质量标准。
设置和安装
先决条件
- Wayfound帐户 - 在wayfound.ai注册
- Node.js 18+ -Claude Agent SDK所需
- 无烟煤API密钥 - 从Anthropic控制台获取
安装
# Clone this repository
git clone https://github.com/Wayfound-AI/wayfound-mcp-supervisor-example.git
cd wayfound-mcp-supervisor-example
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your credentials:
# ANTHROPIC_API_KEY=your_anthropic_key
# WAYFOUND_MCP_KEY=your_wayfound_mcp_key
# WAYFOUND_AGENT_ID=your_agent_id配置
- 获取您的Wayfound凭据:
- 登录到 Wayfound仪表板 - 创建新代理或选择现有代理 - 复制您的代理ID和MCP API密钥
- 更新
.env文件:
ANTHROPIC_API_KEY=...
WAYFOUND_MCP_KEY=...
WAYFOUND_AGENT_ID=...运行示例
# Generate a research report for any stock ticker
npm start AAPL
# Try other tickers
npm start MSFT
npm start TSLA
npm start NVDA代理人将:
- 查询Wayfound的质量指南
- 使用网络搜索研究股票
- 生成专业投资报告
- 提交Wayfound进行评估
- 迭代直到达到A级或更好
生成的报告另存为 {TICKER}_research_report_v{N}.md
编码结构
wayfound-mcp-supervisor-example/
├── index.js # Main agent orchestrator
├── package.json # Dependencies
├── .env # Environment variables (create this)
└── README.md # You are here关键部件:
- 主要代理人 (第30-51行):协调工作流程并调用Wayfound工具
- MCP配置 (第60-68行):连接Wayfound主管
- Web研究员子代理 (第87-106行):收集当前股票数据
- 报告撰写人代理 (第109-124行):创建专业报告
了解更多
- 寻路文件: docs.wayfound.ai
- MCP协议: 模型上下文协议.io
- Claude代理SDK:
支持
- 问题:
- Wayfound支持: support@wayfound.ai
- 销售咨询: hello@wayfound.ai
许可证
MIT许可证-请参阅 许可证 文件以获取详细信息。
______________________________________________________________________
准备好在您的代理系统中添加人工智能监督了吗? 开始使用Wayfound→
