MrScraper MCP

io.github.mrscraper-com由 GitHub 帳號 mrscraper-com 發布v0.3.0更新於 Nov 4, 2026

Scraper API for HTML, Markdown, and screenshots, web search, and account usage for AI agents.

已驗證Streamable HTTP可網頁執行網頁搜尋與抓取瀏覽器自動化資料與分析

概覽

AI 產生的概覽

MrScraper 官方伺服器,讓助理抓取網頁的 HTML、Markdown 或截圖,進行網頁搜尋,並查看帳戶 token 用量。

可以做什麼
  • 依網址抓取頁面,回傳 HTML、Markdown、截圖或它們的組合,可設定代理國家、瀏覽器渲染、等待選擇器、自訂請求標頭與重試
  • 以搜尋字串或搜尋結果網址執行網頁搜尋,回傳含標題、連結與摘要的排序結果,可指定地區與結果數量
  • 查詢所連結帳戶的方案、token 上限、已用與剩餘 token 及續約日期
  • 把兩個網頁工具串起來,先搜尋找到頁面再抓取內容
適用情境
適合助理需要取得公開網頁的即時內容或搜尋結果時,例如研究、監控或資料擷取工作;也適合在同一連線中隨時查看抓取 token 的消耗情況。
執行需求
使用 MrScraper 的遠端 Streamable HTTP 端點,或在本地以 Node.js 20 以上執行開源 npm 套件。託管方式透過瀏覽器完成 OAuth 2.1 登入;自架與 stdio 方式需要 MrScraper API 金鑰,以 bearer 權杖或 MRSCRAPER_API_KEY 環境變數提供。需要一個有可用 token 的 MrScraper 帳戶。
安裝前請注意
抓取與搜尋會消耗帳戶 token,費用與方案相關。API 金鑰擁有帳戶的完整權限且不受作用域限制,應存放在密鑰管理功能而非專案檔案。OAuth 的 scrape:read、scrape:write 與 account:read 需分別授權;status 工具會回傳帳戶姓名、電子郵件與用量。傳入的目標網址、請求標頭、cookie 與代理憑證會送到 MrScraper 服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MrScraper MCP,將其新增到工作區。
  2. 連接 所需的 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/io.github.mrscraper-com%2Fmrscraper-mcp/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。 客戶端會在首次連接時完成 OAuth 登入。

{
  "mcpServers": {
    "mrscraper": {
      "type": "http",
      "url": "https://mcp.mrscraper.com/mcp"
    }
  }
}

README

MrScraper MCP Server for Web Scraping and Web Search

MrScraper MCP is the official MrScraper server for the Model Context Protocol. It connects AI assistants to page content and web search through two tools, plus an account check. Retrieve HTML, Markdown, or screenshots with scraperAPI, discover pages with webSearch, and check your plan and token usage with status.

Use the hosted server with OAuth sign-in, or run the open-source server locally with the @mrscraper/mcp npm package. See the MrScraper MCP documentation for setup instructions and client configurations.

The server exposes three tools:

text
scraperAPI  webSearch  status

Deployment options

OptionEndpoint or commandBest for
Hostedhttps://mcp.mrscraper.com/mcpA managed Streamable HTTP connection
Local HTTPTRANSPORT=http npx -y @mrscraper/mcp@latestA self-managed HTTP service
Local stdionpx -y @mrscraper/mcp@latestMCP clients that launch a local process

The hosted server signs you in through your browser with OAuth 2.1, so there is no key to copy. Self-hosted and stdio setups use a MrScraper API key from app.mrscraper.com/api-tokens, which the hosted server also still accepts.

Connect to the hosted server

Point your MCP client at https://mcp.mrscraper.com/mcp with no credential. The server answers with an OAuth challenge, your client opens a browser, and you approve the connection on app.mrscraper.com.

sh
claude mcp add --transport http --scope user \  mrscraper https://mcp.mrscraper.com/mcp

For clients configured by file, omit the headers block entirely:

json
{  "mcpServers": {    "mrscraper": {      "type": "http",      "url": "https://mcp.mrscraper.com/mcp"    }  }}

Use exactly this URL, including the /mcp path. It is the resource identifier access tokens are issued for, and a token minted for a different spelling of the address will be refused.

What you are approving

ScopeGrants
scrape:readwebSearch
scrape:writescraperAPI
account:readstatus

A tool called without its scope is refused with 403 insufficient_scope, and your client will offer to grant the missing permission.

scraperAPI submits a scraping job to the backend with POST /, which requires scrape:write. Connections authorized before this scope was advertised need to authorize again and grant it; scrape:read alone does not grant write access.

Disconnect it later under Connected applications in your MrScraper account. Disconnecting revokes the refresh tokens immediately; an access token already issued stops working within the hour.

Connect with an API key instead

An API key still works as a bearer token, which is what self-hosted deployments and non-OAuth clients use:

json
{  "mcpServers": {    "mrscraper": {      "type": "http",      "url": "https://mcp.mrscraper.com/mcp",      "headers": {        "Authorization": "Bearer YOUR_MRSCRAPER_API_KEY"      }    }  }}

Use your client's environment-variable or secret-storage feature so the key stays out of project files. An API key carries your full account authority, so no scope is enforced against it.

Codex
sh
export MRSCRAPER_API_KEY="YOUR_MRSCRAPER_API_KEY"codex mcp add mrscraper \  --url https://mcp.mrscraper.com/mcp \  --bearer-token-env-var MRSCRAPER_API_KEY

Start Codex from an environment containing MRSCRAPER_API_KEY. Codex stores the environment-variable name in its MCP configuration.

Claude Code
sh
claude mcp add \  --transport http \  --scope user \  --header "Authorization: Bearer YOUR_MRSCRAPER_API_KEY" \  mrscraper https://mcp.mrscraper.com/mcp

Claude Code also supports project and local scopes. Choose the scope that matches how broadly the connection should be available.

Copyable agent setup prompt

text
Connect MrScraper MCP to this agent. Detect the current MCP client and configure a Streamable HTTP server named mrscraper at https://mcp.mrscraper.com/mcp with no credential. The server uses OAuth 2.1, so the client will open a browser to sign in. If the client cannot do OAuth, fall back to a MrScraper API key from https://app.mrscraper.com/api-tokens stored through the client's environment-variable or secret-storage mechanism and sent as Authorization: Bearer <key>. Reload the MCP client when required, then list the tools and confirm that scraperAPI, webSearch, and status are the only available tools.

Choosing a tool

ToolChoose it when
scraperAPIYou have a page URL and need HTML, Markdown, a screenshot, or a combination.
webSearchYou have a search query and need ranked results with links.
statusYou need the account's plan, token usage, or remaining tokens.

A discovery workflow is webSearch → scraperAPI. Both web tools advertise readOnlyHint: true, openWorldHint: true, and destructiveHint: false; status is read-only and not open-world. Authentication comes from the MCP connection; no tool takes an API token argument.

Migration from the previous tool set

Only scraperAPI, webSearch, and status are registered. The other old tool names are removed.

Previous callReplacement
fetchscraperAPI; uses POST, SDK options, and automatic browser fallback by default.
serpwebSearch; rename query_or_url to url and client_timeout to timeout.
statusstatus for account usage; the domain, from, to, action, and api_token_name inputs are gone.
scrape, rerun, results, resultRemoved from this MCP server.

super_mode becomes super. home_page now maps to warmStart, and token_cap=0 is accepted. Restart the server and reconnect the MCP client after updating so it refreshes tools/list.

Changes in 0.3.0

webSearch now calls MrScraper's web search action on the Scraper API host and returns a ranked list of results. It gained num_results, and region must be a two-letter country code. The 0.2 options raw, format, language, page, and render_js are no longer supported: calls that still send them succeed, and the options are ignored. MRSCRAPER_SYNC_BASE_URL is gone; MRSCRAPER_FETCH_BASE_URL now covers both web tools.

Tool reference

The options and defaults of scraperAPI follow the Python SDK's scraper_api method. MCP tool names use camel case; their argument names use snake case.

scraperAPI

text
POST https://api.mrscraper.com/

Start with a known URL:

json
{  "url": "https://www.scrapethissite.com/pages/simple/"}

Request HTML, Markdown, and a screenshot together:

json
{  "url": "https://example.com",  "html": true,  "markdown": true,  "screenshot": true,  "super": true,  "home_page": true,  "geo_code": "ID",  "timeout": 120}

Omit browser_rendering or use null to let the service try without a browser and fall back to browser loading. true forces browser loading and false disables it. A screenshot always forces browser loading, even when browser_rendering=false. super selects real-device routing independently.

The JSON body contains url, maxRetries, and optional tokenCap. Page options are query parameters. For API keys, the request also includes the SDK-compatible token query parameter and Authorization/x-api-token headers. OAuth JWTs are sent only through Authorization.

InputDefaultAPI mapping / purpose
urlrequiredBody url; absolute HTTP(S) page URL.
htmltrueQuery html; request HTML.
markdownfalseQuery markdown; request Markdown.
timeout120Query timeout; integer from 1 to 300 seconds. Transport allows 30 additional seconds.
geo_code"US"Query geoCode; proxy country code.
proxy_countryomittedQuery proxyCountry; compatibility country field.
browser_renderingomittedQuery browserRendering; true/false, or omit/null for automatic fallback.
superfalseQuery super=true when enabled.
use_proxytrueQuery useProxy=false when disabled.
proxyomittedQuery proxy; custom username:password@host:port proxy.
wait_for_selectoromittedQuery waitForSelector; CSS selector to wait for.
home_pagefalseQuery warmStart=true when enabled.
screenshotfalseQuery screenshot=true; also sets browserRendering=true.
block_resourcesfalseQuery blockResources=true; block images, CSS, and fonts.
bypass_proxyfalseQuery bypassProxy=true; proxy-bypass/resource-blocking option.
cookie_jaromittedQuery cookieJar; cookie configuration string.
headersomittedQuery headers; target request headers as an object or JSON string.
max_retries3Body maxRetries; nonnegative integer, 0 disables retries.
token_capomittedBody tokenCap; nonnegative integer retry-token budget.
streamomittedQuery stream; response is buffered into the normal MCP envelope.
discard_token_secret""Optional x-discard-token-secret header.

webSearch

text
POST https://api.mrscraper.com

The JSON body carries action: "websearch", the query, and the optional country and result count. Ask for 20 results from the United Kingdom:

json
{  "url": "running shoes",  "region": "gb",  "num_results": 20}

A search results URL also works; its q parameter becomes the query.

InputDefaultRequest mapping / purpose
urlrequiredBody query; search text, or a search results URL whose q value is used.
regionusBody country; two-letter country code.
num_results10Body numResults; 10 to 100. The search may return fewer.
timeout600Local HTTP deadline in seconds; omitted from the body.

status

text
GET https://api.app.mrscraper.com/api/v1/subscription-accounts

status takes no input. It returns the connected account's identity (name, email, and verification state), subscription status, token limit, token usage, remaining tokens, usage percentage, rate limit, auto-renewal, and renewal date. It copies only those fields, so the API key and Stripe identifiers in the raw account record never reach the client.

json
{  "kind": "mrscraper-cli-status-summary",  "source_endpoints": ["/subscription-accounts"],  "status_code": 200,  "data": {    "account": {      "subscription_status": "active",      "enterprise": false,      "token_usage": 61240,      "token_limit": 100000,      "token_remaining": 38760,      "usage_percent": 61.24,      "rate_limit": 0,      "rate_ttl": 0,      "auto_renew": true,      "ends_at": "2026-12-01T00:00:00.000Z",      "user": {        "name": "Ada",        "email": "[email protected]",        "verified": true      }    }  }}

An OAuth connection needs the account:read scope for status.

Response envelope

scraperAPI and webSearch return status_code, data, and headers in structuredContent and as JSON text. JSON bodies are parsed; other response bodies remain text. status returns the summary shown above.

A scraperAPI response carries the requested representations in data; screenshot is a base64-encoded JPEG and x-status-code is the target page's status:

json
{  "status_code": 200,  "data": {    "html": "<!DOCTYPE html>...",    "markdown": null,    "screenshot": null,    "token_usage": 3,    "runtime": 18.02,    "retry_count": 0,    "error": null  },  "headers": {    "content-type": "application/json",    "x-status-code": "200",    "token_usage": "3"  }}

A webSearch response lists the results in data.data, each with rank, title, url, description, and source:

json
{  "status_code": 200,  "data": {    "success": true,    "message": "Search completed",    "data": [      {        "rank": 1,        "title": "Web Scraping API | MrScraper",        "url": "https://mrscraper.com/",        "description": "Extract structured data from any website with AI.",        "source": "MrScraper"      }    ],    "tokenUsage": 1  },  "headers": { "content-type": "application/json; charset=utf-8" }}

Failures include error and set MCP isError=true. Network failures have status_code=null. Credential-bearing response headers and JSON metadata are filtered; network errors redact signed query credentials.

Manual testing: one tool at a time

scripts/test-tools.ts starts the compiled local MCP server over stdio, verifies that exactly the three tools are exposed, calls one tool, prints its response, and exits. No separate server terminal is needed. The runner loads .env, or reads MRSCRAPER_API_KEY / MRSCRAPER_API_TOKEN from your shell. Each tool call uses the live MrScraper service.

Run these commands individually from the repository directory:

  1. Install dependencies:

    sh
    npm ci
  2. Build the current server:

    sh
    npm run build
  3. Set your API key:

    sh
    export MRSCRAPER_API_KEY="YOUR_MRSCRAPER_API_KEY"
  4. Test scraperAPI:

    sh
    npm run test:manual -- scraperAPI --url "https://www.scrapethissite.com/pages/simple/"
  5. Test webSearch:

    sh
    npm run test:manual -- webSearch --query "MrScraper web scraping"
  6. Test status:

    sh
    npm run test:manual -- status

The webSearch sample asks for US results (region us). Each command prints Tools: scraperAPI, webSearch, status and PASS <tool> on success. Exit codes are 0 for success, 1 for a tool or connection failure, and 2 for invalid command arguments.

Pass a complete JSON object to test any supported options:

sh
npm run test:manual -- scraperAPI --args '{"url":"https://example.com","markdown":true,"screenshot":true,"super":true}'
sh
npm run test:manual -- webSearch --args '{"url":"web scraping","region":"id","num_results":20}'

To test an already running HTTP MCP server, append --target http://127.0.0.1:8000/mcp. Rebuild after source changes when testing local stdio. npm run test:manual -- --help lists runner options.

Run the server locally

Node.js 20 or newer is required.

sh
git clone https://github.com/mrscraper-com/mrscraper-mcp.gitcd mrscraper-mcpnpm cinpm run build

Streamable HTTP

sh
TRANSPORT=http npm start

The default endpoint is http://127.0.0.1:8000/mcp.

json
{  "mcpServers": {    "mrscraper": {      "type": "http",      "url": "http://127.0.0.1:8000/mcp",      "headers": {        "Authorization": "Bearer YOUR_MRSCRAPER_API_KEY"      }    }  }}

stdio

json
{  "mcpServers": {    "mrscraper": {      "command": "npx",      "args": ["-y", "@mrscraper/mcp@latest"],      "env": {        "MRSCRAPER_API_KEY": "YOUR_MRSCRAPER_API_KEY"      }    }  }}

Stdio credential precedence is MRSCRAPER_API_KEY, then MRSCRAPER_API_TOKEN.

Authentication and security

TransportCredential
Hosted or local HTTPAn OAuth 2.1 access token, or a MrScraper API key, as Authorization: Bearer
Local stdioMRSCRAPER_API_KEY, then MRSCRAPER_API_TOKEN

The HTTP transport is an OAuth 2.1 resource server. It publishes RFC 9728 protected resource metadata at /.well-known/oauth-protected-resource (and at the /mcp path-suffixed variant), and an unauthenticated request is answered with 401 and a WWW-Authenticate header naming that document, which is how a client discovers where to send you to sign in.

Access tokens are verified locally against the authorization server's published JWKS. A token must name this server in its aud claim, so a token issued for another MrScraper surface cannot be replayed here.

API keys are validated against the MrScraper account endpoint before tool execution. Either way, each HTTP request uses its own caller's credential; server environment credentials are never used on the HTTP transport.

The server filters credential-bearing response headers. Parsed JSON credential metadata and credentials embedded in generated curl commands are redacted. Page content remains available in data.

Browser-origin requests are accepted from trusted local origins, from claude.ai and chatgpt.com, and from exact origins configured through MRSCRAPER_ALLOWED_ORIGINS. Service-to-service MCP clients typically connect without an Origin header. The discovery documents are served ahead of origin checks, since any client must be able to read them before it has credentials.

Interactive widgets

webSearch carries a self-contained search results widget that lists the results with their titles, links, and descriptions. status carries an account widget with the plan, token usage, and a usage meter. Hosts without MCP Apps support display the normal JSON tool response.

Each widget is a self-contained document with its script and styles inlined, because strict host CSP blocks anything external. Each one declares an empty network allowlist, since it only renders data the tool already returned. Sources live in ui/; npm run build:widgets bundles them into src/widgets/bundles.generated.ts, which npm run build does for you.

Docker

sh
docker build -f docker/Dockerfile -t mrscraper-mcp .docker run --rm -p 8000:8000 mrscraper-mcp

The image binds to 0.0.0.0. Apply the network controls appropriate for the deployment and keep bearer authentication enabled.

Environment variables

VariableDefaultPurpose
TRANSPORTstdioSelects stdio or http.
HOST127.0.0.1HTTP bind address; the Docker image uses 0.0.0.0.
PORT8000HTTP listen port.
MRSCRAPER_API_KEY-Primary stdio credential.
MRSCRAPER_API_TOKEN-Alternative stdio credential (also used by the Python SDK).
MRSCRAPER_HTTP_AUTH1Enables HTTP bearer verification.
MRSCRAPER_OAUTH1Accepts OAuth 2.1 access tokens alongside API keys.
MRSCRAPER_MCP_PUBLIC_URLhttps://mcp.mrscraper.comPublic origin; <origin>/mcp is the required token audience.
MRSCRAPER_OAUTH_ISSUERhttps://api.app.mrscraper.comAuthorization server issuer.
MRSCRAPER_OAUTH_JWKS_URL<issuer>/.well-known/jwks.jsonKey set used to verify access tokens.
MRSCRAPER_ALLOWED_ORIGINS-Comma-separated browser origins allowed to call the HTTP server.
MRSCRAPER_API_BASE_URLMrScraper platform APIPlatform endpoint override for development and testing.
MRSCRAPER_FETCH_BASE_URLMrScraper Web UnblockerScraper API and web search endpoint override.
MRSCRAPER_LOG_HTTP_PAYLOADoffEnables trusted-environment request-body diagnostics.
MRSCRAPER_LOG_HTTP_PAYLOAD_MAX8192Maximum diagnostic payload length.

Troubleshooting

  • Connection error: Confirm the server URL ends in /mcp and reload the MCP client after configuration changes.
  • 401 Unauthorized: For OAuth, reconnect the server so your client runs the sign-in flow again. For an API key, confirm the bearer key for HTTP or the environment key for stdio.
  • 403 insufficient_scope: The token lacks a scope the tool needs. Reconnect and approve the additional permission. For scraperAPI, the token must include scrape:write; for webSearch, it must include scrape:read.
  • Signing in succeeds but tools fail: Confirm the server URL is exactly https://mcp.mrscraper.com/mcp; the token audience is bound to it.
  • 403 Forbidden Origin: Add the exact browser origin to MRSCRAPER_ALLOWED_ORIGINS.
  • Tool input error: Compare the call with the tool's parameter table and its defaults.
  • Upstream timeout: Increase scraperAPI.timeout (up to 300 seconds) or webSearch.timeout when the target requires a longer request window.
  • New tools are missing: Start a new client session and inspect tools/list for exactly scraperAPI and webSearch.

Development

sh
npm cinpm run format:checknpm run lintnpm testnpm run buildnpm pack --dry-run

Smoke-test a running HTTP server:

sh
npm run test:mcp -- \  --target http://127.0.0.1:8000/mcp \  --token "$MRSCRAPER_API_KEY"

npm run test:e2e runs both new tools sequentially against the live MrScraper service using the manual runner. Use -- --url URL --query QUERY to customize the targets, or -- --target http://127.0.0.1:8000/mcp to use HTTP.

MCP Registry

The hosted server's MCP Registry manifest is defined in server.json. It describes the Streamable HTTP endpoint and links to this repository and the setup documentation.

.github/workflows/publish-mcp-registry.yml publishes server.json as io.github.mrscraper-com/mrscraper-mcp. Run it from the Actions tab (Publish to MCP Registry → Run workflow) or push a v* tag that matches the version in server.json. It authenticates with GitHub OIDC, which grants this repository the io.github.mrscraper-com/* namespace; an interactive mcp-publisher login github works only for organization owners. The workflow fails if server.json and package.json have different versions.

See the official registry publishing guide for details. Registry versions are immutable, so use a new version in server.json when publishing changed metadata. Publishing this manifest registers the hosted server; it does not publish a new npm package.

License

MIT. See LICENSE.

來源:README.md,提交 c433fa2

工具

0
該伺服器需要登入,因此 SourceWeft 無法在沒有帳號的情況下讀取其工具,也未收錄。已連接帳號所能看到的內容可能因帳號及其權限而異。

版本歷史

3
  1. v0.3.0最新Nov 4, 2026
  2. v0.2.3Oct 30, 2026
  3. v0.2.1Oct 20, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分