ScrAPI MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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
- Available tools
- Prerequisites
- API key
- Quick start
- MCP client setup
- HTTP transport
- Cloud-hosted server
- Usage examples
- Browser commands
- Troubleshooting
- Development
- License
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:
| Name | Type | Required | Description |
| ---- | ---- | -------- | ----------- |
| url | string | Yes | The absolute URL to scrape. Must be a valid URL. |
| browserCommands | string | No | JSON 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:
| Name | Type | Required | Description |
| ---- | ---- | -------- | ----------- |
| url | string | Yes | The absolute URL to scrape. Must be a valid URL. |
| browserCommands | string | No | JSON 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:
PowerShell:
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.
With an API key:
PowerShell:
Run with Docker
The published Docker image starts in HTTP mode by default and listens on port 5000.
MCP endpoint:
To run the container as a stdio server for a local MCP client:
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:
Claude Desktop with Docker
After changing the config, restart Claude Desktop. You should see the two ScrAPI tools available in the MCP tools list.
Cursor
Cursor supports project configuration at .cursor/mcp.json and global configuration at ~/.cursor/mcp.json. See the Cursor MCP documentation.