MCP 设置指南
Cursor
通过 AnyCrawl MCP 为 Cursor 添加网页抓取和搜索功能
在 Cursor 中使用 MCP 网页搜索和抓取
通过 AnyCrawl MCP 为 Cursor 添加网页抓取和搜索功能。
快速设置
1. 获取 API 密钥
在 anycrawl.dev 注册并从控制面板复制您的 API 密钥。
2. 添加到 Cursor
打开设置(Mac 上按 Cmd+,,Windows 上按 Ctrl+,),搜索"MCP",然后添加:
{
"mcpServers": {
"anycrawl": {
"command": "npx",
"args": ["-y", "anycrawl-mcp"],
"env": {
"ANYCRAWL_API_KEY": "your-api-key"
}
}
}
}将 your-api-key 替换为您实际的 AnyCrawl API 密钥。
3. 重启 Cursor
完成!现在您可以在 Cursor 中搜索和抓取网页了。
快速演示
在 Cursor 聊天(Cmd+K)中尝试以下操作:
搜索网页:
Search for TypeScript best practices 2025抓取页面:
Scrape anycrawl.dev and tell me what it does获取文档:
Scrape the React hooks documentation and explain useEffect爬取网站:
Crawl the blog section of example.com and summarize the articlesCursor 将自动使用 AnyCrawl 的搜索、抓取和爬取工具。
故障排除
服务器无响应
- 检查您的 API 密钥是否有效
- 确保已安装 Node.js 18+
- 更改配置后重启 Cursor
权限错误
确保 npx 有执行权限。您可能需要全局安装该包:
npm install -g anycrawl-mcp然后更新配置以使用全局安装的包:
{
"mcpServers": {
"anycrawl": {
"command": "anycrawl-mcp",
"env": {
"ANYCRAWL_API_KEY": "your-api-key"
}
}
}
}