Repository avatar
AI Tools
v0.7.0
active

mrscraper-mcp

io.github.mrscraper-com/mrscraper-mcp

Seven services: account, HTML, Markdown, screenshots, brand, JSON extraction, and web search.

Documentation

MrScraper MCP Server

mrscraper-com/mrscraper-mcp MCP server MrScraper MCP connector

MrScraper

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.

ServicePublic nameDescription
StatusstatusReturn the raw account status API response without summarizing, redacting body fields, or adding calculated fields.
Scrape HTMLscrapeHtmlRetrieve the raw HTML of a page. Browser rendering is optional.
Scrape MarkdownscrapeMarkdownRetrieve a page as clean Markdown. Browser rendering is optional.
Get screenshotgetScreenshotCapture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled.
Scrape brandscrapeBrandExtract a website's colors, typography, logos, and social links as JSON.
Scrape JSONscrapeJsonExtract structured JSON from a page using a natural-language prompt.
Web searchwebSearchSearch 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 browserRendering out tries the page without a browser first and switches to one if the request is blocked, while false disables the browser unless one is required.
  • browserRendering is sent as true whenever waitForSelector is set, even if you chose false, and on scrapeHtml whenever screenshot is 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=true and markdown=false for HTML; markdown=true, html=false, and screenshot=false for Markdown; browserRendering=true, html=false, and markdown=false for screenshots; agent=general for JSON; action=brand-scraping and bundle=none for brand; action=websearch for search.
  • Query fields are sent in a fixed order. Booleans are sent as true or false, country codes in lowercase, and the search query trimmed. cookies is sent as given, URL-encoded in the query string (for example cookies=cookie_name%3Dvalue).
  • The HTTP deadline of HTML, Markdown, screenshots, and JSON extraction is timeout plus 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

ParameterHTTP fieldTypeDefaultDescription
urlurlstringRequiredAbsolute HTTP or HTTPS URL of the page to process.
browserRenderingbrowserRenderingbooleanOmittedWhether 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.
timeouttimeoutinteger300Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages.
warmStartwarmStartbooleanfalseWarm up session before going directly to the target URL.
blockResourcesblockResourcesbooleanfalseBlock images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage.
waitForSelectorwaitForSelectorstringOmittedPause 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.
geoCodegeoCodestringOmittedTwo-letter country code to load the page from, sent in lowercase.
maxAgemaxAgeinteger0Return 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.
maxRetriesmaxRetriesintegerOmittedMaximum number of retries, as a nonnegative integer. Omit this parameter for no limit.
screenshotscreenshotbooleanfalseCapture a screenshot too (forces browser rendering). Set to true to include a screenshot, or false (default) for none.
tokenCaptokenCapintegerOmittedMaximum 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.
cookiescookiesstringOmittedCookies 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

ParameterHTTP fieldTypeDefaultDescription
urlurlstringRequiredAbsolute HTTP or HTTPS URL of the page to process.
browserRenderingbrowserRenderingbooleanOmittedWhether 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.
timeouttimeoutinteger300Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages.
warmStartwarmStartbooleanfalseWarm up session before going directly to the target URL.
blockResourcesblockResourcesbooleanfalseBlock images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage.
waitForSelectorwaitForSelectorstringOmittedPause 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.
geoCodegeoCodestringOmittedTwo-letter country code to load the page from, sent in lowercase.
maxAgemaxAgeinteger0Return 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.
maxRetriesmaxRetriesintegerOmittedMaximum number of retries, as a nonnegative integer. Omit this parameter for no limit.
tokenCaptokenCapintegerOmittedMaximum 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.
cookiescookiesstringOmittedCookies 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

ParameterHTTP fieldTypeDefaultDescription
urlurlstringRequiredAbsolute HTTP or HTTPS URL of the page to process.
screenshotscreenshotstring: 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.
timeouttimeoutinteger300Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages.
waitForSelectorwaitForSelectorstringOmittedPause 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.
geoCodegeoCodestringOmittedTwo-letter country code to load the page from, sent in lowercase.
maxAgemaxAgeinteger0Return 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.
maxRetriesmaxRetriesintegerOmittedMaximum number of retries, as a nonnegative integer. Omit this parameter for no limit.
tokenCaptokenCapintegerOmittedMaximum 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.
cookiescookiesstringOmittedCookies 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

ParameterHTTP fieldTypeDefaultDescription
urlurlstringRequiredAbsolute 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

ParameterHTTP fieldTypeDefaultDescription
urlurlstringRequiredAbsolute HTTP or HTTPS URL of the page to process.
promptpromptstring"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.
htmlhtmlbooleantrueWhether to include the page HTML in the response.
browserRenderingbrowserRenderingbooleanOmittedWhether 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.
timeouttimeoutinteger300Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages.
warmStartwarmStartbooleanfalseWarm up session before going directly to the target URL.
blockResourcesblockResourcesbooleanfalseBlock images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage.
waitForSelectorwaitForSelectorstringOmittedPause 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.
geoCodegeoCodestringOmittedTwo-letter country code to load the page from, sent in lowercase.
maxAgemaxAgeinteger0Return 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.
maxRetriesmaxRetriesintegerOmittedMaximum number of retries, as a nonnegative integer. Omit this parameter for no limit.
screenshotscreenshotbooleanfalseWhether to include a base64 screenshot in the response.
tokenCaptokenCapintegerOmittedMaximum 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

ParameterHTTP fieldTypeDefaultDescription
queryquerystringRequiredSearch query text, trimmed before sending, containing 1 to 1000 characters.
countrycountrystringOmittedTwo-letter country code to search from, sent in lowercase.
numResultsnumResultsinteger10Number 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 variableDefaultPurpose
TRANSPORTstdioSelect stdio or http.
HOST127.0.0.1HTTP bind address; Docker uses 0.0.0.0.
PORT8000HTTP listen port.
MRSCRAPER_HTTP_AUTH1Enable HTTP bearer verification.
MRSCRAPER_OAUTH1Accept OAuth access tokens.
MRSCRAPER_MCP_PUBLIC_URLhttps://mcp.mrscraper.comPublic origin and token audience prefix.
MRSCRAPER_OAUTH_ISSUERhttps://api.app.mrscraper.comAuthorization issuer.
MRSCRAPER_OAUTH_JWKS_URL<issuer>/.well-known/jwks.jsonToken verification keys.
MRSCRAPER_ALLOWED_ORIGINSunsetAdditional exact browser origins.
MRSCRAPER_GLAMA_CLAIMhosted server's tokenGlama ownership token served at /.well-known/glama.json and /mcp/.well-known/glama.json; empty disables both.
MRSCRAPER_API_BASE_URLplatform APIAccount endpoint override.
MRSCRAPER_FETCH_BASE_URLScraper APIScraping/search endpoint override.
MRSCRAPER_LOG_HTTP_PAYLOADoffRequest-body diagnostics for trusted environments.
MRSCRAPER_LOG_HTTP_PAYLOAD_MAX8192Maximum 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.

Remote