@crawlbrulee/mcp 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +13 -2
  2. package/dist/index.js +18 -9
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -13,7 +13,7 @@ the official [mcp](https://modelcontextprotocol.io) server for the [crawlbrulee]
13
13
  this readme covers the mcp server itself — its tools and how to wire it into a host. for how the api behaves — endpoints, parameters, and error semantics — please see our
14
14
  [api docs](https://crawlbrulee.com/docs).
15
15
 
16
- > **status:** v0.7.0 (beta). tool surface is stabilizing — expect minor changes between 0.x releases.
16
+ > **status:** v0.8.0 (beta). tool surface is stabilizing — expect minor changes between 0.x releases.
17
17
 
18
18
  **get a free api key** → [dashboard.crawlbrulee.com](https://dashboard.crawlbrulee.com)
19
19
 
@@ -98,7 +98,17 @@ html, raw html, links, images, screenshot, page metadata).
98
98
  }
99
99
  ```
100
100
 
101
- alongside `response_meta.usage`, the result surfaces any non-fatal `warnings` (stable codes like `screenshot_truncated`) and, if you requested an extract that doesn't apply to the content type (e.g. `markdown` of a pdf), an `unsupported_fields` list — with the rest of the payload still returned.
101
+ alongside `response_meta.usage`, the result surfaces any non-fatal `warnings` — stable string codes an agent can switch on. an outsized page is truncated rather than refused, and the code names which part was cut:
102
+
103
+ | code | what it means for the payload |
104
+ | ------------------------- | ----------------------------------------------------------------------------------------------------- |
105
+ | `screenshot_truncated` | the page was taller than the scrolling-capture height cap; the screenshot covers the top of the page. |
106
+ | `links_truncated` | the page had more than 30,000 links; the `links` array is cut at the cap and is incomplete. |
107
+ | `inline_images_truncated` | the page had more than 10,000 inline images; the `images` array is cut at the cap and is incomplete. |
108
+ | `raw_html_truncated` | the page body exceeded 10,000,000 characters; `raw_html` is cut at a tag boundary, never mid-tag. |
109
+ | `metadata_truncated` | the page head exceeded 2,000,000 characters; `metadata` can be missing tags that sat past the cut. |
110
+
111
+ and if you requested an extract that doesn't apply to the content type (e.g. `markdown` of a pdf), the field name comes back in an `unsupported_fields` list — with the rest of the payload still returned.
102
112
 
103
113
  every input field, its default, and its constraints are documented under the [scrape endpoint](https://crawlbrulee.com/docs/scrape) — with [extraction](https://crawlbrulee.com/docs/scrape/extraction), [screenshots](https://crawlbrulee.com/docs/scrape/screenshots), [proxies & location](https://crawlbrulee.com/docs/proxies), and [caching](https://crawlbrulee.com/docs/scrape/caching) covering the individual blocks.
104
114
 
@@ -186,6 +196,7 @@ agents can branch on the `errorName` code. the set comes from the sdk's `ApiErro
186
196
  | ------------------------------- | --------------------------------------------------------------------------------------------- |
187
197
  | `missing_api_key` | `CRAWLBRULEE_API_KEY` is not set in the mcp host's env. |
188
198
  | `invalid_credentials` | server rejected the api key (revoked, wrong env, etc.). |
199
+ | `service_unavailable` | temporary backend failure (HTTP 503). your key is fine — retry with backoff. |
189
200
  | `too_many_requests` | rate limit hit — back off and retry. |
190
201
  | `usage_allocation_error` | plan credit / concurrency cap exceeded. show `usage` to user. |
191
202
  | `validation_error` | input failed server validation. |
package/dist/index.js CHANGED
@@ -46,8 +46,9 @@ const MISSING_API_KEY_REMEDIATION = `${ENV_API_KEY} is not set on the MCP host.
46
46
  /**
47
47
  * Map any thrown value into the MCP tool-error envelope. SDK errors carry
48
48
  * stable `errorName` codes and HTTP `status`; both go into the surfaced
49
- * message so the calling agent can branch on them (e.g. retry on
50
- * `rate_limited`, prompt the user on `invalid_credentials`).
49
+ * message so the calling agent can branch on them (e.g. back off and retry on
50
+ * `too_many_requests` or `service_unavailable` — a transient backend failure,
51
+ * not a bad key — and prompt the user on `invalid_credentials`).
51
52
  *
52
53
  * One special case: the SDK throws a generic `CrawlbruleeError` (status 0,
53
54
  * errorName null) when `CRAWLBRULEE_API_KEY` is missing. We rewrite that
@@ -142,7 +143,7 @@ const Schema_ApiProxyType = z.enum(API_PROXY_TIER_VALUES).default("auto").descri
142
143
  const Schema_ApiScrapeViewport = z.object({
143
144
  width: z.number().int().min(16).max(1e4).describe("Viewport width in pixels (16–10000)"),
144
145
  height: z.number().int().min(16).max(1e4).describe("Viewport height in pixels (16–10000)"),
145
- device_scale_factor: z.number().min(1).max(4).optional().describe("Device pixel ratio (1–4, fractional allowed; e.g. 2 for Retina). Defaults to 1.")
146
+ device_scale_factor: z.number().min(1).max(3).optional().describe("Device pixel ratio (1–3, fractional allowed; e.g. 2 for Retina). Defaults to 1.")
146
147
  }).strict().describe("Custom browser viewport dimensions");
147
148
  const Schema_ApiScrapeFormatScreenshot = z.object({
148
149
  type: Schema_ApiScrapeScreenshotType.describe("Screenshot capture mode"),
@@ -154,12 +155,12 @@ const Schema_ApiScrapeFormatScreenshot = z.object({
154
155
  }).strict().superRefine(refineScrapeScreenshotActionsBefore).describe("Screenshot capture configuration");
155
156
  const Schema_ApiScrapeCache = z.object({ max_age: z.union([z.number().int().nonnegative(), z.iso.datetime()]).default(DEFAULT_API_SCRAPE_CACHE_MAX_AGE_SECONDS).describe("Maximum cache age in seconds, or an ISO 8601 datetime cutoff") }).strict().describe("Cache settings for the scrape request");
156
157
  const Schema_ApiScrapeExtract = z.object({
157
- metadata: z.boolean().default(true).describe("Extract page metadata (title, description, OG tags, etc.)"),
158
+ metadata: z.boolean().default(true).describe("Extract page metadata (title, description, OG tags, etc.). Read from the page head, which is capped at 2,000,000 characters — a larger head is truncated and the response carries a `metadata_truncated` warning."),
158
159
  cleaned_html: z.boolean().default(true).describe("Extract cleaned HTML (main content only)"),
159
160
  markdown: z.boolean().default(false).describe("Extract page content as clean Markdown"),
160
- raw_html: z.boolean().default(false).describe("Return the raw, unprocessed HTML"),
161
- links: z.boolean().default(false).describe("Extract all links found on the page"),
162
- images: z.boolean().default(false).describe("Extract all inline images found on the page"),
161
+ raw_html: z.boolean().default(false).describe("Return the raw, unprocessed HTML, up to 10,000,000 characters of page body. A larger body is truncated at a tag boundary and the response carries a `raw_html_truncated` warning."),
162
+ links: z.boolean().default(false).describe("Extract links found on the page, up to 30,000 per page. Beyond that the array is truncated and the response carries a `links_truncated` warning."),
163
+ images: z.boolean().default(false).describe("Extract inline images found on the page, up to 10,000 per page. Beyond that the array is truncated and the response carries an `inline_images_truncated` warning."),
163
164
  screenshot: Schema_ApiScrapeFormatScreenshot.optional().describe("Capture a screenshot of the page")
164
165
  }).strict().describe("Which content formats to extract from the scraped page");
165
166
  const Schema_ApiScrapeLocation = z.object({
@@ -280,7 +281,7 @@ const Schema_ApiScrapeSuccessResponse = z.object({
280
281
  links: z.array(Schema_ApiPageLink).optional().describe("Links found on the page"),
281
282
  screenshot: Schema_ApiScreenshotResponse.optional().describe("Screenshot of the page, if requested"),
282
283
  metadata: Schema_ApiScrapeMeta.optional().describe("Extracted page metadata (title, OG tags, etc.)"),
283
- warnings: z.array(z.string()).optional().describe("Non-error notices about the scrape (e.g. `screenshot_truncated` when a long page exceeded the scrolling-screenshot height cap). Stable string codes — clients can switch on them. Currently surfaced only on fresh scrapes; cache hits omit warnings."),
284
+ warnings: z.array(z.string()).optional().describe("Non-error notices about the scrape. Truncation codes — `screenshot_truncated` (long page exceeded the scrolling-screenshot height cap), `links_truncated` / `inline_images_truncated` (page had more links/images than the per-page extraction caps), `raw_html_truncated` / `metadata_truncated` (rendered HTML exceeded the per-page size budget) — mean the field is present but capped. Unavailability codes — `links_unavailable` / `inline_images_unavailable` / `metadata_unavailable` — mean that optional field could not be extracted and was omitted (null/empty) while the rest of the scrape succeeded, so an empty field carrying one of these does NOT mean the page had none. Stable string codes — clients can switch on them. Warnings are stored with the result: async result fetches and cache hits carry them too, filtered to the fields the request asked for."),
284
285
  response_meta: Schema_ApiResponseMeta.describe("Request-level metadata. `response_meta.usage` reports credits charged (0 on a fully cached result; only parts still computed fresh are charged), the resolved proxy tier, and the cache-hit flag.")
285
286
  });
286
287
 
@@ -334,7 +335,15 @@ const DESCRIPTION$5 = [
334
335
  "Screenshot URLs in the response are signed download links — the agent can fetch them when needed.",
335
336
  "The response also carries `response_meta.usage` = { credits (0 on a fully cached result; only",
336
337
  "parts still computed fresh are charged), proxy (the resolved tier — never `auto`), cache_hit }",
337
- "so you can see what the request cost."
338
+ "so you can see what the request cost.",
339
+ "Extraction is capped per page: 30,000 links, 10,000 inline images, 10,000,000 characters of body",
340
+ "HTML and 2,000,000 characters of head HTML. A page past a cap is truncated rather than refused,",
341
+ "and the response `warnings` array names which one (`links_truncated`, `inline_images_truncated`,",
342
+ "`raw_html_truncated`, `metadata_truncated`) — so treat that output as incomplete.",
343
+ "`warnings` also reports a section whose extraction failed outright (`links_unavailable`,",
344
+ "`inline_images_unavailable`, `metadata_unavailable`): that field comes back omitted or empty",
345
+ "while the rest of the scrape succeeded, so do NOT conclude the page had no links/images/metadata",
346
+ "— re-run the scrape instead. An empty field with no such warning does mean the page had none."
338
347
  ].join(" ");
339
348
  function registerScrapeTool(server, getClient) {
340
349
  server.registerTool("scrape", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlbrulee/mcp",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "Official MCP server for the crawlbrulee API — scrape and map URLs from MCP-aware agents (Claude Code, Codex, Cursor).",
5
5
  "keywords": [
6
6
  "crawlbrulee",
@@ -55,7 +55,7 @@
55
55
  "prepublishOnly": "pnpm verify"
56
56
  },
57
57
  "dependencies": {
58
- "@crawlbrulee/sdk": "^0.10.0",
58
+ "@crawlbrulee/sdk": "^0.11.0",
59
59
  "@modelcontextprotocol/sdk": "^1.29.0",
60
60
  "zod": "^4.0.0"
61
61
  },