通过配置 Scavio MCP 服务器,将 Web 搜索添加到 Cursor 的 AI 代理中。然后,后台代理可以使用实时搜索数据而不是过时的训练数据来验证文档、检查 API 版本并研究解决方案。
前置条件
- 安装 Cursor IDE(建议专业版 20 美元/月)
- 来自 scavio.dev 的 Scavio API 密钥
- 一个项目目录
操作指南
步骤 1: 创建 MCP 配置
在项目根目录中创建 .cursor/mcp.json。
Bash
mkdir -p .cursor
cat > .cursor/mcp.json << 'EOF'
{
"mcpServers": {
"scavio": {
"url": "https://mcp.scavio.dev/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
EOF步骤 2: 在光标设置中验证
打开光标设置 > MCP 以确认服务器已连接。
Bash
# In Cursor:
# 1. Open Settings (Cmd+,)
# 2. Navigate to MCP section
# 3. Verify 'scavio' server shows as connected
# 4. Test with: 'Search for Express.js rate limiting best practices'Python 示例
Python
import json, os
# Create .cursor directory and MCP config
os.makedirs('.cursor', exist_ok=True)
config = {
'mcpServers': {
'scavio': {
'url': 'https://mcp.scavio.dev/mcp',
'headers': {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
}
}
with open('.cursor/mcp.json', 'w') as f:
json.dump(config, f, indent=2)
print('MCP search configured for Cursor')JavaScript 示例
JavaScript
const fs = require('fs');
fs.mkdirSync('.cursor', {recursive: true});
const config = {
mcpServers: {
scavio: {
url: 'https://mcp.scavio.dev/mcp',
headers: {Authorization: 'Bearer YOUR_API_KEY'}
}
}
};
fs.writeFileSync('.cursor/mcp.json', JSON.stringify(config, null, 2));
console.log('MCP search configured for Cursor');预期输出
JSON
Cursor IDE with live search capability. The background agent verifies documentation and API versions before writing code.