ScrAPI 标志

ScrAPI

组织
DevEnterpriseSoftware

MCP server for using ScrAPI to scrape web pages.

发布者DevEnterpriseSoftware
代码仓库scrapi-mcp
语言TypeScript
复刻数
4
星标数
18
可用工具
0
传输类型stdio
分类
许可协议MIT
链接
  • 将工具接入 AI 工作流

    ScrAPI 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 18 个 Star 和 4 个 Fork。

ScrAPI logo

ScrAPI MCP Server

License: MIT NPM Downloads Docker Pulls smithery badge scrapi-mcp MCP server

ScrAPI MCP Server lets MCP-compatible clients scrape web pages through ScrAPI.

ScrAPI is useful when a page needs a real browser session, CAPTCHA solving, residential proxy access, cookie banner handling, JavaScript rendering, geolocation-aware fetching, or pre-scrape browser actions such as clicking and scrolling.

Contents

Features

  • Scrape any valid https:// or http:// URL through ScrAPI.
  • Return either raw HTML or readable Markdown.
  • Run browser commands before scraping.
  • Use stdio transport for desktop MCP clients.
  • Use Streamable HTTP transport for remote MCP clients and local testing.
  • Run with npx, Docker, Smithery, or from source.

Available Tools

scrape_url_html

Scrapes a URL and returns the result as HTML.

Use this when you need the page structure, links, tables, embedded metadata, or custom downstream parsing.

Inputs:

NameTypeRequiredDescription
urlstringYesThe absolute URL to scrape. Must be a valid URL.
browserCommandsstringNoJSON array string of browser commands to execute before scraping.

Returns:

  • text/html content from the requested page.
  • isError: true with the ScrAPI error body when the upstream request fails.

scrape_url_markdown

Scrapes a URL and returns the result as Markdown.

Use this when the text content matters more than the HTML structure, for example article extraction, product copy, search result summaries, or LLM-friendly page analysis.

Inputs:

NameTypeRequiredDescription
urlstringYesThe absolute URL to scrape. Must be a valid URL.
browserCommandsstringNoJSON array string of browser commands to execute before scraping.

Returns:

  • text/markdown content from the requested page.
  • isError: true with the ScrAPI error body when the upstream request fails.

Prerequisites

Choose one of the following runtime options:

  • Node.js 18 or newer for npx or local development.
  • Docker for container-based usage.
  • An MCP-compatible client such as Claude Desktop, MCP Inspector, or another client that supports stdio or Streamable HTTP MCP servers.

API Key

Set SCRAPI_API_KEY to use your ScrAPI account:

bash
export SCRAPI_API_KEY="your-scrapi-api-key"

PowerShell:

powershell
$env:SCRAPI_API_KEY = "your-scrapi-api-key"

An API key is required. Without one, ScrAPI currently allows limited free usage on certain domain with lower concurrency and queueing priority.

Quick Start

Run with NPX

The default transport is stdio, which is the transport most desktop MCP clients use when they launch a local server process.

bash
npx -y @deventerprisesoftware/scrapi-mcp

With an API key:

bash
SCRAPI_API_KEY="your-scrapi-api-key" npx -y @deventerprisesoftware/scrapi-mcp

PowerShell:

powershell
$env:SCRAPI_API_KEY = "your-scrapi-api-key"
npx -y @deventerprisesoftware/scrapi-mcp

Run with Docker

The published Docker image starts in HTTP mode by default and listens on port 5000.

bash
docker run --rm -p 5000:5000 -e SCRAPI_API_KEY="your-scrapi-api-key" deventerprisesoftware/scrapi-mcp

MCP endpoint:

text
http://localhost:5000/mcp

To run the container as a stdio server for a local MCP client:

bash
docker run -i --rm -e TRANSPORT=stdio -e SCRAPI_API_KEY="your-scrapi-api-key" deventerprisesoftware/scrapi-mcp

MCP Client Setup

Most local coding assistants use one of these two configuration shapes:

  • Stdio: the client starts this package with npx or Docker and communicates over stdin/stdout.
  • Streamable HTTP: you start this server yourself with TRANSPORT=http, then point the client at http://localhost:5000/mcp or your deployed URL.

When a client has a tool timeout setting, use a value close to 300000 milliseconds or 300 seconds. ScrAPI can take several minutes for pages that require CAPTCHA solving, browser rendering, or multiple browser commands.

Claude Desktop with NPX

Add this to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "ScrAPI": {
      "command": "npx",
      "args": ["-y", "@deventerprisesoftware/scrapi-mcp"],
      "env": {
        "SCRAPI_API_KEY": "your-scrapi-api-key"
      }
    }
  }
}

Claude Desktop with Docker

json
{
  "mcpServers": {
    "ScrAPI": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "SCRAPI_API_KEY",
        "deventerprisesoftware/scrapi-mcp"
      ],
      "env": {
        "SCRAPI_API_KEY": "your-scrapi-api-key"
      }
    }
  }
}

After changing the config, restart Claude Desktop. You should see the two ScrAPI tools available in the MCP tools list.

Claude Desktop

Cursor

Cursor supports project configuration at .cursor/mcp.json and global configuration at ~/.cursor/mcp.json. See the Cursor MCP documentation.

Stdio configuration:

json
{
  "mcpServers": {
    "scrapi": {
      "command": "npx",
      "args": ["-y", "@deventerprisesoftware/scrapi-mcp"],
      "env": {
        "SCRAPI_API_KEY": "${env:SCRAPI_API_KEY}"
      }
    }
  }
}

HTTP configuration:

json
{
  "mcpServers": {
    "scrapi": {
      "url": "http://localhost:5000/mcp"
    }
  }
}

For HTTP, start the server first:

bash
TRANSPORT=http PORT=5000 SCRAPI_API_KEY="your-scrapi-api-key" npx -y @deventerprisesoftware/scrapi-mcp

Windsurf

Windsurf Cascade stores MCP servers in ~/.codeium/windsurf/mcp_config.json. You can also add servers from Windsurf Settings > Cascade > MCP Servers. See the Windsurf MCP documentation.

Stdio configuration:

json
{
  "mcpServers": {
    "scrapi": {
      "command": "npx",
      "args": ["-y", "@deventerprisesoftware/scrapi-mcp"],
      "env": {
        "SCRAPI_API_KEY": "${env:SCRAPI_API_KEY}"
      }
    }
  }
}

HTTP configuration:

json
{
  "mcpServers": {
    "scrapi": {
      "serverUrl": "http://localhost:5000/mcp"
    }
  }
}

Windsurf supports serverUrl or url for remote HTTP MCP servers. If your team uses enterprise MCP controls, the server ID in the admin whitelist must match the key name, for example scrapi.

Kilo Code

Kilo Code stores MCP configuration in the main Kilo config file. Use ~/.config/kilo/kilo.jsonc for global configuration, kilo.jsonc in the project root, or .kilo/kilo.jsonc for project-specific configuration. See the Kilo Code MCP documentation.

Local stdio configuration:

jsonc
{
  "mcp": {
    "scrapi": {
      "type": "local",
      "command": ["npx", "-y", "@deventerprisesoftware/scrapi-mcp"],
      "environment": {
        "SCRAPI_API_KEY": "your-scrapi-api-key"
      },
      "enabled": true,
      "timeout": 300000
    }
  }
}

Remote HTTP configuration:

jsonc
{
  "mcp": {
    "scrapi": {
      "type": "remote",
      "url": "http://localhost:5000/mcp",
      "enabled": true,
      "timeout": 300000
    }
  }
}

On Windows, if npx is not found from the Kilo Code UI, use cmd as the command and pass /c, npx, -y, and @deventerprisesoftware/scrapi-mcp as arguments.

Codex

Codex supports MCP servers in the CLI and IDE extension. Both use the same MCP configuration. By default, Codex stores it in ~/.codex/config.toml; trusted projects can also use .codex/config.toml. See the Codex MCP documentation.

Add a stdio server with the Codex CLI:

bash
codex mcp add scrapi --env SCRAPI_API_KEY="your-scrapi-api-key" -- npx -y @deventerprisesoftware/scrapi-mcp
codex mcp list

Equivalent config.toml stdio configuration:

toml
[mcp_servers.scrapi]
command = "npx"
args = ["-y", "@deventerprisesoftware/scrapi-mcp"]
startup_timeout_sec = 20
tool_timeout_sec = 300

[mcp_servers.scrapi.env]
SCRAPI_API_KEY = "your-scrapi-api-key"

HTTP configuration:

toml
[mcp_servers.scrapi]
url = "http://localhost:5000/mcp"
tool_timeout_sec = 300

In the Codex terminal UI, run /mcp to confirm the server is connected.

VS Code

VS Code stores MCP configuration in .vscode/mcp.json for a workspace or in your user profile. The top-level key is servers, not mcpServers. See the VS Code MCP configuration reference.

Stdio configuration:

json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "scrapi-api-key",
      "description": "ScrAPI API key",
      "password": true
    }
  ],
  "servers": {
    "scrapi": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@deventerprisesoftware/scrapi-mcp"],
      "env": {
        "SCRAPI_API_KEY": "${input:scrapi-api-key}"
      }
    }
  }
}

HTTP configuration:

json
{
  "servers": {
    "scrapi": {
      "type": "http",
      "url": "http://localhost:5000/mcp"
    }
  }
}

Use the Command Palette commands MCP: Add Server, MCP: List Servers, and MCP: Reset Cached Tools to add, inspect, and refresh MCP servers.

Claude Code

Claude Code supports MCP servers through the claude mcp CLI and the /mcp command inside Claude Code. See the Claude Code MCP documentation.

Add a stdio server:

bash
claude mcp add --transport stdio --env SCRAPI_API_KEY="your-scrapi-api-key" scrapi -- npx -y @deventerprisesoftware/scrapi-mcp
claude mcp list

Add an HTTP server:

bash
claude mcp add --transport http scrapi http://localhost:5000/mcp
claude mcp list

To make the server available across all Claude Code projects, add --scope user before the server name:

bash
claude mcp add --transport stdio --scope user --env SCRAPI_API_KEY="your-scrapi-api-key" scrapi -- npx -y @deventerprisesoftware/scrapi-mcp

Inside Claude Code, run /mcp to confirm the server is connected.

Generic Stdio MCP Client

Use this shape for clients that accept a command, arguments, and environment variables:

json
{
  "name": "ScrAPI",
  "command": "npx",
  "args": ["-y", "@deventerprisesoftware/scrapi-mcp"],
  "env": {
    "SCRAPI_API_KEY": "your-scrapi-api-key"
  }
}

HTTP Transport

Set TRANSPORT=http to run the server over Streamable HTTP.

bash
TRANSPORT=http PORT=5000 SCRAPI_API_KEY="your-scrapi-api-key" npx -y @deventerprisesoftware/scrapi-mcp

PowerShell:

powershell
$env:TRANSPORT = "http"
$env:PORT = "5000"
$env:SCRAPI_API_KEY = "your-scrapi-api-key"
npx -y @deventerprisesoftware/scrapi-mcp

The MCP endpoint is:

text
http://localhost:5000/mcp

Environment variables:

NameDefaultDescription
SCRAPI_API_KEYLimited default keyScrAPI API key used when calling the ScrAPI scrape API.
TRANSPORTstdioUse stdio or http.
PORT5000Port used when TRANSPORT=http.

Test with MCP Inspector

Stdio mode:

bash
npx @modelcontextprotocol/inspector npx -y @deventerprisesoftware/scrapi-mcp

HTTP mode:

bash
TRANSPORT=http PORT=5000 npx -y @deventerprisesoftware/scrapi-mcp

Then open MCP Inspector and connect to:

text
http://localhost:5000/mcp

MCP Inspector

Cloud-Hosted Server

ScrAPI also provides hosted MCP endpoints:

text
Streamable HTTP: https://api.scrapi.tech/mcp

Cloud MCP servers are not yet supported by every MCP client. They are most useful for custom clients, MCP Inspector, or platforms that support remote MCP servers.

To authenticate with your ScrAPI API key, pass it as a query parameter or request header:

  • Query parameter: https://api.scrapi.tech/mcp?apiKey=<YOUR_API_KEY>
  • Request header: X-API-KEY: <YOUR_API_KEY>

Usage Examples

The exact interaction depends on your MCP client. In most clients, you can either ask the model to use the ScrAPI tool or call the tool directly from a tool inspector.

Scrape a Page as Markdown

Tool:

text
scrape_url_markdown

Arguments:

json
{
  "url": "https://example.com"
}

Example prompt:

text
Use ScrAPI to scrape https://example.com as Markdown and summarize the page.

Scrape a Page as HTML

Tool:

text
scrape_url_html

Arguments:

json
{
  "url": "https://example.com"
}

Example prompt:

text
Use ScrAPI to scrape https://example.com as HTML and extract every link.

Accept Cookies Before Scraping

The browserCommands value must be a string containing a JSON array.

json
{
  "url": "https://example.com",
  "browserCommands": "[{\"click\":\"#accept-cookies\"},{\"wait\":1000}]"
}

Search a Site Before Scraping Results

json
{
  "url": "https://example.com/search",
  "browserCommands": "[{\"input\":{\"input[name='q']\":\"web scraping\"}},{\"click\":\"button[type='submit']\"},{\"waitfor\":\"#results\"}]"
}

Load More Content

json
{
  "url": "https://example.com/products",
  "browserCommands": "[{\"scroll\":1200},{\"wait\":1000},{\"click\":\"button.load-more\"},{\"waitfor\":\".product-card:nth-child(25)\"}]"
}

Browser Commands

Both tools support optional browser commands that interact with the page before ScrAPI captures the final result.

Commands are provided as a JSON array string. They are executed with human-like behavior such as random mouse movement and variable typing speed.

CommandFormatDescription
Click{"click": "#buttonId"}Click an element by CSS selector.
Input{"input": {"input[name='email']": "value"}}Fill an input field.
Select{"select": {"select[name='country']": "USA"}}Select an option by value or visible text.
Scroll{"scroll": 1000}Scroll down by pixels. Use a negative value to scroll up.
Wait{"wait": 5000}Wait for milliseconds. Maximum: 15000.
WaitFor{"waitfor": "#elementId"}Wait for an element to appear in the DOM.
JavaScript{"javascript": "console.log('test')"}Execute custom JavaScript.

Readable command array:

json
[
  { "click": "#accept-cookies" },
  { "wait": 2000 },
  { "input": { "input[name='search']": "web scraping" } },
  { "click": "button[type='submit']" },
  { "waitfor": "#results" },
  { "scroll": 500 }
]

Escaped as an MCP tool argument:

json
{
  "url": "https://example.com",
  "browserCommands": "[{\"click\":\"#accept-cookies\"},{\"wait\":2000},{\"input\":{\"input[name='search']\":\"web scraping\"}},{\"click\":\"button[type='submit']\"},{\"waitfor\":\"#results\"},{\"scroll\":500}]"
}

Need help finding CSS selectors? Try the Rayrun browser extension to select elements and generate selectors.

For more details, see the Browser Commands documentation.

Troubleshooting

The MCP client cannot find the server

  • Confirm Node.js 18 or newer is installed if using npx.
  • Confirm Docker Desktop is running if using Docker.
  • Restart the MCP client after editing its config file.
  • Check that the configured command works in a terminal.

The tools appear, but scraping fails

  • Confirm SCRAPI_API_KEY is set correctly.
  • Try the same URL without browserCommands.
  • Make sure browserCommands is a JSON array string, not a raw JSON array.
  • Use scrape_url_html if Markdown extraction omits structure you need.
  • Long-running pages, CAPTCHA flows, and heavy JavaScript pages can take several minutes.

Browser commands are ignored

The server only sends browser commands when browserCommands parses as a JSON array. This is valid:

json
{
  "browserCommands": "[{\"click\":\"#accept-cookies\"}]"
}

This is not valid for this MCP tool schema because it is an object array, not a string:

json
{
  "browserCommands": [{ "click": "#accept-cookies" }]
}

HTTP endpoint does not respond

  • Confirm the server was started with TRANSPORT=http.
  • Confirm the client connects to /mcp, not /.
  • Confirm the port matches PORT.

Development

Install dependencies:

bash
npm install

Run tests:

bash
npm test

Build:

bash
npm run build

Run from source in stdio mode:

bash
npm run build
node dist/index.js

Run from source in HTTP mode:

bash
TRANSPORT=http PORT=5000 node dist/index.js

Build the Docker image:

bash
docker build -t deventerprisesoftware/scrapi-mcp -f Dockerfile .

Or use the package script:

bash
npm run docker:build

License

This MCP server is licensed under the MIT License. You are free to use, modify, and distribute the software subject to the terms of the MIT License. See LICENSE for details.

安装

TypingMind
前提条件:

Node.js 18+

{
  "mcpServers": {
    "scrapi": {
      "command": "npx",
      "args": [
        "-y",
        "@deventerprisesoftware/scrapi-mcp"
      ],
      "env": {
        "SCRAPI_API_KEY": "<YOUR_API_KEY>"
      }
    }
  }
}

将 ScrAPI MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 ScrAPI 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 ScrAPI 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 ScrAPI MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "scrapi": {
      "command": "npx",
      "args": [
        "-y",
        "@deventerprisesoftware/scrapi-mcp"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 ScrAPI MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 ScrAPI MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 ScrAPI 帮我完成这项任务吗?
ScrAPI
当然。我已阅读。
以下是我使用 ScrAPI 得到的结果。

常见问题

ScrAPI MCP 服务器有什么用途?

ScrAPI 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 ScrAPI MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 ScrAPI,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 ScrAPI MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 ScrAPI 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 ScrAPI MCP 连接到 TypingMind?

ScrAPI 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

ScrAPI MCP 在 TypingMind 中提供哪些工具?

ScrAPI 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 ScrAPI MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 ScrAPI 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇