Scrappey MCP 服务器
一个模型上下文协议 (MCP) 服务器,用于与 Scrappey.com 的 Web 自动化和数据抓取功能进行交互。您可以直接访问smithery.ai/server/@pim97/mcp-server-scrappey进行试用。
概述
该 MCP 服务器在 AI 模型和 Scrappey 的 Web 自动化平台之间架起了一座桥梁,使您能够:
创建和管理浏览器会话
通过 Scrappey 的基础设施发送 HTTP 请求
执行浏览器操作(单击、键入、滚动等)
自动处理各种反机器人保护
Related MCP server: Prysm MCP Server
设置
从Scrappey.com获取您的 Scrappey API 密钥
设置环境变量:
SCRAPPEY_API_KEY=your_api_key_here可用工具
1. 创建会话( scrappey_create_session )
创建一个新的浏览器会话,以保留 cookie 和其他状态。
{
"proxy": "http://user:pass@ip:port" // Optional: Custom proxy, leave empty for default
}2. 销毁会话( scrappey_destroy_session )
正确关闭浏览器会话。
{
"session": "session_id_here" // Required: The session ID to destroy
}3.发送请求( scrappey_request )
通过 Scrappey 基础设施发送 HTTP 请求。
{
"cmd": "request.get", // Required: request.get, request.post, etc.
"url": "https://example.com", // Required: Target URL
"session": "session_id_here", // Required: Session ID to use
"postData": "key=value", // Optional: POST data
"customHeaders": { // Optional: Custom headers
"User-Agent": "custom-agent"
}
}4. 浏览器操作( scrappey_browser_action )
执行浏览器自动化操作。
{
"session": "session_id_here", // Required: Session ID to use
"browserActions": [ // Required: Array of actions to perform
{
"type": "click", // Action type: click, hover, type, scroll, wait
"cssSelector": ".button", // CSS selector for element
"text": "Hello", // Text to type (for type action)
"wait": 1000 // Wait time in ms
}
]
}典型工作流程
创建会话:
{
"name": "scrappey_create_session"
}将返回的会话 ID 用于后续请求:
{
"name": "scrappey_request",
"cmd": "request.get",
"url": "https://example.com",
"session": "returned_session_id"
}如果需要,执行浏览器操作:
{
"name": "scrappey_browser_action",
"session": "returned_session_id",
"browserActions": [
{
"type": "click",
"cssSelector": "#login-button"
},
{
"type": "type",
"cssSelector": "#username",
"text": "myuser"
}
]
}完成后通过销毁会话进行清理:
{
"name": "scrappey_destroy_session",
"session": "returned_session_id"
}特征
会话持久化以维护状态
自动反机器人保护处理
支持自定义代理
浏览器自动化功能
HTTP 请求方法(GET、POST、PUT、DELETE、PATCH)
自定义标头和 Cookie 支持
最佳实践
每次使用完会话后都要销毁它们
向同一站点发出多个请求时重复使用会话
在动作之间使用适当的等待时间以实现更像人类的行为
使用会话前检查其是否存在
错误处理
出现错误时,服务器会返回包含详细信息的错误消息。常见错误包括:
无效的会话 ID
网络超时
浏览器操作的选择器无效
反机器人保护失败
资源
执照
MIT 许可证