Skip to main content
Glama
pim97

Scrappey MCP Server

by pim97

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

设置

  1. Scrappey.com获取您的 Scrappey API 密钥

  2. 设置环境变量:

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
    }
  ]
}

典型工作流程

  1. 创建会话:

{
  "name": "scrappey_create_session"
}
  1. 将返回的会话 ID 用于后续请求:

{
  "name": "scrappey_request",
  "cmd": "request.get",
  "url": "https://example.com",
  "session": "returned_session_id"
}
  1. 如果需要,执行浏览器操作:

{
  "name": "scrappey_browser_action",
  "session": "returned_session_id",
  "browserActions": [
    {
      "type": "click",
      "cssSelector": "#login-button"
    },
    {
      "type": "type",
      "cssSelector": "#username",
      "text": "myuser"
    }
  ]
}
  1. 完成后通过销毁会话进行清理:

{
  "name": "scrappey_destroy_session",
  "session": "returned_session_id"
}

特征

  • 会话持久化以维护状态

  • 自动反机器人保护处理

  • 支持自定义代理

  • 浏览器自动化功能

  • HTTP 请求方法(GET、POST、PUT、DELETE、PATCH)

  • 自定义标头和 Cookie 支持

最佳实践

  1. 每次使用完会话后都要销毁它们

  2. 向同一站点发出多个请求时重复使用会话

  3. 在动作之间使用适当的等待时间以实现更像人类的行为

  4. 使用会话前检查其是否存在

错误处理

出现错误时,服务器会返回包含详细信息的错误消息。常见错误包括:

  • 无效的会话 ID

  • 网络超时

  • 浏览器操作的选择器无效

  • 反机器人保护失败

资源

执照

MIT 许可证

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pim97/mcp-server-scrappey'

If you have feedback or need assistance with the MCP directory API, please join our Discord server