
mrscraper-mcp
io.github.mrscraper-com/mrscraper-mcp
Seven services: account, HTML, Markdown, screenshots, brand, JSON extraction, and web search.
Documentation
MrScraper MCP Server

An MCP server exposing the seven MrScraper services through hosted HTTP or local stdio.
Overview
Seven services. Each tool takes the parameters on its page in the API Reference, with the integration rules in Shared parameters. Names, types, authentication, and code examples follow MCP conventions.
| Service | Public name | Description |
|---|---|---|
| Status | status | Return the raw account status API response without summarizing, redacting body fields, or adding calculated fields. |
| Scrape HTML | scrapeHtml | Retrieve the raw HTML of a page. Browser rendering is optional. |
| Scrape Markdown | scrapeMarkdown | Retrieve a page as clean Markdown. Browser rendering is optional. |
| Get screenshot | getScreenshot | Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled. |
| Scrape brand | scrapeBrand | Extract a website's colors, typography, logos, and social links as JSON. |
| Scrape JSON | scrapeJson | Extract structured JSON from a page using a natural-language prompt. |
| Web search | webSearch | Search the web and return ranked results with titles, URLs, descriptions, and sources. |
Installation
The hosted server requires an MCP client with Streamable HTTP support. Local execution requires Node.js 20 or newer.
Configure the hosted endpoint in your MCP client:
{ "mcpServers": { "mrscraper": { "url": "https://mcp.mrscraper.com/mcp" } } }
For local stdio, configure the client to start npx -y @mrscraper/mcp@latest. The full configuration is in Integration features.
Authentication
Obtain an API key from the MrScraper app. API key used to authenticate the request.
The hosted server supports browser sign-in through OAuth 2.1. Approve account:read for status and scrape:read for all six scraping/search tools. Connections that already hold scrape:read keep working; others must reconnect and approve it for scraping/search.
Clients without OAuth can send an API key as Authorization: Bearer YOUR_TOKEN. Local stdio reads MRSCRAPER_API_KEY, then MRSCRAPER_API_TOKEN. Tools do not accept tokens as arguments.
{
"mcpServers": {
"mrscraper": {
"url": "https://mcp.mrscraper.com/mcp",
"headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
}
}
Quickstart
{
"name": "scrapeHtml",
"arguments": {
"url": "https://example.com",
"browserRendering": true,
"warmStart": true,
"waitForSelector": "body",
"timeout": 120,
"maxRetries": 0
}
}
Examples use example.com as the sample target. Replace it for your use case. Live scraping and search calls consume account quota.
Response examples show selected keys and types observed in live API responses. Values are placeholders; page content, base64 images, and arrays are abbreviated. Actual responses may contain additional fields.
Shared parameters
The tools take the parameters documented for each service in the API reference, with these integration rules:
- A parameter with a default always sends it: when you leave it out, the server sends the default shown in the tool's table. A parameter without a default is sent only when you set it. For example, leaving
browserRenderingout tries the page without a browser first and switches to one if the request is blocked, whilefalsedisables the browser unless one is required. browserRenderingis sent as true wheneverwaitForSelectoris set, even if you chose false, and onscrapeHtmlwheneverscreenshotis true.- HTML, Markdown, screenshots, and JSON extraction always send
saveResult=true, so every result is saved to the dashboard Result tab. - Each tool sends its own fixed values:
html=trueandmarkdown=falsefor HTML;markdown=true,html=false, andscreenshot=falsefor Markdown;browserRendering=true,html=false, andmarkdown=falsefor screenshots;agent=generalfor JSON;action=brand-scrapingandbundle=nonefor brand;action=websearchfor search. - Query fields are sent in a fixed order. Booleans are sent as
trueorfalse, country codes in lowercase, and the search query trimmed.cookiesis sent as given, URL-encoded in the query string (for examplecookies=cookie_name%3Dvalue). - The HTTP deadline of HTML, Markdown, screenshots, and JSON extraction is
timeoutplus 30 seconds. - A call that sets a parameter not listed for its tool is rejected.
Every tool's table below lists its exact parameters, types, and the defaults the server sends.
Service reference
Status
Description
Return the raw account status API response without summarizing, redacting body fields, or adding calculated fields.
Parameters
This service takes no service parameters. Authentication is configured separately.
The HTTP deadline is fixed at 600 seconds. It is not a service parameter.
Example
{
"name": "status",
"arguments": {}
}
Response
The API body contains message and data. Account details remain nested in data, including subscriptionItem and scraperAllowance. The response envelope therefore exposes account details at data.data. Sensitive response headers are removed.
MCP tool result; the API response envelope is in structuredContent:
Success response
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": {
"message": "Example response",
"data": {
"id": "ACCOUNT_ID",
"tokenLimit": 100000,
"tokenUsage": 2500,
"stripeStatus": "active",
"user": {
"name": "Example user",
"email": "user@example.com",
"isVerified": true
},
"subscriptionItem": {
"name": "Example plan",
"tokenLimit": 100000
},
"scraperAllowance": {
"remaining": 97500,
"plans": [
{
"remaining": 97500
}
]
}
}
},
"headers": {
"content-type": "application/json; charset=utf-8"
}
}
}
Scrape HTML
Description
Retrieve the raw HTML of a page. Browser rendering is optional.
Parameters
| Parameter | HTTP field | Type | Default | Description |
|---|---|---|---|---|
url | url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
browserRendering | browserRendering | boolean | Omitted | Whether to load the page in a browser: true enables it, false disables it unless required. Omit to try without a browser first and switch automatically if blocked. waitForSelector forces true. |
timeout | timeout | integer | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. |
warmStart | warmStart | boolean | false | Warm up session before going directly to the target URL. |
blockResources | blockResources | boolean | false | Block images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage. |
waitForSelector | waitForSelector | string | Omitted | Pause until a specific CSS selector or text appears on the page. Useful for content that loads asynchronously after the initial page load. Requires a rendered page. Setting this parameter automatically forces browserRendering to true. |
geoCode | geoCode | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
maxAge | maxAge | integer | 0 | Return a cached result of the same request when it is newer than the selected age. Set to 0 to always fetch fresh results. A cached result costs the same tokens as the original scrape. |
maxRetries | maxRetries | integer | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
screenshot | screenshot | boolean | false | Capture a screenshot too (forces browser rendering). Set to true to include a screenshot, or false (default) for none. |
tokenCap | tokenCap | integer | Omitted | Maximum total tokens the scrape and its retries can use. Automatic retries are bounded by this cap, so the total tokens for a single run stay at or below the value you set. Omit for no limit. |
cookies | cookies | string | Omitted | Cookies to send to the target site, as name=value pairs separated by semicolons (URL-encoded), for pages behind a login session. The gateway sends them as the Cookie header and never forwards the parameter itself. A standard Cookie request header works too; this parameter wins when both are sent. Requests with cookies skip the result cache. |
Always sent: html=true, markdown=false, and saveResult=true.
Example
{
"name": "scrapeHtml",
"arguments": {
"url": "https://example.com",
"browserRendering": true,
"warmStart": true,
"waitForSelector": "body",
"timeout": 120,
"maxRetries": 0
}
}
Response
The response body is HTML text. With screenshot set to true, it is JSON with html and the base64 screenshot.
MCP tool result; the API response envelope is in structuredContent:
Success response
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": "<html><body>Example page content...</body></html>",
"headers": {
"content-type": "text/html; charset=utf-8"
}
}
}
Scrape Markdown
Description
Retrieve a page as clean Markdown. Browser rendering is optional.
Parameters
| Parameter | HTTP field | Type | Default | Description |
|---|---|---|---|---|
url | url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
browserRendering | browserRendering | boolean | Omitted | Whether to load the page in a browser: true enables it, false disables it unless required. Omit to try without a browser first and switch automatically if blocked. waitForSelector forces true. |
timeout | timeout | integer | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. |
warmStart | warmStart | boolean | false | Warm up session before going directly to the target URL. |
blockResources | blockResources | boolean | false | Block images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage. |
waitForSelector | waitForSelector | string | Omitted | Pause until a specific CSS selector or text appears on the page. Useful for content that loads asynchronously after the initial page load. Requires a rendered page. Setting this parameter automatically forces browserRendering to true. |
geoCode | geoCode | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
maxAge | maxAge | integer | 0 | Return a cached result of the same request when it is newer than the selected age. Set to 0 to always fetch fresh results. A cached result costs the same tokens as the original scrape. |
maxRetries | maxRetries | integer | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
tokenCap | tokenCap | integer | Omitted | Maximum total tokens the scrape and its retries can use. Automatic retries are bounded by this cap, so the total tokens for a single run stay at or below the value you set. Omit for no limit. |
cookies | cookies | string | Omitted | Cookies to send to the target site, as name=value pairs separated by semicolons (URL-encoded), for pages behind a login session. The gateway sends them as the Cookie header and never forwards the parameter itself. A standard Cookie request header works too; this parameter wins when both are sent. Requests with cookies skip the result cache. |
Always sent: markdown=true, html=false, screenshot=false, and saveResult=true.
Example
{
"name": "scrapeMarkdown",
"arguments": {
"url": "https://example.com",
"warmStart": true
}
}
Response
The response body is Markdown text.
MCP tool result; the API response envelope is in structuredContent:
Markdown text
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": "# Example page\n\nExample Markdown content...",
"headers": {
"content-type": "text/markdown; charset=utf-8"
}
}
}
Get screenshot
Description
Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled.
Parameters
| Parameter | HTTP field | Type | Default | Description |
|---|---|---|---|---|
url | url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
screenshot | screenshot | string: full, top, or WIDTHxHEIGHT[-ZOOM] | "full" | full (default) captures the entire scroll height, top captures the first viewport, or a custom size WIDTHxHEIGHT with optional -ZOOM, e.g. 1280x800 or 1920x1080-75. Width/height 100 to 3840, zoom 25 to 300. |
timeout | timeout | integer | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. |
waitForSelector | waitForSelector | string | Omitted | Pause until a specific CSS selector or text appears on the page. Useful for content that loads asynchronously after the initial page load. Requires a rendered page. Setting this parameter automatically forces browserRendering to true. |
geoCode | geoCode | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
maxAge | maxAge | integer | 0 | Return a cached result of the same request when it is newer than the selected age. Set to 0 to always fetch fresh results. A cached result costs the same tokens as the original scrape. |
maxRetries | maxRetries | integer | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
tokenCap | tokenCap | integer | Omitted | Maximum total tokens the scrape and its retries can use. Automatic retries are bounded by this cap, so the total tokens for a single run stay at or below the value you set. Omit for no limit. |
cookies | cookies | string | Omitted | Cookies to send to the target site, as name=value pairs separated by semicolons (URL-encoded), for pages behind a login session. The gateway sends them as the Cookie header and never forwards the parameter itself. A standard Cookie request header works too; this parameter wins when both are sent. Requests with cookies skip the result cache. |
Always sent: browserRendering=true, html=false, markdown=false, and saveResult=true.
Example
{
"name": "getScreenshot",
"arguments": {
"url": "https://example.com",
"screenshot": "1280x800"
}
}
Response
The response body is JSON with the base64 PNG screenshot and the page html, which the API includes although html=false is sent.
MCP tool result; the API response envelope is in structuredContent:
Success response
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": {
"screenshot": "BASE64_PNG_DATA"
},
"headers": {
"content-type": "application/json; charset=utf-8"
}
}
}
Scrape brand
Description
Extract a website's colors, typography, logos, and social links as JSON.
Parameters
| Parameter | HTTP field | Type | Default | Description |
|---|---|---|---|---|
url | url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
The HTTP deadline is fixed at 120 seconds. It is not a service parameter.
The request always sends action=brand-scraping and bundle=none. No other parameters are accepted.
Example
{
"name": "scrapeBrand",
"arguments": {
"url": "https://example.com"
}
}
Response
The API body contains message and a data object with job_id, status, url, final_url, brand, and error. Brand details are available at data.data.brand in the response envelope.
MCP tool result; the API response envelope is in structuredContent:
Success response
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": {
"data": {
"job_id": "JOB_ID",
"status": "succeeded",
"url": "https://example.com",
"final_url": "https://example.com",
"brand": {
"name": "Example brand",
"colors": {
"background": "#ffffff",
"text": "#222222"
},
"typography": {
"body": {
"font_family": "Example font"
}
}
},
"error": null,
"bundle_url": null
},
"message": "Example response"
},
"headers": {
"content-type": "application/json"
}
}
}
Scrape JSON
Description
Extract structured JSON from a page using a natural-language prompt.
Parameters
| Parameter | HTTP field | Type | Default | Description |
|---|---|---|---|---|
url | url | string | Required | Absolute HTTP or HTTPS URL of the page to process. |
prompt | prompt | string | "Extract all data as complete as possible." | Describe the data shape you want back (e.g. fields like title, price, rating). This prompt only parses the scraped content. It cannot instruct the scraper flow itself. |
html | html | boolean | true | Whether to include the page HTML in the response. |
browserRendering | browserRendering | boolean | Omitted | Whether to load the page in a browser: true enables it, false disables it unless required. Omit to try without a browser first and switch automatically if blocked. waitForSelector forces true. |
timeout | timeout | integer | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. |
warmStart | warmStart | boolean | false | Warm up session before going directly to the target URL. |
blockResources | blockResources | boolean | false | Block images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage. |
waitForSelector | waitForSelector | string | Omitted | Pause until a specific CSS selector or text appears on the page. Useful for content that loads asynchronously after the initial page load. Requires a rendered page. Setting this parameter automatically forces browserRendering to true. |
geoCode | geoCode | string | Omitted | Two-letter country code to load the page from, sent in lowercase. |
maxAge | maxAge | integer | 0 | Return a cached result of the same request when it is newer than the selected age. Set to 0 to always fetch fresh results. A cached result costs the same tokens as the original scrape. |
maxRetries | maxRetries | integer | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
screenshot | screenshot | boolean | false | Whether to include a base64 screenshot in the response. |
tokenCap | tokenCap | integer | Omitted | Maximum total tokens the scrape and its retries can use. Automatic retries are bounded by this cap, so the total tokens for a single run stay at or below the value you set. Omit for no limit. |
Always sent: agent=general and saveResult=true. The request uses GET. If the encoded URL exceeds 8,000 characters, it switches to POST with url, prompt, and agent in the body; the other settings stay in the query.
Example
{
"name": "scrapeJson",
"arguments": {
"url": "https://example.com",
"prompt": "Extract the first 2 items with title and price.",
"browserRendering": true
}
}
Response
Extracted data is in the API body's data field, with html unless disabled and screenshot when enabled. Response metadata includes thread_id, token_usage, status, error, runtime, and cookies. markdown, and screenshot when not requested, can be empty strings.
MCP tool result; the API response envelope is in structuredContent:
Success response
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": {
"success": true,
"data": [
{
"title": "Example item",
"price": "10.00"
}
],
"thread_id": "THREAD_ID",
"token_usage": 1,
"html": "<html>...</html>",
"markdown": "",
"screenshot": "",
"status": "Results ready",
"error": "",
"runtime": 1.23,
"cookies": []
},
"headers": {
"content-type": "application/json"
}
}
}
Web search
Description
Search the web and return ranked results with titles, URLs, descriptions, and sources.
Parameters
| Parameter | HTTP field | Type | Default | Description |
|---|---|---|---|---|
query | query | string | Required | Search query text, trimmed before sending, containing 1 to 1000 characters. |
country | country | string | Omitted | Two-letter country code to search from, sent in lowercase. |
numResults | numResults | integer | 10 | Number of search results to request, as an integer from 10 to 100. Fewer results may be returned. |
Always sent: action=websearch.
The HTTP deadline is fixed at 120 seconds. It is not a service parameter.
Example
{
"name": "webSearch",
"arguments": {
"query": "site:example.com documentation",
"country": "id",
"numResults": 20
}
}
Response
The API body contains success, message, a data array, and tokenUsage. Each result includes rank, title, url, description, and source.
MCP tool result; the API response envelope is in structuredContent:
Success response
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": {
"success": true,
"message": "Example response",
"data": [
{
"rank": 1,
"title": "Example result",
"url": "https://example.com",
"description": "Example result description.",
"source": "example.com"
}
],
"tokenUsage": 1
},
"headers": {
"content-type": "application/json; charset=utf-8"
}
}
}
Response format
Successful services use an envelope containing status_code, data, and headers. The data field contains the API response body; its field names are not converted to the SDK's naming style. Status preserves the complete body without adding summary fields.
{
"content": [
{
"type": "text",
"text": "[Formatted JSON matching structuredContent]"
}
],
"structuredContent": {
"status_code": 200,
"data": "<html><body>Example page content...</body></html>",
"headers": {
"content-type": "text/html; charset=utf-8"
}
}
}
Tool results include matching text content and structuredContent. The envelope lives in structuredContent. Credential-bearing response headers are filtered, and scraping/search credential metadata is redacted. Status preserves every field in the response body.
Error handling
HTTP and network failures set isError: true on the MCP tool result and include error in the response envelope. Network failures use status_code: null. Invalid inputs are rejected before upstream calls. Authentication and missing OAuth scopes are enforced by the HTTP transport before tool execution.
Integration features
Configuration
Tools authenticate through the connection.
For local stdio:
{
"mcpServers": {
"mrscraper": {
"command": "npx",
"args": ["-y", "@mrscraper/mcp@latest"],
"env": { "MRSCRAPER_API_KEY": "YOUR_TOKEN" }
}
}
}
For local HTTP, run TRANSPORT=http npm start after building; the default endpoint is http://127.0.0.1:8000/mcp. Docker runs can use docker build -f docker/Dockerfile -t mrscraper-mcp . and docker run --rm -p 8000:8000 mrscraper-mcp.
Advanced usage
OAuth access tokens are verified against the configured issuer's JWKS and must include this resource in their audience. API keys are validated before tool execution. HTTP requests use their caller's credential; stdio reads server environment credentials. Metadata discovery is available at /.well-known/oauth-protected-resource and the /mcp path-suffixed variant.
All six scraping/search tools require scrape:read. Status requires account:read. These are the only application scopes advertised in OAuth resource metadata; authorization-server metadata also offers offline_access for refresh tokens. The scraper gateway checks the same token again: GET requests need scrape:read, and the POST that scrapeJson switches to above 8,000 encoded URL characters needs scrape:write, so OAuth connections without that scope receive 403 for such requests. HTML, Markdown, screenshot, and JSON tools advertise readOnlyHint: false because they always save the result to the dashboard Result tab (saveResult=true); status, brand, and search advertise readOnlyHint: true. All tools advertise destructiveHint: false; status has openWorldHint: false and scraping/search have openWorldHint: true.
Supported hosts can render self-contained search and account widgets. The account widget calculates its visual usage display locally from the raw tool result. Widget display does not change the raw status response.
| Environment variable | Default | Purpose |
|---|---|---|
TRANSPORT | stdio | Select stdio or http. |
HOST | 127.0.0.1 | HTTP bind address; Docker uses 0.0.0.0. |
PORT | 8000 | HTTP listen port. |
MRSCRAPER_HTTP_AUTH | 1 | Enable HTTP bearer verification. |
MRSCRAPER_OAUTH | 1 | Accept OAuth access tokens. |
MRSCRAPER_MCP_PUBLIC_URL | https://mcp.mrscraper.com | Public origin and token audience prefix. |
MRSCRAPER_OAUTH_ISSUER | https://api.app.mrscraper.com | Authorization issuer. |
MRSCRAPER_OAUTH_JWKS_URL | <issuer>/.well-known/jwks.json | Token verification keys. |
MRSCRAPER_ALLOWED_ORIGINS | unset | Additional exact browser origins. |
MRSCRAPER_GLAMA_CLAIM | hosted server's token | Glama ownership token served at /.well-known/glama.json and /mcp/.well-known/glama.json; empty disables both. |
MRSCRAPER_API_BASE_URL | platform API | Account endpoint override. |
MRSCRAPER_FETCH_BASE_URL | Scraper API | Scraping/search endpoint override. |
MRSCRAPER_LOG_HTTP_PAYLOAD | off | Request-body diagnostics for trusted environments. |
MRSCRAPER_LOG_HTTP_PAYLOAD_MAX | 8192 | Maximum diagnostic payload length. |
Trusted local origins, claude.ai, chatgpt.com, and configured exact origins are accepted. Service-to-service clients generally send no Origin header. Registry metadata is in server.json; .github/workflows/publish-mcp-registry.yml publishes matching immutable versions through GitHub OIDC.
Troubleshooting
For 401, reconnect through OAuth or check the bearer key. For insufficient_scope, reconnect and approve scrape:read for scraping/search or account:read for status. Ensure the hosted URL ends in /mcp because the audience is bound to that resource. For origin errors, configure the exact browser origin in MRSCRAPER_ALLOWED_ORIGINS. Start a new client session if cached tool schemas are stale.
Development and testing
Automated checks
The automated suite checks service behavior without production API calls.
npm ci
npm test
npm run lint
npm run format:check
npm run build
Manual checks
The following commands call the live API using your credentials and consume quota.
npm run test:manual -- status
npm run test:manual -- scrapeHtml --url https://example.com
npm run test:manual -- webSearch --query "site:example.com documentation"
npm run test:e2e
License
MIT. See LICENSE.
No installation packages available.