
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.
概览
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 账户。
安装
在 SourceWeft 中
- 打开 控制台中的 MrScraper MCP,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
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:
Deployment options
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.
For clients configured by file, omit the headers block entirely:
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
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:
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
Start Codex from an environment containing MRSCRAPER_API_KEY. Codex stores
the environment-variable name in its MCP configuration.
Claude Code
Claude Code also supports project and local scopes. Choose the scope that matches how broadly the connection should be available.
Copyable agent setup prompt
Choosing a tool
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.
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
Start with a known URL:
Request HTML, Markdown, and a screenshot together:
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.
webSearch
The JSON body carries action: "websearch", the query, and the optional
country and result count. Ask for 20 results from the United Kingdom:
A search results URL also works; its q parameter becomes the query.
status
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.
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:
A webSearch response lists the results in data.data, each with rank,
title, url, description, and source:
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:
-
Install dependencies:
-
Build the current server:
-
Set your API key:
-
Test
scraperAPI: -
Test
webSearch: -
Test
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:
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.
Streamable HTTP
The default endpoint is http://127.0.0.1:8000/mcp.
stdio
Stdio credential precedence is MRSCRAPER_API_KEY, then
MRSCRAPER_API_TOKEN.
Authentication and security
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
The image binds to 0.0.0.0. Apply the network controls appropriate for the
deployment and keep bearer authentication enabled.
Environment variables
Troubleshooting
- Connection error: Confirm the server URL ends in
/mcpand 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 includescrape:write; forwebSearch, it must includescrape: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) orwebSearch.timeoutwhen the target requires a longer request window. - New tools are missing: Start a new client session and inspect
tools/listfor exactlyscraperAPIandwebSearch.
Development
Smoke-test a running HTTP server:
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版本历史
3- v0.3.0最新Nov 4, 2026
- v0.2.3Oct 30, 2026
- v0.2.1Oct 20, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分