Labsco
DevEnterpriseSoftware logo

ScrAPI MCP Server

β˜… 18

from DevEnterpriseSoftware

A server for scraping web pages using the ScrAPI API.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedAccount requiredNeeds API keys

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.

API Key

Set SCRAPI_API_KEY to use your ScrAPI account:

Copy & paste β€” that's it
export SCRAPI_API_KEY="your-scrapi-api-key"

PowerShell:

Copy & paste β€” that's it
$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.

HTTP Transport

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

Copy & paste β€” that's it
TRANSPORT=http PORT=5000 SCRAPI_API_KEY="your-scrapi-api-key" npx -y @deventerprisesoftware/scrapi-mcp

PowerShell:

Copy & paste β€” that's it
$env:TRANSPORT = "http"
$env:PORT = "5000"
$env:SCRAPI_API_KEY = "your-scrapi-api-key"
npx -y @deventerprisesoftware/scrapi-mcp

The MCP endpoint is:

Copy & paste β€” that's it
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:

Copy & paste β€” that's it
npx @modelcontextprotocol/inspector npx -y @deventerprisesoftware/scrapi-mcp

HTTP mode:

Copy & paste β€” that's it
TRANSPORT=http PORT=5000 npx -y @deventerprisesoftware/scrapi-mcp

Then open MCP Inspector and connect to:

Copy & paste β€” that's it
http://localhost:5000/mcp

MCP Inspector

Cloud-Hosted Server

ScrAPI also provides hosted MCP endpoints:

Copy & paste β€” that's it
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>

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:

Copy & paste β€” that's it
[
  { "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:

Copy & paste β€” that's it
{
  "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.

Development

Install dependencies:

Copy & paste β€” that's it
npm install

Run tests:

Copy & paste β€” that's it
npm test

Build:

Copy & paste β€” that's it
npm run build

Run from source in stdio mode:

Copy & paste β€” that's it
npm run build
node dist/index.js

Run from source in HTTP mode:

Copy & paste β€” that's it
TRANSPORT=http PORT=5000 node dist/index.js

Build the Docker image:

Copy & paste β€” that's it
docker build -t deventerprisesoftware/scrapi-mcp -f Dockerfile .

Or use the package script:

Copy & paste β€” that's it
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.