返回 MCP 目录
public公开dns本地运行

skrape-mcp

Skrape MCP Server是一个将网页转换为适合LLM处理的Markdown格式的服务,通过skrape.ai API实现。

article

README

🚀 Skrape MCP 服务器

使用 skrape.ai 将任何网页转换为干净、适合大语言模型(LLM)的 Markdown 格式,非常适合将网络内容输入到 LLM 中。此 MCP 服务器提供了一个简单的接口,使用 skrape.ai API 将网页转换为结构化、干净的 Markdown 格式,设计用于与 Claude Desktop、其他 LLM 和兼容 MCP 的应用程序无缝集成。

smithery badge

🚀 快速开始

此 MCP 服务器能让你轻松将网页转换为适合 LLM 的 Markdown 格式,以下为你介绍使用方法。

✨ 主要特性

使用 Skrape 进行 LLM 集成的原因

  • 清洁、结构化的输出:生成格式良好的 Markdown,适合 LLM 消费。
  • 噪声减少:自动去除广告、导航菜单和其他无关内容。
  • 一致的格式:无论来源如何,确保网络内容均匀结构化。
  • JavaScript 支持:通过渲染 JavaScript 处理动态内容。
  • LLM 优化:非常适合将网络内容输入到 Claude、GPT 和其他 LLM 模型中。

工具

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

📦 安装指南

使用 Smithery 进行自动安装

要通过 Smithery 自动为 Claude Desktop 安装 Skrape MCP 服务器,可执行以下命令:

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

💻 使用示例

与 LLM 结合使用

以下是将服务器与 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": true
  }
}
</arguments>
</use_mcp_tool>

📚 详细文档

项目地址

功能概览

1. 服务器安装与配置

  • 步骤 1:克隆仓库
git clone https://github.com/skrape-ai/skrape-mcp-server.git
cd skrape-mcp-server
  • 步骤 2:安装依赖项
npm install
  • 步骤 3:配置服务器
    • 创建 config.json 文件:
{
  "port": 3000,
  "api_key": "your_api_key_here"
}
  • 步骤 4:启动服务器
npm start

2. 客户端使用示例

示例 1:基本用法
const { Client } = require('@skrape/mcp-client');

async function main() {
    const client = new Client('localhost', 3000);
    const result = await client.getMarkdown('https://example.com');
    console.log(result.markdown); // 输出 Markdown 内容
}

main().catch(console.error);
示例 2:使用高级选项
const { Client } = require('@skrape/mcp-client');

async function main() {
    const options = {
        renderJs: true,
        returnJson: true
    };
    
    const client = new Client('localhost', 3000);
    const result = await client.getMarkdown('https://example.com', options);
    console.log(result); // 输出 JSON 响应
}

main().catch(console.error);

文档资源

支持与联系

其他资源

help

运行方式说明

cloud

托管运行

托管运行通常表示这个 MCP Server 由服务方环境承载,用户一般按页面提供的连接方式或授权流程接入,不需要在本地长期启动一个 MCP 进程

  1. 打开服务方连接页
  2. 完成授权或复制端点
  3. 在 MCP 客户端中连接
terminal

本地运行 / 其它方式

本地运行通常需要用户在自己的电脑或服务器上安装依赖,把 server_config 复制到 MCP 客户端,并按 env_schema 补齐环境变量、密钥或其它配置

  1. 复制 server_config
  2. 安装所需依赖
  3. 补齐环境变量后重启客户端