crawlforge-mcp-server 6.21.0 → 6.21.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crawlforge-mcp-server",
3
- "version": "6.21.0",
3
+ "version": "6.21.1",
4
4
  "mcpName": "io.github.mysleekdesigns/crawlforge-mcp-server",
5
5
  "description": "CrawlForge MCP Server - Professional Model Context Protocol server with 31 web scraping, crawling, deep-research, and autonomous-extraction tools. Returns clean Markdown and structured JSON for Claude, Cursor, and any MCP client. Defaults to local Ollama for LLM extraction (no API key needed); OpenAI/Anthropic available as opt-in. Includes a unified multi-format scrape tool, an autonomous agent, pre-built site templates, and Camoufox stealth browsing.",
6
6
  "main": "server.js",
package/server.js CHANGED
@@ -113,7 +113,7 @@ if (configErrors.length > 0 && config.server.nodeEnv === 'production') {
113
113
  // Create the server
114
114
  const server = new McpServer({
115
115
  name: "crawlforge",
116
- version: "6.21.0",
116
+ version: "6.21.1",
117
117
  description: "Production-ready MCP server with 31 web scraping, crawling, and content processing tools. Features MCP Resources (crawlforge://), Prompts, Sampling fallback, Elicitation, stealth browsing, stateful browser sessions with element refs, deep research, structured extraction, embedded JavaScript state extraction, real Google SERP rank tracking, Reddit search via community archives, change tracking, local-LLM extraction via Ollama, unified multi-format scrape, and autonomous agent tool.",
118
118
  homepage: "https://www.crawlforge.dev",
119
119
  icon: "https://www.crawlforge.dev/icon.png",
@@ -306,7 +306,7 @@ const searchWebShape = {
306
306
  effective_query: z.string().optional().describe('Present when query expansion changed the query actually used'),
307
307
  expanded_queries: z.array(z.string()).optional().describe('Present only when the original query returned nothing: the queries searched, in order - the original, then its expanded form'),
308
308
  results: z.array(searchWebResultShape).optional(),
309
- total_results: z.union([z.string(), z.number()]).optional(),
309
+ total_results: z.union([z.string(), z.number()]).nullable().optional().describe('The backend\'s total match count; null when it reports none (Brave Search API)'),
310
310
  search_time: z.number().optional(),
311
311
  offset: z.number().optional(),
312
312
  limit: z.number().optional(),
@@ -2,7 +2,7 @@
2
2
  name: crawlforge-batch-automation
3
3
  description: "Automates large scraping jobs and browser interactions with CrawlForge's batch_scrape, get_batch_results, scrape_with_actions, and generate_llms_txt tools. Use when the user wants to scrape many URLs at once, batch-scrape a list of pages, collect dozens of product, news, or competitor pages, run browser actions (click, type, scroll, wait) before scraping, log in or fill a form before extracting, or generate an llms.txt for a site. Use sync mode for up to about 25 URLs and async with a webhook for large batches; retrieve paginated output with get_batch_results."
4
4
  metadata:
5
- version: 6.21.0
5
+ version: 6.21.1
6
6
  source: crawlforge-mcp-server
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: crawlforge-browser-sessions
3
3
  description: "Keeps one browser page alive across several tool calls with CrawlForge's browser_session tool. Use when the user needs to log in and then read pages behind that login, work through a multi-step flow (search, filter, paginate, fill a wizard), or look at a page before deciding what to click. The loop is: open a session on a URL, snapshot it to list the interactive elements with stable refs (@e1, @e2), act on those refs, read the content, close. Unlike scrape_with_actions, which is one-shot and closes its browser when the call returns, a session survives between calls, so one login is paid for once and a wrong selector costs one call instead of a whole chain."
4
4
  metadata:
5
- version: 6.21.0
5
+ version: 6.21.1
6
6
  source: crawlforge-mcp-server
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: crawlforge-change-tracking
3
3
  description: "Monitors web pages for changes over time with CrawlForge's track_changes tool. Use when the user wants to track changes to a page, watch a URL, monitor competitor pricing, detect when content updates, get notified of regulation or product-availability changes, or diff a page against a saved baseline. Workflow: create a baseline with operation create_baseline, then periodically compare with operation compare to get a change percentage and a diff; supports CSS-selector scoping, webhooks, and scheduled monitoring."
4
4
  metadata:
5
- version: 6.21.0
5
+ version: 6.21.1
6
6
  source: crawlforge-mcp-server
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: crawlforge-deep-research
3
3
  description: "Runs multi-source web research and autonomous question-answering with CrawlForge's deep_research, agent, search_web, and reddit_search tools. Use when the user wants to research a topic, do a deep dive, compare competitors, gather facts with citations, answer a question from the web, search the web, or get a synthesized report from many sources, or search Reddit posts, comments, and threads. deep_research expands queries, fetches and dedupes sources, then synthesizes; agent autonomously plans searches and navigation from a plain-English prompt with no URLs needed; search_web returns ranked results; reddit_search searches Reddit via community archives (reddit.com blocks scrapers). Caps costs via max_urls and confirms before expensive runs."
4
4
  metadata:
5
- version: 6.21.0
5
+ version: 6.21.1
6
6
  source: crawlforge-mcp-server
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: crawlforge-getting-started
3
3
  description: "Orientation and tool-selection guide for the CrawlForge MCP server's 31 web tools. Use when the user is getting started with CrawlForge, asks which CrawlForge tool to use, how to set up the API key, how skills or the CLI work, what a tool costs in credits, or when one tool fails and a fallback is needed. Routes requests to the right specialized skill (web scraping, deep research, stealth, structured extraction, change tracking, batch automation, browser sessions), and explains MCP-tools-vs-CLI, the Ollama-first LLM fallback chain, and per-tool credit costs."
4
4
  metadata:
5
- version: 6.21.0
5
+ version: 6.21.1
6
6
  source: crawlforge-mcp-server
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: crawlforge-stealth-browsing
3
3
  description: "Bypasses bot detection with CrawlForge's stealth_mode tool and looks up a country's locale settings with localization. Use when a site returns 403 or 429, CAPTCHAs, 'please enable JavaScript', or empty content, or is protected by Cloudflare, DataDome, or PerimeterX, or when the user needs a page in a specific locale, language, or timezone. stealth_mode runs a stealth browser (engine auto by default: camoufox/Firefox for advanced fingerprinting, playwright/Chromium when pinned for speed) and can screenshot; localization returns a country's Accept-Language, timezone and currency for you to pass to fetch_url or stealth_mode - it applies nothing itself and uses no proxy. Explains when to escalate from a normal scrape to stealth, and why a hard block needs a residential proxy."
4
4
  metadata:
5
- version: 6.21.0
5
+ version: 6.21.1
6
6
  source: crawlforge-mcp-server
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: crawlforge-structured-extraction
3
3
  description: "Extracts structured JSON and analyzes content with CrawlForge's extract_structured, extract_with_llm, extract_embedded_state, scrape_structured, scrape_template, process_document, analyze_content, summarize_content, and list_ollama_models tools. Use when the user wants to extract specific fields, pull data into a JSON schema, extract by natural-language prompt, scrape with CSS selectors, read a page's embedded JavaScript state (__NEXT_DATA__, React Server Components, Nuxt, Apollo, Redux), get product, profile, or repo data from known sites (Amazon, LinkedIn, GitHub, YouTube, Reddit, and more), parse a PDF or DOCX, summarize a page, or analyze sentiment, entities, or keywords. Defaults to local Ollama for LLM extraction; OpenAI and Anthropic optional."
4
4
  metadata:
5
- version: 6.21.0
5
+ version: 6.21.1
6
6
  source: crawlforge-mcp-server
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: crawlforge-web-scraping
3
3
  description: "Scrapes web pages and returns clean Markdown, HTML, plain text, links, or metadata using CrawlForge's scrape, fetch_url, extract_content, extract_text, extract_links, extract_metadata, map_site, and crawl_deep tools. Use when the user wants to scrape a URL, fetch a page, get the markdown or text of a website, extract links or metadata, read an article, map a site's URLs, generate a sitemap, or crawl a whole website or documentation site. Prefer the unified scrape tool to get multiple formats in one call; use map_site to discover URLs and crawl_deep to walk an entire site."
4
4
  metadata:
5
- version: 6.21.0
5
+ version: 6.21.1
6
6
  source: crawlforge-mcp-server
7
7
  ---
8
8
 
@@ -11,7 +11,9 @@
11
11
  * Search's response shape, so the rest of the pipeline is unchanged.
12
12
  *
13
13
  * Checked against the live API on 2026-10-19:
14
- * - `count` is at most 20, and `offset` is a PAGE index from 0 to 9.
14
+ * - `count` is at most 20, and `offset` is a PAGE index from 0 to 9. A caller's
15
+ * `start` need not fall on a page boundary, so `bravePage` picks a page size
16
+ * whose page holds the whole window, and the extra results are sliced off.
15
17
  * - `search_lang` and `country` are validated: `zh`, `pt` and `EN` are a 422
16
18
  * where `zh-hans`, `pt-br` and `en` pass. Common forms are normalised, and a
17
19
  * locale still refused is retried once without it.
@@ -21,6 +23,8 @@
21
23
  const ENDPOINT = 'https://api.search.brave.com/res/v1/web/search';
22
24
  const MAX_COUNT = 20;
23
25
  const MAX_PAGE = 9;
26
+ /** Custom Search's depth, which search_web documents: nothing past the 100th result. */
27
+ const MAX_RESULTS = 100;
24
28
  const TIMEOUT_MS = 15000;
25
29
 
26
30
  const FRESHNESS = { d1: 'pd', w1: 'pw', m1: 'pm', y1: 'py' };
@@ -43,6 +47,22 @@ export function braveLanguage(lr) {
43
47
  return code.split('-')[0];
44
48
  }
45
49
 
50
+ /**
51
+ * The Brave page that holds results `first` to `first + wanted - 1` (zero-based):
52
+ * the smallest page size whose page contains the whole window. Every window of
53
+ * up to 10 within the first 100 results fits one; a wider one that fits none
54
+ * gets the 20-result page holding `first`, and so only part of the window.
55
+ */
56
+ export function bravePage(first, wanted) {
57
+ for (let count = wanted; count <= MAX_COUNT; count++) {
58
+ const page = Math.floor(first / count);
59
+ if (page <= MAX_PAGE && Math.floor((first + wanted - 1) / count) === page) {
60
+ return { count, page };
61
+ }
62
+ }
63
+ return { count: MAX_COUNT, page: Math.floor(first / MAX_COUNT) };
64
+ }
65
+
46
66
  /** Brave's highlighted HTML as the plain text Custom Search puts in `snippet`. */
47
67
  export function plainText(html) {
48
68
  return String(html ?? '')
@@ -95,9 +115,10 @@ export class BraveSearchAdapter {
95
115
  */
96
116
  async search(params) {
97
117
  const startedAt = Date.now();
98
- const count = Math.min(Math.max(1, params.num || 10), MAX_COUNT);
99
- const page = Math.floor(Math.max(0, (params.start || 1) - 1) / count);
100
- if (page > MAX_PAGE) return this.toResult([], startedAt);
118
+ const first = Math.max(0, (params.start || 1) - 1);
119
+ const wanted = Math.min(Math.max(1, params.num || 10), MAX_COUNT, MAX_RESULTS - first);
120
+ if (wanted <= 0) return this.toResult([], startedAt);
121
+ const { count, page } = bravePage(first, wanted);
101
122
 
102
123
  const base = new URLSearchParams({
103
124
  q: params.query,
@@ -131,7 +152,8 @@ export class BraveSearchAdapter {
131
152
  }
132
153
 
133
154
  const data = await response.json();
134
- return this.toResult((data?.web?.results ?? []).flatMap(toItem), startedAt);
155
+ const skip = first - page * count;
156
+ return this.toResult((data?.web?.results ?? []).slice(skip, skip + wanted).flatMap(toItem), startedAt);
135
157
  }
136
158
 
137
159
  async send(params) {
@@ -403,7 +403,7 @@ export class SearchWebTool {
403
403
  effective_query: usedQuery !== validated.query ? usedQuery : undefined,
404
404
  expanded_queries: queriesToTry.length > 1 ? queriesToTry : undefined,
405
405
  results: processedResults,
406
- total_results: bestResults.searchInformation?.totalResults || 0,
406
+ total_results: bestResults.searchInformation?.totalResults ?? null,
407
407
  search_time: bestResults.searchInformation?.searchTime || 0,
408
408
  offset: localizedParams.offset,
409
409
  limit: localizedParams.limit,
@@ -537,7 +537,7 @@ export class SearchWebTool {
537
537
  return {
538
538
  query: validated.query,
539
539
  results: processedResults,
540
- total_results: adapterResult.searchInformation?.totalResults || 0,
540
+ total_results: adapterResult.searchInformation?.totalResults ?? null,
541
541
  search_time: adapterResult.searchInformation?.searchTime || 0,
542
542
  offset: validated.offset,
543
543
  limit: validated.limit,