Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to the MrScraper OpenCode plugin are documented here. The
project follows [Semantic Versioning](https://semver.org/).

## 0.5.0 - 2026-11-20

- Updated the skills, README, and publishing checklist for MrScraper MCP
server 0.5.0, which follows the MrScraper Integrations Standard. The server
has seven tools with the standard descriptions: `status`, `scrapeHtml`,
`scrapeMarkdown`, `getScreenshot`, `scrapeBrand`, `scrapeJson`, and
`webSearch`. `scraperAPI` is gone; use `scrapeHtml`, `scrapeMarkdown`, or
`getScreenshot`, and `scrapeBrand` or `scrapeJson` for brand data and JSON
extraction. `webSearch` now takes `query`, `country`, and `numResults`
instead of `url`, `region`, `num_results`, and `timeout`, and all tool
inputs are camelCase. Skills are identical to the MrScraper Claude 0.4.0,
Cursor 0.5.0, Grok 0.4.0, and Antigravity 0.4.0 plugins.
- The hosted server now uses two OAuth scopes: `scraper:read` for the six
scraping and search tools and `account:read` for `status`. Connections
authorized with the older `scrape:read` and `scrape:write` scopes must run
`opencode mcp auth mrscraper` again so OpenCode requests `scraper:read`.

## 0.4.0 - 2026-11-02

- Updated the `mrscraper-serp` skill for MrScraper MCP server 0.3.0, which
Expand Down
4 changes: 2 additions & 2 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Use this checklist for every public release of `@mrscraper/opencode`.
`mrscraper-fetch`, and `mrscraper-serp`;
- with the README's API-key configuration, `opencode mcp list` shows
`connected`, which also proves that a user-defined server is kept;
- the prompt `Fetch https://www.scrapethissite.com/pages/simple/ and summarize the page.`
calls the `scraperAPI` tool and summarizes the page.
- the prompt `Fetch https://www.scrapethissite.com and summarize the page.`
calls the `scrapeMarkdown` or `scrapeHtml` tool and summarizes the page.

## Publish

Expand Down
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,24 +143,28 @@ your full account authority; OAuth scopes do not apply to it.
## Try it

```text
Fetch https://www.scrapethissite.com/pages/simple/ and summarize the page.
Fetch https://www.scrapethissite.com and summarize the page.
```

The server provides these tools. OpenCode 1 shows them as `mrscraper_<tool>`;
OpenCode 2 reaches MCP tools through Code Mode by default.

| Tool | Purpose |
| Tool | Description |
| --- | --- |
| `scraperAPI` | Retrieve a known page as HTML, Markdown, a screenshot, or a combination. |
| `webSearch` | Discover public pages through web search. |
| `status` | Inspect subscription status, token usage, and remaining tokens. |
| `status` | Return the raw account status API response without summarizing, redacting body fields, or adding calculated fields. |
| `scrapeHtml` | Retrieve the raw HTML of a page. Browser rendering is optional. |
| `scrapeMarkdown` | Retrieve a page as Markdown. Including HTML also enables browser rendering and returns both outputs as JSON. |
| `getScreenshot` | Capture a base64 screenshot of the full page or top viewport. Browser rendering is always enabled. |
| `scrapeBrand` | Extract a website's colors, typography, logos, and social links as JSON. |
| `scrapeJson` | Extract structured JSON from a page using a natural-language prompt. Append Json Schema: and a JSON schema to shape the output. |
| `webSearch` | Search the web and return ranked results with titles, URLs, descriptions, and sources. |

## Retrieve-first routing

When a public URL is already known, the skills direct OpenCode to retrieve it
with `scraperAPI` first and treat the raw response as the source of truth. The
agent can read, summarize, compare, or derive structured output locally without
losing details.
with `scrapeMarkdown` or `scrapeHtml` first and treat the raw response as the
source of truth. The agent can read, summarize, compare, or derive structured
output locally without losing details.

For roughly 100 known pages with a shared layout, the agent can retrieve pages
concurrently, retain every raw response, and apply one reusable local
Expand Down Expand Up @@ -194,7 +198,7 @@ To control updates, pin a version and change it when you upgrade:

```json
{
"plugin": ["@mrscraper/opencode@0.3.0"]
"plugin": ["@mrscraper/opencode@0.5.0"]
}
```

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mrscraper/opencode",
"version": "0.4.0",
"version": "0.5.0",
"description": "MrScraper for OpenCode: the hosted MrScraper MCP server plus fetch-first skills for web scraping, structured data extraction, and web search.",
"type": "module",
"main": "index.ts",
Expand Down
211 changes: 91 additions & 120 deletions skills/mrscraper-fetch/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,22 @@
---
name: mrscraper-fetch
description: |
Retrieve a known public URL with MrScraper's scraperAPI tool as HTML, Markdown, a screenshot, or a combination. Use for reading, summarizing, archiving, or analyzing a page and before local extraction; supports automatic browser fallback, real-device routing, proxies, and retries. Use mrscraper-serp when no URL is known.
Retrieve a known public URL with MrScraper MCP as HTML, Markdown, a screenshot, brand data, or structured JSON. Use for reading, summarizing, archiving, or extracting a page; supports browser rendering, page and proxy countries, selector waits, and retry limits. Use mrscraper-serp when no URL is known.
---

# Retrieve Page Content with MrScraper MCP

Use the scraperAPI tool supplied by the MrScraper MCP server whenever the user
already has a public URL. Keep using the retrieved content for summarization,
comparison, transformation, and structured output. Use
Use the MrScraper MCP tool that matches the requested representation whenever
the user already has a public URL. Keep using the retrieved content for
summarization, comparison, transformation, and structured output. Use
[mrscraper](../mrscraper/SKILL.md) for connection and authentication checks,
account status, or broader routing, and
[mrscraper-serp](../mrscraper-serp/SKILL.md) when discovery must happen first.

## Page Retrieval Context

scraperAPI calls MrScraper's
[page-fetching service](https://docs.mrscraper.com/docs/features/unblocker) once.
Browser rendering executes page JavaScript, geographic routing selects the
proxy country, selector waits let delayed content appear, and homepage
navigation visits the site root before the target. Real-device routing (super)
is independent of browser rendering.

Use scraperAPI only for content the user is authorized to access and in
accordance with the site's requirements.

Start with the URL alone and add only the controls the target needs. Plan-token
usage is based on runtime and bandwidth: one token per 30 seconds and one token
per 0.25 MB, rounded up per component. Resource blocking can reduce bandwidth
for text-focused pages. Retries stop when the request succeeds, max_retries is
reached, or the running token total reaches token_cap. The initial request
always runs even when it exceeds that cap. See the
[Token Plan](https://docs.mrscraper.com/docs/getting-started/api-token) for the
maintained calculation.
Use these tools only for content the user is authorized to access and in
accordance with the site's requirements. Browser rendering loads a page; it
does not click controls, submit forms, or provide an authenticated interactive
browser session.

## Step 1 — Define the Outcome

Expand All @@ -41,153 +25,140 @@ Confirm the target URL and what the user wants:
- Read, summarize, cite, or inspect the page.
- Check whether specific text appears.
- Archive the page or capture a screenshot.
- Produce fields, JSON, tables, or other structured output with local logic.
- Load JavaScript-rendered or geo-sensitive content.
- Produce fields, JSON, tables, or other structured output.
- Get the site's brand colors, typography, logos, and social links.
- Load JavaScript-rendered or country-specific content.

When many pages share a layout, retrieve representative pages, define one local
extractor, retrieve the remaining pages in parallel when safe and proportional,
and apply the same extractor to every saved response.

## Step 2 — Retrieve the Page
## Step 2 — Choose the Tool

| Tool | Description | data in the response |
| --- | --- | --- |
| scrapeHtml | Retrieve the raw HTML of a page. Browser rendering is optional. | HTML text. |
| scrapeMarkdown | Retrieve a page as Markdown. Including HTML also enables browser rendering and returns both outputs as JSON. | Markdown text; with html set to true, an object with html and markdown. |
| getScreenshot | Capture a base64 screenshot of the full page or top viewport. Browser rendering is always enabled. | An object with screenshot and the requested html and markdown. |
| scrapeJson | Extract structured JSON from a page using a natural-language prompt. Append Json Schema: and a JSON schema to shape the output. | The extracted data in data.data, with run metadata. |
| scrapeBrand | Extract a website's colors, typography, logos, and social links as JSON. | The brand in data.data.brand. |

The client may namespace the tool names; select the tool from the MrScraper MCP
provider. Start with the URL alone and add only the inputs the outcome needs.

The client may namespace the tool name; select scraperAPI from the MrScraper
MCP provider. Start with one call containing only the required URL, which
requests HTML:
scrapeMarkdown for readable text:

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

Request Markdown instead of HTML for readable text:
scrapeHtml rendered in a browser, waiting for an element:

{
"url": "https://www.scrapethissite.com/pages/simple/",
"html": false,
"markdown": true
"url": "https://example.com",
"browserRendering": true,
"waitForSelector": "body"
}

The result is available in MCP structuredContent and as formatted JSON text.
The requested representations are in data:
scrapeMarkdown with the page HTML as well:

{
"status_code": 200,
"data": {
"html": "<!DOCTYPE html>...",
"markdown": null,
"screenshot": null,
"token_usage": 3,
"runtime": 18.02,
"retry_count": 0,
"error": null
},
"headers": {
"x-status-code": "200"
}
"url": "https://example.com",
"html": true
}

Prefer structuredContent. Check isError, error, status_code, and
headers["x-status-code"] (the target page's status) before using data.

A screenshot is a base64 JPEG that can be large. Request it only when the user
needs an image, and save it to a file rather than reading it into the
conversation:
getScreenshot of the top viewport, with Markdown instead of HTML:

{
"url": "https://www.scrapethissite.com/pages/simple/",
"url": "https://example.com",
"screenshot": "top",
"html": false,
"screenshot": true
"markdown": true
}

## Step 3 — Choose Page-Loading Options

Omit browser_rendering to let the service choose: it falls back to a browser
automatically when needed. true forces a browser and false disables it.
screenshot=true always uses a browser.
A screenshot is base64 image data that can be large. Request it only when the
user needs an image, and save it to a file rather than reading it into the
conversation.

Use real-device routing when routing may be the problem:
scrapeJson with a prompt; append Json Schema: and a JSON schema to shape the
output:

{
"url": "https://www.scrapethissite.com/pages/simple/",
"super": true
"url": "https://example.com",
"prompt": "Extract the first 2 items with title and price. Json Schema: {\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"title\":{\"type\":\"string\"},\"price\":{\"type\":\"string\"}},\"required\":[\"title\",\"price\"]}}"
}

Wait for delayed content with a CSS selector:

{
"url": "https://www.scrapethissite.com/pages/ajax-javascript/#2015",
"browser_rendering": true,
"wait_for_selector": ".film"
}
The prompt describes the data to extract from the loaded page; it does not
navigate, click, or sign in. Without a prompt, scrapeJson extracts all data as
completely as possible. Long prompts are sent in a request body automatically.

Use geographic routing or homepage navigation when the target requires it:
scrapeBrand takes only the URL:

{
"url": "https://www.scrapethissite.com/pages/simple/",
"geo_code": "ID",
"home_page": true
"url": "https://mrscraper.com"
}

Bound resource use:
scrapeBrand waits up to 120 seconds. HTTP 422 with a settled job means the page
has no usable brand data.

{
"url": "https://www.scrapethissite.com/pages/ajax-javascript/#2015",
"block_resources": true,
"max_retries": 1,
"token_cap": 10,
"timeout": 60
}
## Step 3 — Choose Page-Loading Options

### Parameters
scrapeHtml, scrapeMarkdown, getScreenshot, and scrapeJson share the page
inputs. scrapeBrand accepts only url.

| MCP input | Default | Request mapping | Use |
| MCP input | Tools | Default | Description |
| --- | --- | --- | --- |
| url | required | Body url | Absolute HTTP or HTTPS target URL. |
| html | true | Query html | Request HTML content. |
| markdown | false | Query markdown | Request Markdown content. |
| screenshot | false | Query screenshot | Capture a base64 JPEG; forces browser rendering. |
| browser_rendering | automatic | Query browserRendering | true forces and false disables browser rendering. |
| super | false | Query super | Real-device routing, independent of browser rendering. |
| geo_code | US | Query geoCode | Proxy country, such as US, ID, or SG. |
| proxy_country | omitted | Query proxyCountry | Compatibility country option. |
| use_proxy | true | Query useProxy | Set false to skip the service's configured proxy. |
| proxy | omitted | Query proxy | Custom proxy as username:password@host:port. |
| wait_for_selector | omitted | Query waitForSelector | CSS selector to wait for. |
| home_page | false | Query warmStart | Visit the site root before the target page. |
| block_resources | false | Query blockResources | Block images, CSS, and fonts. |
| bypass_proxy | false | Query bypassProxy | Enable the proxy-bypass behavior. |
| cookie_jar | omitted | Query cookieJar | Cookie configuration string. |
| headers | omitted | Query headers | Target page request headers as an object or JSON string. |
| max_retries | 3 | Body maxRetries | Maximum retries; zero disables retries. |
| token_cap | omitted | Body tokenCap | Running token total that stops further retries. |
| timeout | 120 | Query timeout | Page timeout from 1 to 300 seconds. |
| stream | omitted | Query stream | Ask the API to stream; the response is still returned once. |
| discard_token_secret | empty | Header x-discard-token-secret | Optional upstream header. |
| url | All | Required | Absolute HTTP or HTTPS URL of the page to process. |
| timeout | HTML, Markdown, screenshot, JSON | 300 | Page load timeout in seconds, from 1 to 300. The HTTP request allows 30 additional seconds. |
| geoCode | HTML, Markdown, screenshot, JSON | "us" | Two-letter country code to load the page from, sent in lowercase. |
| proxyCountry | HTML, Markdown, screenshot, JSON | "us" | Two-letter country code of the proxy server, sent in lowercase. |
| super | HTML, Markdown, screenshot, JSON | false | Whether to route the request through real devices. |
| waitUntil | HTML, Markdown, screenshot, JSON | "domcontentloaded" | Navigation completion event to wait for: domcontentloaded, load, networkidle0, or networkidle2. |
| proxy | HTML, Markdown, screenshot, JSON | Omitted | Custom proxy URL used to load the page. |
| maxRetries | HTML, Markdown, screenshot, JSON | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. |
| saveResult | HTML, Markdown, screenshot, JSON | false | Whether to save the result to the dashboard Result tab. |
| blockResources | HTML, Markdown, screenshot | false | Whether to block images, fonts, and stylesheets while loading the page. |
| waitForSelector | HTML, Markdown, screenshot | Omitted | Wait for the page to contain the specified CSS selector before returning the result. |
| returnCookie | HTML, Markdown, screenshot | false | Whether to include browser session cookies in the response. |
| browserRendering | HTML, Markdown, JSON | false | Whether to render the page in a browser before returning the result. |
| warmStart | HTML, Markdown | false | Whether to enable warm start for more reliable scraping, at the cost of additional latency. |
| html | Markdown, JSON | false | Whether to include the page HTML in the response. |
| html | Screenshot | true | Whether to include the page HTML in the response. |
| markdown | Screenshot | false | Whether to include the page Markdown in the response. |
| screenshot | Screenshot | "full" | Screenshot area to capture: full for the entire page or top for the top viewport. |
| screenshot | JSON | false | Whether to include a base64 screenshot in the response. |
| prompt | JSON | "Extract all data as complete as possible." | Instructions describing the data to extract. Append Json Schema: and a JSON schema to shape the output. |

In the Tools column, HTML is scrapeHtml, Markdown is scrapeMarkdown, screenshot
is getScreenshot, and JSON is scrapeJson.

Authentication is handled by the MCP client's OAuth 2.1 connection and is
never a tool input.

## Step 4 — Inspect and Retry Deliberately

Start with the URL alone unless the task already establishes a requirement. If
the response fails, is blocked, incomplete, or missing dynamic content:

1. Inspect status_code, data.error, headers["x-status-code"], and the content.
2. Change one axis at a time: force or disable browser_rendering, or set super
when routing may be the problem.
3. Add wait_for_selector, geo_code, or home_page only when evidence shows that
the target requires it.
Prefer structuredContent. Check isError, error, status_code, and
headers["x-status-code"] (the target page's status) before using data. If the
response fails, is blocked, incomplete, or missing dynamic content:

1. Inspect status_code, error, headers["x-status-code"], and the content.
2. Change one input at a time: set browserRendering, wait for a later
waitUntil event, or add waitForSelector for content that loads late.
3. Set geoCode or proxyCountry only when evidence shows that the page differs
by country. Set super or warmStart when routing or a cold start may be the
problem.
4. Stop after a usable response unless the user requests a comparison.

Do not repeat an identical request. Treat wait_for_selector as a CSS selector,
not a duration. Browser rendering loads a page; it does not click controls,
submit forms, or provide an authenticated interactive browser session.
Do not repeat an identical request. Treat waitForSelector as a CSS selector,
not a duration. Omitting maxRetries means no retry limit; set a small number
when the user wants to bound retries.

## Step 5 — Deliver the Result

Answer the user's request from data. Keep the full envelope when headers or
diagnostics matter. When the user requests an archive, save the successful
response or the requested field with the environment's local file-writing
capability; scraperAPI itself has no output-path input.
capability; the tools have no output-path input.

Keep retrieved content as the source of truth for later steps. Build
summaries, tables, JSON transformations, and extraction scripts from it, and
Expand Down
Loading
Loading