关于 Scrapi
Scrapi 是供 Agent 读取网页的 MCP 服务,可返回清理后的 Markdown 或纯文本及元数据,并支持 JavaScript 渲染页面和并行抓取 URL。
主要功能
- 01URL 转 Markdown 或纯文本
- 02提取标题、作者、日期和图片
- 03清除广告、导航和脚本
- 04支持 JavaScript 渲染页面
- 05并行抓取多个 URL
- 06查询用量与账单
适用场景
- 01总结网页文章
- 02读取网站定价信息
- 03查阅 API 文档
- 04并行收集多个页面内容
MCP 相关
Scrapi 提供抓取单个或多个 URL、查看抓取器状态以及查询用量和账单的工具。支持 stdio 和 Streamable HTTP 传输方式。
配置
远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。
https://scrapi.ai/mcpclaude mcp add --transport http scrapi https://scrapi.ai/mcp{"mcpServers":{"scrapi":{"type":"http","url":"https://scrapi.ai/mcp"}}}在 Cursor 中打开{"servers":{"scrapi":{"type":"http","url":"https://scrapi.ai/mcp"}}}在 VS Code 中打开{"mcpServers":{"scrapi":{"type":"http","url":"https://scrapi.ai/mcp"}}}{"mcpServers":{"scrapi":{"serverUrl":"https://scrapi.ai/mcp"}}}命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。
https://scrapi.ai/mcp需要授权工具
5| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| format | enum | 否 | 输出格式:markdown(默认)或 textmarkdown | text |
| url | string | 是 | 要抓取的网页 URL |
详细介绍
将 URL 转换为适用于大模型 Agent 的干净 Markdown/文本的 MCP 服务
⚡ 快速可靠 — 基于 8 年以上的网页抓取经验、1,900 多个生产级爬虫,以及经过实战验证的反机器人处理能力构建。
这是什么?
一个 MCP(模型上下文协议)服务,可让 AI Agent 获取和阅读网页。只需提供一个 URL,即可快速获得干净、适用于大模型的内容。
之前: AI 无法直接阅读网页
之后:“总结这篇文章”轻松搞定 ✨
功能
- 🌐 URL → Markdown:保留标题、列表和链接
- 📄 URL → 文本:提取纯文本
- 🏷️ 元数据:标题、作者、日期、图片
- 🧹 干净的输出:无广告、无导航、无脚本
- ⚡ JavaScript 渲染:支持 SPA
- 💳 内置计费:积分跟踪、订阅管理、用量分析(MCP 密钥)
- 🔄 自动重试:遇到 429 速率限制响应时,根据 Retry-After 自动重试
- 🌍 双传输模式:Stdio(npx)+ Streamable HTTP,部署方式灵活
传输模式
Scrapi MCP Server 支持两种传输模式:
| 模式 | 最适合 | 是否需要 Node.js |
|---|---|---|
| Stdio | Claude Desktop、Cursor、Cline、Claude Code | 是(通过 npx 自动运行) |
| Streamable HTTP | 所有客户端、无需 Node.js 的环境 | 否 |
前提条件
- Scrapi MCP 账户(与主 Scrapi 账户分开)
- 已安装 Claude Desktop、Cline 或 Cursor
- Node.js 20+
安装
选项 A:npx(推荐)
无需安装。只需将 MCP 客户端配置为使用 npx。
{
"mcpServers": {
"scrapi": {
"command": "npx",
"args": ["-y", "@scrapi.ai/mcp-server"],
"env": {
"SCRAPI_API_KEY": "your-api-key"
}
}
}
}
**提示:**也可以通过 CLI 参数传递 API 密钥,而不是使用环境变量:
"args": ["-y", "@scrapi.ai/mcp-server", "--api-key", "your-api-key"]
配置位置请参阅步骤 2。
选项 B:从源代码安装
# Clone the repository
git clone https://github.com/bamchi/scrapi-mcp-server.git
cd scrapi-mcp-server
# Install dependencies and build
npm install && npm run build
步骤 1:获取 API 密钥
- 前往 https://scrapi.ai
- 注册或登录
- 访问 MCP 控制面板 — 系统会自动创建免费套餐(每月 500 积分)和 API 密钥
- 复制你的
hsmcp_API 密钥
步骤 2:配置 MCP 服务
Claude Desktop
选项 A:通过设置配置(推荐)
- 打开 Claude Desktop
- 点击“设置”(左下角的齿轮图标)
- 选择“Developer”选项卡
- 点击“Edit Config”按钮
- 添加 mcpServers 配置(见下文)
- 保存并重启 Claude Desktop(按 Cmd+Q 退出,然后重新打开)
选项 B:直接编辑配置文件
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
配置(npx):
{
"mcpServers": {
"scrapi": {
"command": "npx",
"args": ["-y", "@scrapi.ai/mcp-server"],
"env": {
"SCRAPI_API_KEY": "your-api-key"
}
}
}
}
配置(从源代码安装):
{
"mcpServers": {
"scrapi": {
"command": "node",
"args": ["/absolute/path/to/scrapi-mcp-server/dist/index.js"],
"env": {
"SCRAPI_API_KEY": "your-api-key"
}
}
}
}
注意:将
/absolute/path/to/替换为克隆此仓库的实际路径。
Cline
配置文件位置:
- macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Windows:
%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
配置(npx):
{
"mcpServers": {
"scrapi": {
"command": "npx",
"args": ["-y", "@scrapi.ai/mcp-server"],
"env": {
"SCRAPI_API_KEY": "your-api-key"
}
}
}
}
配置(从源代码):
{
"mcpServers": {
"scrapi": {
"command": "node",
"args": ["/absolute/path/to/scrapi-mcp-server/dist/index.js"],
"env": {
"SCRAPI_API_KEY": "your-api-key"
}
}
}
}
Cursor
在项目根目录中创建或编辑 .cursor/mcp.json:
配置(npx):
{
"mcpServers": {
"scrapi": {
"command": "npx",
"args": ["-y", "@scrapi.ai/mcp-server"],
"env": {
"SCRAPI_API_KEY": "your-api-key"
}
}
}
}
配置(从源代码):
{
"mcpServers": {
"scrapi": {
"command": "node",
"args": ["/absolute/path/to/scrapi-mcp-server/dist/index.js"],
"env": {
"SCRAPI_API_KEY": "your-api-key"
}
}
}
}
Claude Code
选项 1:CLI 命令(推荐)
claude mcp add scrapi-ai -s user -e SCRAPI_API_KEY=your-api-key -- npx -y @scrapi.ai/mcp-server
也可以使用 --api-key:
claude mcp add scrapi-ai -s user -- npx -y @scrapi.ai/mcp-server --api-key your-api-key
选项 2:编辑配置文件
编辑 ~/.claude.json 或项目中的 .mcp.json:
{
"mcpServers": {
"scrapi": {
"command": "npx",
"args": ["-y", "@scrapi.ai/mcp-server", "--api-key", "your-api-key"]
}
}
}
Streamable HTTP
通过 Streamable HTTP 连接——客户端无需安装 Node.js。
端点:https://scrapi.ai/mcp
Cursor(.cursor/mcp.json):
{
"mcpServers": {
"scrapi": {
"url": "https://scrapi.ai/mcp",
"headers": {
"Authorization": "Bearer your-api-key"
}
}
}
}
Claude Code(CLI):
claude mcp add --transport http scrapi https://scrapi.ai/mcp \
--header "Authorization: Bearer your-api-key"
Cline(cline_mcp_settings.json):
{
"mcpServers": {
"scrapi": {
"type": "streamableHttp",
"url": "https://scrapi.ai/mcp",
"headers": {
"Authorization": "Bearer your-api-key"
}
}
}
}
Claude Desktop(claude_desktop_config.json):
{
"mcpServers": {
"scrapi": {
"command": "npx",
"args": [
"mcp-remote",
"https://scrapi.ai/mcp",
"--header",
"Authorization: Bearer your-api-key"
]
}
}
}
注意:Claude Desktop 需要使用 mcp-remote 代理进行 HTTP 连接。
自托管 HTTP 服务(高级)
运行自己的实例,而不是使用托管端点:
SCRAPI_API_KEY=your-api-key npx -y -p @scrapi.ai/mcp-server scrapi-http
# or from source:
SCRAPI_API_KEY=your-api-key node dist/http.js
服务会在 http://localhost:3000 启动,MCP 端点位于 /mcp。使用 PORT 和 HOST 环境变量进行配置。将上述客户端配置中的 URL 替换为你的自托管 URL(例如 http://localhost:3000/mcp)。
健康检查: GET http://localhost:3000/health
第 3 步:重启 AI 客户端
- Claude Desktop:完全退出(macOS 上按 Cmd+Q,Windows 上按 Alt+F4)并重新打开
- Claude Code:重启会话
- Cline:重启 VS Code
- Cursor:重启编辑器
你应该会看到 MCP 服务连接指示器。
可用工具
scrape_url
抓取网页并返回 AI 可读取的内容。
参数:
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
url | string | ✅ | 要抓取的 URL |
format | string | markdown(默认)或 text |
示例:
{
"url": "https://example.com/article",
"format": "markdown"
}
Markdown 输出:
# Article Title
> Author: John Doe | Published: 2024-01-15
## Introduction
This is the main content of the article, converted to clean markdown...
## Key Points
- Point 1: Important detail
- Point 2: Another insight
- [Related Link](https://example.com/related)
文本输出:
Article Title
Author: John Doe | Published: 2024-01-15
Introduction
This is the main content of the article, converted to plain text...
Key Points
- Point 1: Important detail
- Point 2: Another insight
scrape_urls
并行抓取多个网页并返回 AI 可读取的内容。
参数:
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
urls | string[] | ✅ | 要抓取的 URL(最多 10 个) |
format | string | markdown(默认)或 text |
示例:
{
"urls": ["https://example.com/page1", "https://example.com/page2"],
"format": "text"
}
输出:
[
{
"url": "https://example.com/page1",
"content": "Page 1 Title\n\nThis is the content of page 1..."
},
{
"url": "https://example.com/page2",
"content": "Page 2 Title\n\nThis is the content of page 2..."
}
]
scraper_server_status
检查所有 ScraperServer 实例的状态。显示服务健康状况、断路器状态、故障次数和计时信息。
**参数:**无
示例:
{}
输出:
## ScraperServer Status
Total: 3 | Available: 2
| Name | OS | Status | Failures | Last Success | Last Failure |
|------|----|--------|----------|--------------|--------------|
| pluto | linux | OK | 0 | 01/30 14:23:05 | - |
| mars | mac | FAIL | 2 | 01/29 10:00:00 | 01/30 13:55:12 |
| venus | linux | OPEN | 3 | 01/28 09:00:00 | 01/30 12:00:00 |
### Issues
- **mars**: Connection refused - connect(2)
- **venus**: Circuit breaker open until 01/30 12:30:00
- **venus**: Net::ReadTimeout
状态值:
| 状态 | 描述 |
|---|---|
OK | 服务运行正常 |
FAIL | 服务运行异常 |
OPEN | 断路器已打开(隔离 30 分钟) |
N/A | 尚未检查 |
get_usage
检查你的 API 用量和剩余额度。
**参数:**无
示例:
{}
输出:
## MCP Credits
| Item | Value |
|------|-------|
| Plan | starter |
| Subscription Credits | 1,500 |
| Purchased Credits | 200 |
| Total Remaining | 1,700 |
| Period End | 2026-03-01 |
get_billing
获取详细的账单信息,包括订阅、套餐、每日用量和支出限额。
参数:
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
action | string | 是 | subscription、plans、daily_usage 或 spending_limits |
start_date | string | daily_usage 的开始日期(YYYY-MM-DD,默认:30 天前) | |
end_date | string | daily_usage 的结束日期(YYYY-MM-DD,默认:今天) |
示例 — 当前订阅:
{ "action": "subscription" }
## MCP Subscription
| Item | Value |
|------|-------|
| Plan | starter (Starter) |
| Status | active |
| Monthly Credits | 2,000 |
| Price | $19.00/mo |
| Rate Limit | 30 RPM |
| Burst Limit | 5 concurrent |
| Period End | 2026-03-01 |
示例 — 可用套餐:
{ "action": "plans" }
## Available MCP Plans
| Plan | Credits/mo | Price | RPM | Burst |
|------|-----------|-------|-----|-------|
| Free (free) | 500 | Free | 10 | 2 |
| Starter (starter) | 2,000 | $19.00/mo | 30 | 5 |
| Pro (pro) | 10,000 | $49.00/mo | 60 | 10 |
| Business (business) | 50,000 | $149.00/mo | 120 | 20 |
示例 — 每日用量历史:
{ "action": "daily_usage", "start_date": "2026-02-01", "end_date": "2026-02-07" }
## Daily Usage (2026-02-01 ~ 2026-02-07)
| Date | Requests | Credits | Top Tool |
|------|----------|---------|----------|
| 2026-02-07 | 45 | 45 | scrape#scrape (45) |
| 2026-02-06 | 120 | 120 | scrape#scrape (100) |
**Total**: 165 requests, 165 credits
示例 — 支出限额:
{ "action": "spending_limits" }
## Spending Limits
| Item | Value |
|------|-------|
| Daily Limit | 500 credits |
| Today's Usage | 120 credits |
| Usage % | 24.0% |
使用示例
示例 1:总结新闻文章
User: Summarize this article: https://news.example.com/article/12345
Claude: [calls scrape_url]
Here's a summary of the article:
## Key Points
- Point 1: ...
- Point 2: ...
- Point 3: ...
示例 2:获取页面内容
User: Get the content from https://example.com/data
Claude: [calls scrape_url]
# Page Title
> Source: https://example.com/data
The page content is returned in clean Markdown format...
示例 3:调研竞争对手定价
User: What's the pricing on https://competitor.com/product/abc
Claude: [calls scrape_url]
Here's the pricing information:
- **Product**: ABC Premium
- **Regular Price**: $99.00
- **Sale Price**: $79.00 (20% off)
示例 4:阅读 API 文档
User: Read https://docs.example.com/api/v2 and write integration code
Claude: [calls scrape_url]
I've analyzed the API documentation. Here's the integration code:
// api-client.ts
export class ExampleApiClient {
private baseUrl = 'https://api.example.com/v2';
async getData(): Promise<Response> {
// ...
}
}
工作原理
┌─────────────────┐
│ User │
│ "Summarize this │
│ URL for me" │
└────────┬────────┘
│
▼
┌─────────────────┐
│ Claude Desktop │
│ / Cursor │
└────────┬────────┘
│
▼
┌─────────────────┐ ┌─────────────────┐
│ MCP Server │────►│ Scrapi API │
│ (scrape_url) │ │ (format param) │
└────────┬────────┘ └────────┬────────┘
│ │
│◄──────────────────────┘
│ Markdown/Text Response
▼
┌─────────────────┐
│ AI Response │
│ (Summary, etc.) │
└─────────────────┘
为什么选择 Scrapi?
由 Scrapi 背后的团队打造,拥有 8 年以上的网页抓取经验:
- ✅ 1,900 多个生产级爬虫
- ✅ 支持 JavaScript 渲染
- ✅ 反机器人处理
- ✅ 99.9% 的正常运行时间
故障排除
“需要 API 密钥”
请确保通过以下方式之一提供 API 密钥:
- 环境变量:在配置中设置
SCRAPI_API_KEY - CLI 参数:在 args 中传入
--api-key your-key
“API 密钥无效”
请在 Scrapi 控制面板中确认 API 密钥正确且处于有效状态。
npx 使用了旧缓存版本
如果升级后仍看到旧行为,请清除 npx 缓存:
npx clear-npx-cache
MCP 服务未连接
- 确保已安装 Node.js 20+
- 尝试手动运行
node /absolute/path/to/scrapi-mcp-server/dist/index.js,检查是否有错误 - 完全退出 Claude Desktop(macOS 上按 Cmd+Q,Windows 上按 Alt+F4),然后重新启动
- 检查“设置”>“开发者”,确认服务已列出
看不到“开发者”选项卡
将 Claude Desktop 更新到最新版本:Claude 菜单 →“检查更新…”
支持
- 电子邮件:[email protected]
- 问题反馈:GitHub Issues
许可证
MIT © Scrapi
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。