r/AIAgents 2026 充满了关于基于 Claude Code 构建的出站代理的帖子。秘诀:Claude Code 作为推理循环,Scadio 作为研究后端,以及 CRM 回写。本教程通过潜在客户触发的研究提供了最小可行的出站代理。
前置条件
- 克劳德·代码最新
- Scavio API 密钥
- 电子邮件/CRM 目的地(Gmail、HubSpot)
- Node.js 20+
操作指南
步骤 1: 在 Claude 代码中注册 Scavio MCP
使 Claude Code 工具能够访问 Scavio 搜索。
JSON
{
"mcpServers": {
"scavio": { "command": "scavio-mcp", "env": { "SCAVIO_API_KEY": "sk_live_..." } }
}
}步骤 2: 写出研究技能
克劳德·代码的一项技能可以触发新的潜在客户。
// ~/.claude/skills/outbound-research.md
Instructions: For each prospect, use scavio to search:
1. Company recent news
2. Prospect LinkedIn activity
3. Reddit threads about their industry
Return a 3-bullet brief.步骤 3: 草拟个性化电子邮件
将摘要通过管道传输到 Claude Code 中的电子邮件模板中。
Text
// Claude Code prompt
> Using the brief from outbound-research for {prospect_name} at {company}, draft a 3-sentence cold email referencing the most recent specific signal.步骤 4: 发送队列
将草稿保存到 Gmail API 或审阅文件夹。
// ~/.claude/skills/queue-draft.md
After drafting, call the Gmail create_draft tool to queue for human review.步骤 5: 按计划运行
cron 或 GitHub Action 会触发每个新潜在客户的代理。
Bash
# cron
0 9 * * * cd ~/projects/outbound && claude-code run ./agent.mdPython 示例
Python
import os, requests
API_KEY = os.environ['SCAVIO_API_KEY']
def research(prospect):
queries = [
f'"{prospect["company"]}" news',
f'site:linkedin.com/posts "{prospect["name"]}"',
f'{prospect["industry"]} pain points'
]
out = []
for q in queries:
r = requests.post('https://api.scavio.dev/api/v1/search',
headers={'x-api-key': API_KEY},
json={'query': q, 'num_results': 3})
out.append(r.json().get('organic_results', []))
return out
print(research({'name': 'Jane Doe', 'company': 'Acme', 'industry': 'saas'}))JavaScript 示例
JavaScript
const API_KEY = process.env.SCAVIO_API_KEY;
export async function research(prospect) {
const queries = [`"${prospect.company}" news`, `site:linkedin.com/posts "${prospect.name}"`];
const out = [];
for (const q of queries) {
const r = await fetch('https://api.scavio.dev/api/v1/search', {
method: 'POST',
headers: { 'x-api-key': API_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({ query: q, num_results: 3 })
});
out.push(((await r.json()).organic_results || []).slice(0, 3));
}
return out;
}预期输出
JSON
Per-prospect research brief + email draft in Gmail drafts ready for human send. Typical run: 45s per prospect, $0.02 in Scavio credits.