返回市场
刮取-mcp

刮取-mcp

作者:skrapeai11 星标更新:2025-07-30

项目介绍

Skrape MCP 服务器

smithery 徽章

使用 skrape.ai 将网页转换为干净、适合LLM处理的Markdown。这是一个MCP服务器,可以无缝集成网络抓取与Claude Desktop和其他兼容MCP的应用程序。

主要特性

  • 干净输出:移除广告、导航和无关内容
  • JavaScript支持:处理动态内容渲染
  • LLM优化:结构化的Markdown非常适合AI消费
  • 一致格式:无论来源如何,都保持统一的结构

功能

工具

  • get_markdown - 将任意网页转换为适合LLM处理的Markdown
    • 接受任意输入URL和可选参数
    • 返回干净、结构化的Markdown,优化用于LLM消费
    • 支持JavaScript渲染以处理动态内容
    • 可选的JSON响应格式,适用于高级集成

安装

通过Smithery安装

要通过Smithery自动安装Skrape MCP服务器到Claude Desktop:

npx -y @smithery/cli install @skrapeai/skrape-mcp --client claude

手动安装

  1. skrape.ai获取你的API密钥

  2. 安装依赖项:

npm install
  1. 构建服务器:
npm run build
  1. 在Claude Desktop中添加服务器配置:

在MacOS上:

nano ~/Library/Application\ Support/Claude/claude_desktop_config.json

在Windows上:

notepad %APPDATA%/Claude/claude_desktop_config.json

添加以下配置(替换路径和API密钥为你自己的值):

{
  "mcpServers": {
    "skrape": {
      "command": "node",
      "args": ["path/to/skrape-mcp/build/index.js"],
      "env": {
        "SKRAPE_API_KEY": "your-key-here"
      }
    }
  }
}

使用LLMs

这里是如何使用该服务器与Claude或其他LLM模型:

  1. 首先确保服务器已在你的LLM应用程序中正确配置
  2. 然后,你可以让ALLMI抓取并处理任意网页:
将此网页转换为markdown: https://example.com

Claude将这样使用MCP工具:
<use_mcp_tool>
<server_name>skrape</server_name>
<tool_name>get_markdown</tool_name>
<arguments>
{
  "url": "https://example.com",
  "options": {
    "renderJs": true
  }
}
</arguments>
</use_mcp_tool>

生成的Markdown将是干净、结构化且准备好供LLM处理。

高级选项

get_markdown工具接受这些参数:

  • url(必需):要转换的任意网页URL
  • returnJson(可选):设置为true以获取完整的JSON响应,而不仅仅是markdown
  • options(可选):额外的抓取选项
    • renderJs:是否在抓取前渲染JavaScript(默认:true)

带有所有选项的例子:

<use_mcp_tool>
<server_name>skrape</server_name>
<tool_name>get_markdown</tool_name>
<arguments>
{
  "url": "https://example.com",
  "returnJson": true,
  "options": {
    "renderJs": false
  }
}
</arguments>
</use_mcp_tool>

开发

为了开发时自动重建:

npm run watch

调试

由于MCP服务器通过stdio通信,调试可能会很困难。我们推荐使用MCP Inspector

npm run inspector

Inspector会提供一个URL,以便你在浏览器中访问调试工具。


<a href="https://glama.ai/mcp/servers/7i81qzgkzd"> <img width="190" height="100" src="https://gips3.baidu.com/it/u=2257864741,1243427117&fm=3081&app=3081&f=PNG?w=760&h=400" /> </a> </中文翻译>