crawlforge-mcp-server 4.9.0 → 5.0.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 (60) hide show
  1. package/CLAUDE.md +6 -5
  2. package/README.md +19 -3
  3. package/package.json +10 -12
  4. package/server.js +315 -214
  5. package/src/core/ActionExecutor.js +117 -33
  6. package/src/core/AgentOrchestrator.js +8 -2
  7. package/src/core/AuthManager.js +51 -17
  8. package/src/core/ChangeTracker.js +26 -10
  9. package/src/core/JobManager.js +9 -1
  10. package/src/core/LocalizationManager.js +19 -6
  11. package/src/core/ResearchOrchestrator.js +173 -35
  12. package/src/core/SnapshotManager.js +162 -165
  13. package/src/core/StealthBrowserManager.js +25 -3
  14. package/src/core/WebhookDispatcher.js +19 -14
  15. package/src/core/analysis/ContentAnalyzer.js +52 -7
  16. package/src/core/crawlers/BFSCrawler.js +27 -3
  17. package/src/core/processing/BrowserProcessor.js +19 -1
  18. package/src/core/processing/PDFProcessor.js +129 -65
  19. package/src/core/queue/QueueManager.js +3 -2
  20. package/src/schemas/toolOutputSchemas.js +269 -0
  21. package/src/server/auth/oauth.js +37 -7
  22. package/src/server/specHygiene.js +192 -0
  23. package/src/server/taskSupport.js +233 -0
  24. package/src/server/toolFilter.js +98 -0
  25. package/src/server/transports/streamableHttp.js +148 -11
  26. package/src/server/withAuth.js +11 -4
  27. package/src/skills/agent-skills/crawlforge-getting-started/SKILL.md +15 -0
  28. package/src/tools/advanced/ScrapeWithActionsTool.js +43 -52
  29. package/src/tools/advanced/batchScrape/index.js +128 -27
  30. package/src/tools/advanced/batchScrape/worker.js +55 -5
  31. package/src/tools/advanced/scrapeWithActions/recorder.js +3 -0
  32. package/src/tools/basic/_fetch.js +125 -70
  33. package/src/tools/basic/extractLinks.js +14 -12
  34. package/src/tools/basic/scrapeStructured.js +21 -4
  35. package/src/tools/crawl/crawlDeep.js +110 -48
  36. package/src/tools/crawl/mapSite.js +25 -6
  37. package/src/tools/extract/_fetchAndParse.js +98 -1
  38. package/src/tools/extract/extractContent.js +7 -4
  39. package/src/tools/extract/extractStructured.js +125 -84
  40. package/src/tools/extract/extractWithLlm.js +10 -2
  41. package/src/tools/extract/processDocument.js +54 -6
  42. package/src/tools/extract/summarizeContent.js +7 -1
  43. package/src/tools/llmstxt/generateLLMsTxt.js +8 -6
  44. package/src/tools/research/deepResearch.js +51 -31
  45. package/src/tools/scrape/_brandingExtractor.js +49 -11
  46. package/src/tools/scrape/unifiedScrape.js +27 -17
  47. package/src/tools/search/providers/searxng.js +5 -1
  48. package/src/tools/search/ranking/ResultDeduplicator.js +9 -1
  49. package/src/tools/search/ranking/ResultRanker.js +17 -2
  50. package/src/tools/search/searchWeb.js +31 -14
  51. package/src/tools/search/serpRank.js +23 -0
  52. package/src/tools/templates/TemplateRegistry.js +7 -1
  53. package/src/tools/tracking/trackChanges/index.js +87 -26
  54. package/src/tools/tracking/trackChanges/schema.js +2 -2
  55. package/src/utils/CircuitBreaker.js +11 -9
  56. package/src/utils/contentUtils.js +66 -53
  57. package/src/utils/secretMask.js +1 -1
  58. package/src/utils/sitemapParser.js +11 -9
  59. package/src/utils/ssrfGuard.js +212 -40
  60. package/src/utils/urlNormalizer.js +2 -2
package/CLAUDE.md CHANGED
@@ -62,7 +62,7 @@ These guidelines are working if: fewer unnecessary changes in diffs, fewer rewri
62
62
 
63
63
  CrawlForge MCP Server - A professional MCP (Model Context Protocol) server providing 27 web scraping, crawling, and content processing tools (5 inline + 22 advanced).
64
64
 
65
- **Current Version:** 4.9.0
65
+ **Current Version:** 5.0.0
66
66
 
67
67
  ## Development Commands
68
68
 
@@ -96,9 +96,10 @@ npm test
96
96
  npm run test:unit
97
97
  # Phase D regressions live in tests/unit/phaseD-regressions.test.js (agent hard stops, unified scrape, map_site ranking)
98
98
  # Run a single test file: node --test tests/unit/phaseD-regressions.test.js
99
- # Note: add --test-force-exit if the run appears to hang at the end — importing
100
- # StealthBrowserManager (d2-reliability.test.js) leaves a Playwright handle that
101
- # otherwise delays process exit ~100s. Tests themselves pass either way.
99
+ # Note: the script includes --test-force-exit — importing StealthBrowserManager
100
+ # (d2-reliability.test.js) leaves a Playwright handle that otherwise hangs the
101
+ # runner at exit after all tests pass. When running a single file manually, put
102
+ # --test-force-exit BEFORE the file path (after it, the flag is silently ignored).
102
103
 
103
104
  # Integration tests
104
105
  npm run test:integration
@@ -260,7 +261,7 @@ Security testing and CI/CD pipeline details are in:
260
261
  - `docs/security-audit-report.md` — Full security audit
261
262
  - `.github/workflows/ci.yml` — CI pipeline with security checks
262
263
  - `.github/workflows/security.yml` — Daily scheduled security scanning
263
- - `.github/SECURITY.md` — Security policy and procedures
264
+ - `docs/SECURITY.md` — Security policy and procedures
264
265
 
265
266
  Run `npm audit` locally to check dependencies.
266
267
 
package/README.md CHANGED
@@ -184,7 +184,7 @@ CrawlForge requires a CrawlForge API key — **every tool is metered and consume
184
184
  | `agent` | 8 | **Autonomous research/extraction from a natural-language prompt — no URLs required.** Plans, gathers, and shapes an answer under hard safety stops (max steps/URLs/wall-clock enforced by the orchestrator, never the LLM) |
185
185
  | `deep_research` | 10 | Multi-stage research with source verification |
186
186
 
187
- For the full canonical capabilities reference (all tools, CLI commands, stealth engines, research workflow), see [SKILL.md](SKILL.md).
187
+ For the full canonical capabilities reference (all tools, CLI commands, stealth engines, research workflow), see [SKILL.md](docs/SKILL.md).
188
188
 
189
189
  <p align="right"><a href="#table-of-contents">↑ Back to top</a></p>
190
190
 
@@ -226,12 +226,28 @@ export OLLAMA_DEFAULT_MODEL="llama3.2" # default; any locally-pulled
226
226
  export OPENAI_API_KEY="sk-..."
227
227
  export ANTHROPIC_API_KEY="sk-ant-..."
228
228
 
229
+ # Optional: limit which tools this client sees — by name, by group, or both (comma-separated)
230
+ export CRAWLFORGE_TOOLS="scrape,search_web,extract_content"
231
+ export CRAWLFORGE_TOOL_GROUPS="basic,search,scrape" # unset = all tools; unknown names/groups are ignored with a warning
232
+
229
233
  # Optional: deep_research stealth extraction fallback (v4.6.6) — see below
230
234
  export RESEARCH_STEALTH_ENGINE="auto" # auto (default) | camoufox | chromium
231
235
  export RESEARCH_STEALTH_FALLBACK="true" # set to "false" to disable entirely
232
236
  export RESEARCH_MAX_STEALTH_RETRIES="8" # cap on stealth retries per research run
233
237
  ```
234
238
 
239
+ ### MCP Spec Features
240
+
241
+ CrawlForge tracks the current MCP spec (2025-06-18) plus select experimental extensions:
242
+
243
+ - **Structured output** — `scrape`, `map_site`, `serp_rank`, `search_web`, `extract_structured`, and `crawl_deep` return machine-parseable `structuredContent` alongside the usual text, validated against a published `outputSchema`; legacy clients keep working off the text.
244
+ - **Self-correctable errors** — invalid tool input now comes back as an `isError: true` result the calling model can read and retry from, instead of a raw JSON-RPC protocol error.
245
+ - **JSON Schema 2020-12** tool schemas, deterministic `tools/list` ordering (client prompt-cache friendly), and cacheable-result hints on read-only tools.
246
+ - **Icons** on the server, its tools, and its prompts.
247
+ - **Async tasks** (experimental) on the four long-running tools — `crawl_deep`, `batch_scrape`, `deep_research`, `agent` — for clients that support polling; synchronous results are still returned for clients that don't.
248
+
249
+ See [docs/mcp-spec-adoption.md](docs/mcp-spec-adoption.md) for wire-level examples and client-compatibility notes.
250
+
235
251
  ### Local-LLM quickstart (`extract_with_llm` with Ollama)
236
252
 
237
253
  `extract_with_llm` defaults to a local Ollama model — no LLM-provider key, no per-token LLM costs, and no data leaving your machine (the CrawlForge credit cost still applies).
@@ -321,7 +337,7 @@ See [docs/sandboxing-and-approvals.md](docs/sandboxing-and-approvals.md) for the
321
337
 
322
338
  **v3.0.3 (2025-10-01)**: Removed authentication bypass vulnerability. All users must authenticate with valid API keys.
323
339
 
324
- For the full security policy and how to report a vulnerability, see [SECURITY.md](SECURITY.md).
340
+ For the full security policy and how to report a vulnerability, see [SECURITY.md](docs/SECURITY.md).
325
341
 
326
342
  <p align="right"><a href="#table-of-contents">↑ Back to top</a></p>
327
343
 
@@ -338,7 +354,7 @@ MIT License - see [LICENSE](LICENSE) file for details.
338
354
 
339
355
  ## 🤝 Contributing
340
356
 
341
- Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) first.
357
+ Contributions are welcome! Please read our [Contributing Guide](docs/CONTRIBUTING.md) first.
342
358
 
343
359
  ---
344
360
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crawlforge-mcp-server",
3
- "version": "4.9.0",
3
+ "version": "5.0.0",
4
4
  "mcpName": "io.github.mysleekdesigns/crawlforge-mcp-server",
5
5
  "description": "CrawlForge MCP Server - Professional Model Context Protocol server with 27 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",
@@ -16,7 +16,7 @@
16
16
  "setup": "node setup.js",
17
17
  "dev": "cross-env NODE_ENV=development node server.js",
18
18
  "test": "node tests/integration/mcp-protocol-compliance.test.js",
19
- "test:unit": "CRAWLFORGE_CREATOR_SECRET= node --test 'tests/unit/*.test.js'",
19
+ "test:unit": "CRAWLFORGE_CREATOR_SECRET= node --test --test-force-exit 'tests/unit/**/*.test.js'",
20
20
  "test:integration": "CRAWLFORGE_CREATOR_SECRET= node --test 'tests/integration/tools/*.test.js'",
21
21
  "test:coverage": "CRAWLFORGE_CREATOR_SECRET= c8 --reporter=text --reporter=lcov --include='src/**/*.js' --exclude='src/**/_*.js' --lines=60 --statements=60 --functions=55 --branches=45 node --test --test-force-exit 'tests/unit/*.test.js' 'tests/integration/tools/*.test.js'",
22
22
  "test:tools": "node test-tools.js",
@@ -81,7 +81,7 @@
81
81
  "homepage": "https://crawlforge.dev",
82
82
  "type": "module",
83
83
  "engines": {
84
- "node": ">=18.0.0",
84
+ "node": ">=20.16.0",
85
85
  "npm": ">=8.0.0"
86
86
  },
87
87
  "os": [
@@ -108,22 +108,19 @@
108
108
  "package.json"
109
109
  ],
110
110
  "dependencies": {
111
- "@googleapis/customsearch": "^5.0.1",
112
111
  "@modelcontextprotocol/sdk": "^1.29.0",
113
112
  "@mozilla/readability": "^0.6.0",
114
113
  "cheerio": "^1.1.2",
115
- "commander": "^12.1.0",
114
+ "commander": "^14.0.3",
116
115
  "compromise": "^14.14.4",
117
- "diff": "^8.0.2",
116
+ "diff": "^9.0.0",
118
117
  "dotenv": "^17.2.1",
119
118
  "franc": "^6.2.0",
120
119
  "isomorphic-dompurify": "^3.9.0",
121
120
  "jsdom": "^29.0.2",
122
121
  "lru-cache": "^11.1.0",
123
- "node-cron": "^3.0.3",
124
- "node-summarizer": "^1.0.7",
125
- "p-queue": "^8.1.0",
126
- "pdf-parse": "^1.1.1",
122
+ "p-queue": "^9.3.3",
123
+ "pdf-parse": "2.4.5",
127
124
  "playwright": "^1.54.2",
128
125
  "robots-parser": "^3.0.1",
129
126
  "turndown": "^7.2.4",
@@ -147,8 +144,9 @@
147
144
  "underscore": "^1.13.8",
148
145
  "qs": "^6.14.2",
149
146
  "path-to-regexp": "^8.4.2",
150
- "@hono/node-server": "^1.19.13",
147
+ "@hono/node-server": "2.0.12",
151
148
  "hono": "^4.12.4",
152
- "dompurify": "^3.4.0"
149
+ "dompurify": "^3.4.0",
150
+ "adm-zip": "^0.6.0"
153
151
  }
154
152
  }