From d9fcf5e5e1b700ce2ea157c51e4ff29095fe35eb Mon Sep 17 00:00:00 2001 From: MrScraper <261125219+ai-mrscraper@users.noreply.github.com> Date: Thu, 3 Dec 2026 10:07:12 +0700 Subject: [PATCH] Update for MCP server 0.7.0, standard v1.3 (0.3.0) MrScraper MCP server 0.7.0 replaces scraperAPI with six scraping and search tools plus status: status, scrapeHtml, scrapeMarkdown, getScreenshot, scrapeBrand, scrapeJson, and webSearch. - Skills: copy the canonical MrScraper MCP skills (identical to the Claude 0.6.0 and Cursor 0.7.0 plugins), with links to sibling skills written as skill names for vally lint. - Scopes: scrape:read for all six scraping and search tools. - Manifests, README, and changelog: the seven tools, version 0.3.0. Co-Authored-By: Claude Opus 5.5 --- .github/plugin/marketplace.json | 6 +- CHANGELOG.md | 17 ++ README.md | 64 +++-- plugins/mrscraper/plugin.json | 6 +- .../mrscraper/skills/mrscraper-fetch/SKILL.md | 255 ++++++++++-------- .../mrscraper/skills/mrscraper-serp/SKILL.md | 55 ++-- plugins/mrscraper/skills/mrscraper/SKILL.md | 122 ++++++--- 7 files changed, 310 insertions(+), 215 deletions(-) diff --git a/.github/plugin/marketplace.json b/.github/plugin/marketplace.json index 7845da5..8d47b96 100644 --- a/.github/plugin/marketplace.json +++ b/.github/plugin/marketplace.json @@ -6,13 +6,13 @@ }, "metadata": { "description": "MrScraper plugin for GitHub Copilot CLI.", - "version": "0.2.0" + "version": "0.3.0" }, "plugins": [ { "name": "mrscraper", - "description": "Retrieve public web pages as HTML, Markdown, or screenshots and discover pages through web search with MrScraper's hosted MCP server. Includes skills that keep the raw page as the source for local extraction and check account usage.", - "version": "0.2.0", + "description": "Retrieve public web pages as HTML, Markdown, screenshots, brand data, or structured JSON and discover pages through web search with MrScraper's hosted MCP server. Includes skills that keep the raw page as the source for local extraction and check account usage.", + "version": "0.3.0", "source": "./plugins/mrscraper" } ] diff --git a/CHANGELOG.md b/CHANGELOG.md index 4382093..afb7893 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 0.3.0 - 2026-12-03 + +- Updated for MrScraper MCP server 0.7.0, which follows the MrScraper + Standard Service Reference v1.3. The server's seven tools (`status`, + `scrapeHtml`, `scrapeMarkdown`, `getScreenshot`, `scrapeBrand`, + `scrapeJson`, `webSearch`) replace `scraperAPI`, `webSearch`, and `status`. +- Skills: copied from the canonical MrScraper MCP skills, identical to the + MrScraper Claude 0.6.0 and Cursor 0.7.0 plugins apart from link style. They + list each tool's inputs with the v1.3 descriptions and defaults, add + `tokenCap` and the user's own `cookies`, and route brand data and JSON + extraction to `scrapeBrand` and `scrapeJson`. +- Corrected the scopes: all six scraping and search tools use `scrape:read`; + `status` uses `account:read`. +- Plugin and marketplace descriptions, keywords, and README: the seven tools, + which only read data, and which save every result to the MrScraper + dashboard. + ## 0.2.0 - 2026-11-02 - Reworded search as web search in the plugin and marketplace descriptions, diff --git a/README.md b/README.md index 8d3821a..2869856 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # MrScraper for GitHub Copilot CLI MrScraper connects [GitHub Copilot CLI](https://docs.github.com/copilot/how-tos/copilot-cli) -to a hosted MCP server that retrieves public web pages as HTML, Markdown, or -screenshots, discovers pages through web search, and reports account usage. +to a hosted MCP server that retrieves public web pages as HTML, Markdown, +screenshots, brand data, or structured JSON, discovers pages through web +search, and reports account usage. The plugin also includes three skills that tell the agent which tool to use and to keep the raw page content as the source for summaries and local extraction. @@ -22,14 +23,20 @@ Copilot CLI's built-in `web_fetch` tool and web search are enough for many public pages. This plugin helps when a task needs more control over retrieval: - Pages that render their content with JavaScript, or that need a CSS selector - to appear before the content is read. -- Content that differs by country, with retries and a per-request token cap. -- A screenshot of the page saved as an image file. -- Web search results as a ranked list (title, link, description, and source) + or text to appear before the content is read. +- Content that differs by country, with retry limits and a per-request token + cap. +- A screenshot of the full page, the first viewport, or a custom viewport, + saved as an image file. +- Fields extracted from a page as JSON with a natural-language prompt, or a + site's colors, typography, logos, and social links. +- A page behind your own login session, with cookies you supply. +- Web search results as a ranked list (title, URL, description, and source) for a chosen country, up to 100 at a time. It retrieves pages; it does not drive a browser session. For clicking, form -filling, or signed-in flows, use Playwright or another browser automation tool. +filling, or signing in to a site, use Playwright or another browser automation +tool. ## Requirements @@ -72,14 +79,26 @@ keys into the chat. `/mcp show mrscraper` then lists these tools: -| 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. | - -The OAuth scopes are `scrape:write` (`scraperAPI`), `scrape:read` -(`webSearch`), and `account:read` (`status`). +| `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 clean Markdown. Browser rendering is optional. | +| `getScreenshot` | Capture a base64 PNG screenshot of the full page, the first viewport, or a custom 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. | +| `webSearch` | Search the web and return ranked results with titles, URLs, descriptions, and sources. | + +The OAuth scopes are `scrape:read` (the six scraping and search tools) and +`account:read` (`status`). If a tool returns `403 insufficient_scope`, run +`/mcp auth mrscraper` again and approve both scopes. If +`/mcp show mrscraper` lists other tools, start a new session so Copilot CLI +reloads the server's tool list. + +`status`, `scrapeBrand`, and `webSearch` only read data. `scrapeHtml`, +`scrapeMarkdown`, `getScreenshot`, and `scrapeJson` also save every result to +your MrScraper dashboard. All six scraping and search tools use tokens from +your plan. ## Try it @@ -91,6 +110,10 @@ Fetch https://www.scrapethissite.com/pages/simple/ as Markdown and list the five Search the web for open source web scraping libraries and compare the top five results. ``` +```text +Extract the product names and prices from https://example.com as JSON. +``` + ```text How many MrScraper tokens do I have left this month? ``` @@ -105,10 +128,11 @@ copilot -p "Fetch https://example.com as Markdown and summarize it." --allow-too ## Retrieve-first routing When a public URL is already known, the skills direct the agent to retrieve it -with `scraperAPI` first and treat the raw response as the source of truth. The -agent can then read, summarize, compare, or derive structured output locally -without losing details. When no URL is known, `webSearch` finds candidate pages -first. +with `scrapeMarkdown` or `scrapeHtml` first and treat the raw response as the +source of truth. The agent can then read, summarize, compare, or derive +structured output locally without losing details, or use `scrapeJson` when +MrScraper should extract the fields. When no URL is known, `webSearch` finds +candidate pages first. ## API key fallback @@ -132,8 +156,8 @@ to `~/.copilot/mcp-config.json` in plain text; never add it to a project's ## Data and permissions -The plugin sends MCP tool inputs, including target URLs and search queries, to -MrScraper's hosted service. Page responses and tool results are then available +The plugin sends MCP tool inputs, including target URLs, search queries, and +any cookies you supply, to MrScraper's hosted service. Page responses and tool results are then available to the agent for the requested task. Use it only with public or otherwise authorized content, and follow the target site's requirements. diff --git a/plugins/mrscraper/plugin.json b/plugins/mrscraper/plugin.json index 2220705..090e633 100644 --- a/plugins/mrscraper/plugin.json +++ b/plugins/mrscraper/plugin.json @@ -1,8 +1,8 @@ { "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", "name": "mrscraper", - "version": "0.2.0", - "description": "Retrieve public web pages as HTML, Markdown, or screenshots and discover pages through web search with MrScraper's hosted MCP server. Includes skills that keep the raw page as the source for local extraction and check account usage.", + "version": "0.3.0", + "description": "Retrieve public web pages as HTML, Markdown, screenshots, brand data, or structured JSON and discover pages through web search with MrScraper's hosted MCP server. Includes skills that keep the raw page as the source for local extraction and check account usage.", "author": { "name": "MrScraper", "email": "support@mrscraper.com", @@ -11,5 +11,5 @@ "homepage": "https://docs.mrscraper.com/docs/getting-started/mcp-server", "repository": "https://github.com/mrscraper-com/mrscraper-copilot-plugin", "license": "MIT", - "keywords": ["web-scraping", "web-search", "serp", "markdown", "screenshot", "mcp", "mrscraper"] + "keywords": ["web-scraping", "web-search", "serp", "markdown", "screenshot", "data-extraction", "mcp", "mrscraper"] } diff --git a/plugins/mrscraper/skills/mrscraper-fetch/SKILL.md b/plugins/mrscraper/skills/mrscraper-fetch/SKILL.md index 41aa14a..5961d93 100644 --- a/plugins/mrscraper/skills/mrscraper-fetch/SKILL.md +++ b/plugins/mrscraper/skills/mrscraper-fetch/SKILL.md @@ -1,38 +1,27 @@ --- 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 countries, selector waits, cached results, retry limits, token caps, and cookies the user supplies for their own login session. 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` for connection and authentication checks, account status, or broader routing, and `mrscraper-serp` when discovery must happen first. -## Page Retrieval Context +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 sign in. -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. +Send cookies only when the user supplies their own cookies for a site they are +allowed to access, such as a page behind their login session. Never sign in to +a site or ask for a password. When a page needs a login and the user has not +supplied cookies, say so instead. Treat cookie values as credentials: do not +repeat them in answers or save them in artifacts. ## Step 1 — Define the Outcome @@ -41,153 +30,185 @@ 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. +- Load a page behind the user's login session with cookies they supply. 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 -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: +| Tool | Description | data in the response | +| --- | --- | --- | +| scrapeHtml | Retrieve the raw HTML of a page. Browser rendering is optional. | HTML text; with screenshot true, an object with html and screenshot. | +| scrapeMarkdown | Retrieve a page as clean Markdown. Browser rendering is optional. | Markdown text. | +| getScreenshot | Capture a base64 PNG screenshot of the full page, the first viewport, or a custom viewport. Browser rendering is always enabled. | An object with screenshot and the page html. | +| scrapeBrand | Extract a website's colors, typography, logos, and social links as JSON. | The brand in data.data.brand. | +| scrapeJson | Extract structured JSON from a page using a natural-language prompt. | The extracted data in data.data, the page HTML in data.html unless html is false, and data.screenshot when screenshot is true. | - { - "url": "https://www.scrapethissite.com/pages/simple/" - } +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. -Request Markdown instead of HTML for readable text: +scrapeMarkdown for readable text: { - "url": "https://www.scrapethissite.com/pages/simple/", - "html": false, - "markdown": true + "url": "https://example.com" } -The result is available in MCP structuredContent and as formatted JSON text. -The requested representations are in data: +scrapeHtml waiting for an element; waitForSelector also loads the page in a +browser: { - "status_code": 200, - "data": { - "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", + "waitForSelector": "#results" } -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: +scrapeHtml with a screenshot as well, which also loads the page in a browser: { - "url": "https://www.scrapethissite.com/pages/simple/", - "html": false, + "url": "https://example.com", "screenshot": 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. - -Use real-device routing when routing may be the problem: +getScreenshot of a 1280 by 800 pixel viewport; left out, screenshot is full +and captures the entire scroll height: { - "url": "https://www.scrapethissite.com/pages/simple/", - "super": true + "url": "https://example.com", + "screenshot": "1280x800" } -Wait for delayed content with a CSS selector: +A screenshot is a base64 PNG 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. + +scrapeMarkdown of a page behind the user's login session, with cookies the +user supplied: { - "url": "https://www.scrapethissite.com/pages/ajax-javascript/#2015", - "browser_rendering": true, - "wait_for_selector": ".film" + "url": "https://example.com/account", + "cookies": "session=abc123; theme=dark" } -Use geographic routing or homepage navigation when the target requires it: +scrapeJson with a prompt that describes the data shape you want back, here +with a JSON schema: { - "url": "https://www.scrapethissite.com/pages/simple/", - "geo_code": "ID", - "home_page": 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\"]}}" } -Bound resource use: +The prompt describes the data to extract from the loaded page; it does not +navigate, click, or sign in. Left out, prompt is "Extract all data as complete +as possible." The response also carries the page HTML; set html to false when +only the extracted data is needed. Long prompts are sent in a request body +automatically. + +scrapeBrand takes only the URL: { - "url": "https://www.scrapethissite.com/pages/ajax-javascript/#2015", - "block_resources": true, - "max_retries": 1, - "token_cap": 10, - "timeout": 60 + "url": "https://mrscraper.com" } -### Parameters +scrapeBrand waits up to 120 seconds. HTTP 422 with a settled job means the page +has no usable brand data. + +## Step 3 — Choose Page-Loading Options + +Each tool accepts only these inputs, and url is the only required one: + +| Tool | Inputs | +| --- | --- | +| scrapeHtml | url, browserRendering, timeout, warmStart, blockResources, waitForSelector, geoCode, maxAge, maxRetries, screenshot, tokenCap, cookies | +| scrapeMarkdown | url, browserRendering, timeout, warmStart, blockResources, waitForSelector, geoCode, maxAge, maxRetries, tokenCap, cookies | +| getScreenshot | url, screenshot, timeout, waitForSelector, geoCode, maxAge, maxRetries, tokenCap, cookies | +| scrapeBrand | url | +| scrapeJson | url, prompt, html, browserRendering, timeout, warmStart, blockResources, waitForSelector, geoCode, maxAge, maxRetries, screenshot, tokenCap | + +Set only the inputs the outcome needs. An input with a default is always sent: +left out, the value in the Default column is sent. An input marked Omitted is +sent only when you set it. browserRendering is also sent as true whenever +waitForSelector is set and, on scrapeHtml, whenever screenshot is true. -| 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. | +| browserRendering | HTML, Markdown, JSON | 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 | HTML, Markdown, screenshot, JSON | 300 | Maximum seconds to wait for the page to fully load before the request times out. Increase for slow or complex pages. | +| warmStart | HTML, Markdown, JSON | false | Warm up session before going directly to the target URL. | +| blockResources | HTML, Markdown, JSON | false | Block images, fonts, and stylesheets from loading. Speeds up scraping and reduces bandwidth usage. | +| waitForSelector | HTML, Markdown, screenshot, JSON | 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 | HTML, Markdown, screenshot, JSON | Omitted | Two-letter country code to load the page from, sent in lowercase. | +| maxAge | HTML, Markdown, screenshot, JSON | 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 | HTML, Markdown, screenshot, JSON | Omitted | Maximum number of retries, as a nonnegative integer. Omit this parameter for no limit. | +| screenshot | HTML | false | Capture a screenshot too (forces browser rendering). Set to true to include a screenshot, or false (default) for none. | +| screenshot | Screenshot | "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. | +| screenshot | JSON | false | Whether to include a base64 screenshot in the response. | +| tokenCap | HTML, Markdown, screenshot, JSON | 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 | HTML, Markdown, screenshot | 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. | +| prompt | JSON | "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 | JSON | true | Whether to include the page HTML in the response. | + +In the Tools column, HTML is scrapeHtml, Markdown is scrapeMarkdown, screenshot +is getScreenshot, and JSON is scrapeJson. + +Leaving browserRendering out is not the same as setting it to false. +getScreenshot always loads the page in a browser. timeout takes 1 to 330 +seconds, and a page tool waits for the response up to timeout plus 30 seconds, +330 seconds by default. + +scrapeHtml, scrapeMarkdown, getScreenshot, and scrapeJson always save the +result to the MrScraper dashboard Result tab; no input turns this off. 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 to true for + JavaScript-heavy pages, add waitForSelector for content that loads late, or + raise timeout for slow pages. +3. Set warmStart when the site expects a normal browsing session before deeper + pages. Set geoCode only when evidence shows that the page differs by + country. 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 retry with an identical request. Treat waitForSelector as a CSS +selector or text, not a duration. Omitting maxRetries means no retry limit; +set a small number when the user wants to bound retries, and set tokenCap to +bound the tokens a scrape and its retries can use: + + { + "url": "https://example.com", + "maxRetries": 3, + "tokenCap": 20 + } + +When a recent copy is good enough, set maxAge in milliseconds to reuse a cached +result of the same request instead of scraping the page again, here up to one +day old: + + { + "url": "https://example.com", + "maxAge": 86400000 + } + +A cached result costs the same tokens as the original scrape. ## 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 diff --git a/plugins/mrscraper/skills/mrscraper-serp/SKILL.md b/plugins/mrscraper/skills/mrscraper-serp/SKILL.md index e6750aa..0255be0 100644 --- a/plugins/mrscraper/skills/mrscraper-serp/SKILL.md +++ b/plugins/mrscraper/skills/mrscraper-serp/SKILL.md @@ -7,51 +7,52 @@ description: | # Discover Pages with MrScraper MCP Web Search Use the webSearch tool supplied by the MrScraper MCP server when a task begins -with a search query rather than a known target URL. Use +with a search query rather than a known target URL. webSearch: Search the web +and return ranked results with titles, URLs, descriptions, and sources. Use `mrscraper` for connection troubleshooting, account status, or broader routing. ## Step 1 — Build the Query -Pass the query in url. Include the important entity, attribute, location, or -date: +Pass the query text in query. Include the important entity, attribute, +location, or date: { - "url": "web scraping best practices" + "query": "web scraping best practices" } -The input can also be a search results URL; its q parameter becomes the query. - ## Step 2 — Set the Country and Result Count -Set region to a two-letter country code when results must come from one -country. It defaults to us: +Set country to a two-letter country code when results must come from one +country: { - "url": "running shoes", - "region": "id" + "query": "running shoes", + "country": "id" } -The search returns 10 results by default. Ask for more, up to 100, only when -the user needs broader coverage: +The search requests 10 results unless numResults asks for more, up to 100. Set +numResults only when the user needs broader coverage: { - "url": "running shoes", - "region": "id", - "num_results": 30 + "query": "site:example.com documentation", + "country": "id", + "numResults": 20 } ### Parameters -| MCP input | Default | Request mapping | Use | -| --- | --- | --- | --- | -| url | required | Body query | Search query, or a search results URL whose q value is used. | -| region | us | Body country | Two-letter result country, such as us or id. | -| num_results | 10 | Body numResults | Number of results, from 10 to 100; fewer may come back. | -| timeout | 600 | MCP upstream deadline | Maximum wait in seconds; not sent in the search body. | +| MCP input | Default | Description | +| --- | --- | --- | +| query | Required | Search query text, trimmed before sending, containing 1 to 1000 characters. | +| country | Omitted | Two-letter country code to search from, sent in lowercase. | +| numResults | 10 | Number of search results to request, as an integer from 10 to 100. Fewer results may be returned. | + +numResults is always sent: left out, 10 is sent. country, marked Omitted, is +sent only when you set it. -Authentication is handled by the MCP client's OAuth 2.1 connection and is -never a tool input. +A search waits up to 120 seconds. Authentication is handled by the MCP client's +OAuth 2.1 connection and is never a tool input. ## Step 3 — Inspect the Results @@ -76,12 +77,8 @@ coverage. If the user only requested URL discovery, stop after the search. ## Step 5 — Handle Weak or Missing Results -- Set region when the results come from the wrong country. +- Set country when the results come from the wrong country. - Rewrite noisy queries around the important entity, attribute, and location. -- Raise num_results only after checking the first results. -- Increase timeout when the MCP request deadline is too short. +- Raise numResults only after checking the first results. - Use `mrscraper` when the connection or authentication fails. - -webSearch is for public web search, not for discovering URLs within one -known site. diff --git a/plugins/mrscraper/skills/mrscraper/SKILL.md b/plugins/mrscraper/skills/mrscraper/SKILL.md index 39768f7..f927d84 100644 --- a/plugins/mrscraper/skills/mrscraper/SKILL.md +++ b/plugins/mrscraper/skills/mrscraper/SKILL.md @@ -1,7 +1,7 @@ --- name: mrscraper description: | - Connect, authenticate, route, and troubleshoot MrScraper MCP, and check account usage with the status tool. For known public URLs, retrieve and preserve page content with mrscraper-fetch first; use mrscraper-serp for query-first discovery through web search. + Connect, authenticate, route, and troubleshoot MrScraper MCP, and check account usage with the status tool. For a known public URL, retrieve HTML, Markdown, a screenshot, brand data, or structured JSON with mrscraper-fetch; use mrscraper-serp for query-first discovery through web search. --- # MrScraper MCP @@ -10,12 +10,24 @@ Use this skill for connection and authentication checks, tool selection, shared response handling, account status, and troubleshooting. Load the focused fetch or SERP skill for page retrieval and web search. +MrScraper MCP has six scraping and search tools, plus account status: + +| Tool | Description | +| --- | --- | +| 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 clean Markdown. Browser rendering is optional. | +| getScreenshot | Capture a base64 PNG screenshot of the full page, the first viewport, or a custom 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. | +| webSearch | Search the web and return ranked results with titles, URLs, descriptions, and sources. | + ## Step 1 — Verify or Connect MrScraper MCP -Check whether the current client exposes these three tools from the MrScraper +Check whether the current client exposes these seven tools from the MrScraper MCP provider: - scraperAPI webSearch status + status scrapeHtml scrapeMarkdown getScreenshot scrapeBrand scrapeJson webSearch The client may display server-qualified names. Match the provider and unqualified tool name; do not assume a fixed namespace. @@ -28,8 +40,9 @@ the managed Streamable HTTP endpoint: A self-managed deployment may expose the same tools over Streamable HTTP or stdio. Connection setup belongs to the MCP client. After setup or reconnection, -list the available tools and confirm all three names before claiming the -integration is ready. +list the available tools and confirm all seven names before claiming the +integration is ready. If the client lists other tools, start a new session or +reconnect so it loads the current tools. ## Step 2 — Authenticate @@ -40,15 +53,15 @@ When the connection is not authorized, start the MCP client's authorization flow. Let the client discover the authorization metadata, open the MrScraper consent page, complete authorization, store the resulting credentials, and refresh access tokens. The user may need to approve access in a browser, but -must not paste an authorization code, access token, refresh token, API key, or -other credential into the conversation. +must not paste a MrScraper authorization code, access token, refresh token, API +key, or other MrScraper credential into the conversation. -Never place credentials in tool arguments, print them, write them into project -artifacts, or manually reproduce the OAuth exchange. Do not configure an -API-key or bearer-token fallback from these skills. +Never place MrScraper credentials in tool arguments, print them, write them +into project artifacts, or manually reproduce the OAuth exchange. Do not +configure an API-key or bearer-token fallback from these skills. -The connection uses three scopes: scrape:write for scraperAPI, scrape:read for -webSearch, and account:read for status. A tool called without its scope returns +The connection uses two scopes: scrape:read for the six scraping and search +tools, and account:read for status. A tool called without its scope returns 403 insufficient_scope; reauthorize the connection so the client requests it. Verify end-to-end access with status, which reads the account without @@ -56,24 +69,30 @@ retrieving a page: {} -A successful account summary confirms that the connection can authenticate and -reach MrScraper. If it fails, report the error and do not claim setup is -complete. +A successful response confirms that the connection can authenticate and reach +MrScraper. If it fails, report the error and do not claim setup is complete. ## Step 3 — Route the Request | User outcome | MCP tool or skill | | --- | --- | -| Retrieve and preserve a known public page as HTML, Markdown, or a screenshot | `mrscraper-fetch` with scraperAPI | +| Read, summarize, or preserve a known public page | `mrscraper-fetch` with scrapeMarkdown, or scrapeHtml when the page structure matters | +| Capture what a page looks like | `mrscraper-fetch` with getScreenshot, or scrapeHtml with a screenshot when the HTML is needed too | +| Extract specific fields from a page as JSON | `mrscraper-fetch` with scrapeJson, or local extraction from retrieved content | +| Get a website's colors, typography, logos, and social links | `mrscraper-fetch` with scrapeBrand | | Discover relevant pages from a web search query | `mrscraper-serp` with webSearch, then retrieve selected pages | | Check the plan, token usage, or remaining tokens | status | ### Retrieve first, extract locally -scraperAPI returns raw page content. Produce summaries, tables, JSON, and other -structured output from that content with local analysis or extraction logic. -The raw response preserves complete page context for later questions, -validation, and changes to the requested schema. +scrapeHtml and scrapeMarkdown return raw page content. Produce summaries, +tables, JSON, and other structured output from that content with local analysis +or extraction logic. The raw response preserves complete page context for later +questions, validation, and changes to the requested schema. + +Use scrapeJson when the user asks MrScraper to extract the data, or when a +prompt-driven extraction is clearly simpler than local logic. Keep the raw page +as well when later questions may need details that the extraction leaves out. Prefer this workflow for pages with a shared layout: @@ -95,8 +114,8 @@ for those. ## Step 4 — Handle Output and Artifacts -scraperAPI and webSearch return the same response envelope in MCP -structuredContent and in a formatted JSON text block: +Every tool returns the same response envelope in MCP structuredContent and in a +formatted JSON text block: { "status_code": 200, @@ -104,14 +123,17 @@ structuredContent and in a formatted JSON text block: "headers": {} } -Prefer structuredContent when available. An API failure adds error and sets the -MCP result's isError flag. An input-contract failure is returned as a tool -error. Check those signals before trusting data. Credential-bearing headers and -credential metadata are removed from responses. +data holds the API response body: HTML text from scrapeHtml, or an object with +html and screenshot when screenshot is true; Markdown text from +scrapeMarkdown; and JSON from the other tools. Prefer structuredContent when +available. An HTTP or network failure adds error and sets the MCP result's +isError flag; a network failure has status_code null. Invalid inputs are +rejected before any request is sent. Check those signals before trusting data. +Credential-bearing response headers are removed. MrScraper tools do not accept output paths. When the user requests an artifact, wait for a successful tool result, select the requested value, and save it with -the environment's local file-writing capability. A screenshot is a base64 JPEG +the environment's local file-writing capability. A screenshot is a base64 PNG in data.screenshot; decode it before saving an image. Save substantial intermediate artifacts under the current project's @@ -119,43 +141,57 @@ Save substantial intermediate artifacts under the current project's artifact directory is unrelated to MCP connection credentials. Keep artifacts out of version control unless the user asks to commit them. +scrapeHtml, scrapeMarkdown, getScreenshot, and scrapeJson always save their +result to the MrScraper dashboard Result tab; no input turns this off. +scrapeBrand, webSearch, and status save nothing. + ## Step 5 — Review Account Usage Call status with an empty object: {} -The result summarizes the subscription status, token limit, token usage, -remaining tokens, usage percentage, rate limit, auto-renewal, renewal date, -and the account's name, email, and verification state: +data is the raw account status response, without summaries or calculated +fields. Account details are in data.data, including tokenLimit, tokenUsage, +subscriptionItem, and scraperAllowance: { - "kind": "mrscraper-cli-status-summary", "status_code": 200, "data": { - "account": { - "subscription_status": "active", - "token_usage": 250, - "token_limit": 1000, - "token_remaining": 750, - "usage_percent": 25 + "message": "...", + "data": { + "tokenLimit": 100000, + "tokenUsage": 2500, + "stripeStatus": "active", + "subscriptionItem": { + "name": "...", + "tokenLimit": 100000 + }, + "scraperAllowance": { + "remaining": 97500 + } } - } + }, + "headers": {} } +Report the fields the user asked about. The response also carries account +identity and billing identifiers; do not repeat them unless the user asks. Check remaining tokens before a large batch of page retrievals. status reports account usage, not the progress of a request. ## Step 6 — Troubleshoot - Missing tools: enable or reconnect the MrScraper MCP connection, then confirm - scraperAPI, webSearch, and status are exposed. + all seven tools are exposed. - Unauthorized or expired authorization: reauthorize the OAuth 2.1 connection through the MCP client. -- 403 insufficient_scope: reauthorize so the client requests the missing scope. +- 403 insufficient_scope: reauthorize so the client requests scrape:read for + scraping and search, or account:read for status. - Input-contract error: inspect the tool schema and omit inputs that do not - apply. The previous fetch, scrape, serp, rerun, results, and result tools were - replaced by scraperAPI, webSearch, and status. + apply. mrscraper-fetch lists the inputs of each page tool, and webSearch + takes query, country, and numResults. If the client's schemas show other + inputs, start a new session or reconnect so it loads the current tools. - Page incomplete or missing dynamic content: load mrscraper-fetch and revise page-loading inputs deliberately. - Search results weak: load mrscraper-serp and refine the query, country, or @@ -165,7 +201,7 @@ account usage, not the progress of a request. Use another tool for: -- Clicking controls, completing forms, or authenticated browser sessions. +- Clicking controls, completing forms, or signing in to a site. - Parsing local PDFs, documents, spreadsheets, or other files. - Recurring monitoring, notifications, or scheduling.