@crawlbrulee/mcp 0.5.1 → 0.7.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 +21 -20
  2. package/dist/index.js +15 -16
  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.5.0 (beta). tool surface is stabilizing — expect minor changes between 0.x releases.
16
+ > **status:** v0.7.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
 
@@ -81,7 +81,7 @@ html, raw html, links, images, screenshot, page metadata).
81
81
  }
82
82
  ```
83
83
 
84
- **output** — full scrape result. page metadata (title, OG tags, etc.) is returned under `metadata`. extracted `images` are returned as absolute urls — query strings are preserved, and relative `src`s are resolved against the page url. screenshots are returned as signed download urls the agent can fetch separately; in rare cases a screenshot can't be captured, and when that happens the `screenshot` field is simply left out while the rest of your requested outputs are still returned. the result also carries a top-level `response_meta.usage` block:
84
+ **output** — full scrape result. page metadata (title, OG tags, etc.) is returned under `metadata`. extracted `images` are returned as absolute urls — query strings are preserved, and relative `src`s are resolved against the page url. screenshots are returned as signed download urls the agent can fetch separately. in rare cases a screenshot can't be captured: when you requested other outputs too, the `screenshot` field is simply left out while the rest is still returned — but a screenshot-only call that can't deliver errors instead (`unsupported_screenshot_output`, HTTP 422, when the content type can't be screenshotted) and isn't billed. the result also carries a top-level `response_meta.usage` block:
85
85
 
86
86
  ```jsonc
87
87
  {
@@ -90,7 +90,7 @@ html, raw html, links, images, screenshot, page metadata).
90
90
  "metadata": { "title": "Example Domain" },
91
91
  "response_meta": {
92
92
  "usage": {
93
- "credits": 1, // credits charged — 0 on a cache hit
93
+ "credits": 1, // 0 on a fully cached result — only parts still computed fresh are charged
94
94
  "proxy": "basic", // resolved tier actually used: "basic" | "advanced" (never "auto")
95
95
  "cache_hit": false, // whether the result was served from cache
96
96
  },
@@ -182,23 +182,24 @@ every tool returns an mcp error envelope (`isError: true`) when the api call fai
182
182
 
183
183
  agents can branch on the `errorName` code. the set comes from the sdk's `ApiErrorName` union plus two synthetic codes added by this mcp (`missing_api_key`, `internal_error`):
184
184
 
185
- | code | meaning |
186
- | ------------------------ | ------------------------------------------------------------------------------ |
187
- | `missing_api_key` | `CRAWLBRULEE_API_KEY` is not set in the mcp host's env. |
188
- | `invalid_credentials` | server rejected the api key (revoked, wrong env, etc.). |
189
- | `too_many_requests` | rate limit hit — back off and retry. |
190
- | `usage_allocation_error` | plan credit / concurrency cap exceeded. show `usage` to user. |
191
- | `validation_error` | input failed server validation. |
192
- | `invalid_url` | target url was rejected before fetching. |
193
- | `blocked_url` | target url is on the blocklist. |
194
- | `antibot_blocked` | origin's anti-bot defenses blocked the fetch. |
195
- | `scrape_error` | origin returned an error during scraping. |
196
- | `not_found` | async job ID unknown (e.g. bad `job_id` to `scrape_status` / `scrape_result`). |
197
- | `request_timeout` | network / read timeout. safe to retry. |
198
- | `client_closed_request` | caller cancelled before completion. |
199
- | `internal_server_error` | unhandled server-side failure. |
200
- | `crawlbrulee_error` | sdk error without a typed name. |
201
- | `internal_error` | bug in this mcp — please open an issue. |
185
+ | code | meaning |
186
+ | ------------------------------- | --------------------------------------------------------------------------------------------- |
187
+ | `missing_api_key` | `CRAWLBRULEE_API_KEY` is not set in the mcp host's env. |
188
+ | `invalid_credentials` | server rejected the api key (revoked, wrong env, etc.). |
189
+ | `too_many_requests` | rate limit hit — back off and retry. |
190
+ | `usage_allocation_error` | plan credit / concurrency cap exceeded. show `usage` to user. |
191
+ | `validation_error` | input failed server validation. |
192
+ | `invalid_url` | target url was rejected before fetching. |
193
+ | `blocked_url` | target url is on the blocklist. |
194
+ | `antibot_blocked` | origin's anti-bot defenses blocked the fetch. |
195
+ | `scrape_error` | origin returned an error during scraping. |
196
+ | `unsupported_screenshot_output` | screenshot-only request on a content type that can't be screenshotted (HTTP 422). not billed. |
197
+ | `not_found` | async job ID unknown (e.g. bad `job_id` to `scrape_status` / `scrape_result`). |
198
+ | `request_timeout` | network / read timeout. safe to retry. |
199
+ | `client_closed_request` | caller cancelled before completion. |
200
+ | `internal_server_error` | unhandled server-side failure. |
201
+ | `crawlbrulee_error` | sdk error without a typed name. |
202
+ | `internal_error` | bug in this mcp — please open an issue. |
202
203
 
203
204
  the api docs carry the canonical [error reference](https://crawlbrulee.com/docs/errors) — every error name, what causes it, and how to recover.
204
205
 
package/dist/index.js CHANGED
@@ -152,10 +152,7 @@ const Schema_ApiScrapeFormatScreenshot = z.object({
152
152
  actions_before: z.array(Schema_ScrapeScreenshotBeforeAction).max(5).default([]).describe("Actions to perform before taking the screenshot (wait, scroll)"),
153
153
  actions_after: z.array(Schema_ScrapeScreenshotAfterAction).max(1).default([]).describe("Actions to perform after taking the screenshot (e.g. slice into tiles)")
154
154
  }).strict().superRefine(refineScrapeScreenshotActionsBefore).describe("Screenshot capture configuration");
155
- const Schema_ApiScrapeCache = z.object({
156
- 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"),
157
- ignore_query_params: z.boolean().default(false).describe("Treat URLs with different query parameters as the same cache entry")
158
- }).strict().describe("Cache settings for the scrape request");
155
+ 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");
159
156
  const Schema_ApiScrapeExtract = z.object({
160
157
  metadata: z.boolean().default(true).describe("Extract page metadata (title, description, OG tags, etc.)"),
161
158
  cleaned_html: z.boolean().default(true).describe("Extract cleaned HTML (main content only)"),
@@ -170,7 +167,7 @@ const Schema_ApiScrapeLocation = z.object({
170
167
  country: z.string().regex(/^([a-zA-Z]{2}|europe)$/i, "country must be a 2-letter ISO 3166-1 alpha-2 code, 'eu', or 'europe'").optional().describe("ISO 3166-1 alpha-2 (e.g. 'us', 'de', 'br'; case-insensitive) driving the emulated browser timezone and proxy exit country. Also accepts 'eu' (random EU member state) or 'europe' (random European state incl. UK and non-EU).")
171
168
  }).strict().describe("Optional locale + country emulation for the scrape");
172
169
  const Schema_ApiScrapeRequest = z.object({
173
- url: z.string().describe("The URL to scrape"),
170
+ url: z.string().describe("The URL to scrape. Known tracking parameters (utm_*, mtm_*, ga_*, pk_*, gclid, fbclid, msclkid, and others) are removed before the page is fetched, so they are neither sent to the target site nor part of the cache key. Every other query parameter is kept verbatim and is part of the cache key."),
174
171
  extract: Schema_ApiScrapeExtract.prefault({}).describe("Which content formats to extract. Defaults to metadata + cleaned_html."),
175
172
  cache: Schema_ApiScrapeCache.optional().describe("Cache settings for this request"),
176
173
  require_js: z.boolean().default(false).describe("Use a headless browser to render JavaScript before scraping"),
@@ -194,7 +191,7 @@ const Schema_ApiMapTypes = z.object({
194
191
  }).describe("Filter which link types to include in the map");
195
192
  const Schema_ApiMapCache = z.object({ max_age: z.union([z.number().int().nonnegative(), z.iso.datetime()]).default(DEFAULT_API_MAP_CACHE_MAX_AGE_SECONDS).describe("Maximum cache age in seconds, or an ISO 8601 datetime cutoff") }).describe("Cache settings for the map request");
196
193
  const Schema_ApiMapRequest = z.object({
197
- url: z.string().describe("The website URL to map"),
194
+ url: z.string().describe("The website URL to map. Mapping always targets the site root, so the path, query string and fragment are dropped; known tracking parameters (utm_*, mtm_*, ga_*, pk_*, gclid, fbclid, msclkid, and others) are removed before the request is processed."),
198
195
  proxy: Schema_ApiProxyType.default("auto").describe("Proxy tier to use for fetching"),
199
196
  sitemap_only: z.boolean().default(false).describe("Only use sitemap.xml — skip homepage link extraction"),
200
197
  types: Schema_ApiMapTypes.optional().describe("Filter which link types to include"),
@@ -237,12 +234,12 @@ const Schema_ApiPageInlineImgItem = z.object({
237
234
  });
238
235
  const Schema_ApiPageLink = z.object({
239
236
  text: z.string().describe("Anchor text of the link"),
240
- href: z.string().describe("The link URL as it appears on the page (absolute or relative)"),
241
- internal: z.boolean().describe("Whether the link points to the same domain")
237
+ href: z.string().describe("The link URL as written on the page, resolved to an absolute URL; verbatim otherwise (query string, fragment, and duplicates preserved)"),
238
+ internal: z.boolean().describe("Whether the link points to the same domain (www and the bare domain are equivalent; other subdomains are external)")
242
239
  });
243
240
  const API_RESOLVED_PROXY_TIER_VALUES = ["basic", "advanced"];
244
241
  const Schema_ApiUsageMeta = z.object({
245
- credits: z.number().int().nonnegative().describe("Credits charged for this request. `0` on a cache hit (no fresh fetch was billed)."),
242
+ credits: z.number().int().nonnegative().describe("Credits charged for this request. `0` on a fully cached result; only parts still computed fresh (e.g. a newly produced screenshot-slice variant) are charged."),
246
243
  proxy: z.enum(API_RESOLVED_PROXY_TIER_VALUES).describe("The proxy tier the request actually ran on (resolved value — never `auto`; `auto` is resolved server-side to `basic` or `advanced`)."),
247
244
  cache_hit: z.boolean().describe("Whether the result was served from cache (`true`) or freshly fetched (`false`).")
248
245
  });
@@ -272,7 +269,8 @@ const Schema_ApiScrapeMeta = z.object({
272
269
  favicon_url: z.string().nullish().describe("Resolved favicon URL for the page (best-effort, from <head> icon hints + manifest)")
273
270
  });
274
271
  const Schema_ApiScrapeSuccessResponse = z.object({
275
- url: z.string().describe("The URL that was scraped (after any redirects)"),
272
+ url: z.string().describe("The URL that was actually scraped, after any redirects, in cleaned canonical form (tracking params and fragment removed) — the base that links, images, and internal labels are computed against"),
273
+ requested_url: z.string().describe("The URL you requested, echoed verbatim — before any redirects"),
276
274
  content_type: z.string().optional().describe("Content-Type header returned by the server"),
277
275
  unsupported_fields: z.array(z.string()).optional().describe("Extract fields that were requested but are not supported for this content type"),
278
276
  markdown: z.string().optional().describe("Page content converted to clean Markdown"),
@@ -283,7 +281,7 @@ const Schema_ApiScrapeSuccessResponse = z.object({
283
281
  screenshot: Schema_ApiScreenshotResponse.optional().describe("Screenshot of the page, if requested"),
284
282
  metadata: Schema_ApiScrapeMeta.optional().describe("Extracted page metadata (title, OG tags, etc.)"),
285
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."),
286
- response_meta: Schema_ApiResponseMeta.describe("Request-level metadata. `response_meta.usage` reports credits charged (0 on a cache hit), the resolved proxy tier, and the cache-hit flag.")
284
+ 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.")
287
285
  });
288
286
 
289
287
  //#endregion
@@ -307,7 +305,7 @@ const Schema_ApiMapResult = z.object({
307
305
  response_meta: z.object({
308
306
  pagination: Schema_ApiMapPagination.describe("Pagination details for the result set"),
309
307
  truncation: Schema_ApiMapTruncation.describe("Information about whether the results were truncated"),
310
- usage: Schema_ApiUsageMeta.describe("Usage accounting for this map request: credits charged (0 on a cache hit), the resolved proxy tier, and the cache-hit flag.")
308
+ usage: Schema_ApiUsageMeta.describe("Usage accounting for this map request: credits charged (0 on a fully cached result; only parts still computed fresh are charged), the resolved proxy tier, and the cache-hit flag.")
311
309
  }).describe("Response metadata including pagination, truncation, and usage info")
312
310
  });
313
311
 
@@ -334,8 +332,9 @@ const DESCRIPTION$5 = [
334
332
  "(markdown, cleaned HTML, raw HTML, links, images, screenshot, page metadata in `metadata`).",
335
333
  "Use this for one-shot page extraction. For full-site discovery use the `map` tool first.",
336
334
  "Screenshot URLs in the response are signed download links — the agent can fetch them when needed.",
337
- "The response also carries `response_meta.usage` = { credits (0 on a cache hit), proxy (the resolved",
338
- "tier — never `auto`), cache_hit } so you can see what the request cost."
335
+ "The response also carries `response_meta.usage` = { credits (0 on a fully cached result; only",
336
+ "parts still computed fresh are charged), proxy (the resolved tier — never `auto`), cache_hit }",
337
+ "so you can see what the request cost."
339
338
  ].join(" ");
340
339
  function registerScrapeTool(server, getClient) {
341
340
  server.registerTool("scrape", {
@@ -369,7 +368,7 @@ const Schema_ApiScrapeStatusResponse = z.object({
369
368
  status: z.enum(ASYNC_JOB_STATUS_VALUES).describe("Current state of the job (pending, running, done, failed)"),
370
369
  created_at: z.string().describe("ISO-8601 UTC timestamp when the job was created"),
371
370
  error: z.string().optional().describe("Error message if the job ended in `failed`"),
372
- response_meta: Schema_ApiResponseMeta.optional().describe("Usage accounting for the finished job. Present only once the job is `done`; `response_meta.usage` reports credits charged (0 on a cache hit), the resolved proxy tier, and the cache-hit flag.")
371
+ response_meta: Schema_ApiResponseMeta.optional().describe("Usage accounting for the finished job. Present only once the job is `done`; `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.")
373
372
  });
374
373
 
375
374
  //#endregion
@@ -485,7 +484,7 @@ function registerWhoamiTool(server, getClient) {
485
484
  //#endregion
486
485
  //#region src/version.ts
487
486
  const SERVER_NAME = "crawlbrulee";
488
- const SERVER_VERSION = "0.5.0";
487
+ const SERVER_VERSION = "0.7.0";
489
488
 
490
489
  //#endregion
491
490
  //#region src/server.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlbrulee/mcp",
3
- "version": "0.5.1",
3
+ "version": "0.7.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.7.0",
58
+ "@crawlbrulee/sdk": "^0.9.0",
59
59
  "@modelcontextprotocol/sdk": "^1.29.0",
60
60
  "zod": "^4.0.0"
61
61
  },