firecrawl-mcp 2.0.1 → 2.1.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.
package/dist/index.js CHANGED
@@ -55,6 +55,7 @@ This is the most powerful, fastest and most reliable scraper tool, if available
55
55
  'links',
56
56
  'extract',
57
57
  'summary',
58
+ 'changeTracking',
58
59
  ],
59
60
  },
60
61
  {
@@ -256,7 +257,7 @@ const CRAWL_TOOL = {
256
257
  **Best for:** Extracting content from multiple related pages, when you need comprehensive coverage.
257
258
  **Not recommended for:** Extracting content from a single page (use scrape); when token limits are a concern (use map + batch_scrape); when you need fast results (crawling can be slow).
258
259
  **Warning:** Crawl responses can be very large and may exceed token limits. Limit the crawl depth and number of pages, or use map + batch_scrape for better control.
259
- **Common mistakes:** Setting limit or maxDiscoveryDepth too high (causes token overflow); using crawl for a single page (use scrape instead).
260
+ **Common mistakes:** Setting limit or maxDiscoveryDepth too high (causes token overflow) or too low (causes missing pages); using crawl for a single page (use scrape instead). Using a /* wildcard is not recommended.
260
261
  **Prompt Example:** "Get all blog posts from the first two levels of example.com/blog."
261
262
  **Usage Example:**
262
263
  \`\`\`json
@@ -264,8 +265,8 @@ const CRAWL_TOOL = {
264
265
  "name": "firecrawl_crawl",
265
266
  "arguments": {
266
267
  "url": "https://example.com/blog/*",
267
- "maxDiscoveryDepth": 2,
268
- "limit": 100,
268
+ "maxDiscoveryDepth": 5,
269
+ "limit": 20,
269
270
  "allowExternalLinks": false,
270
271
  "deduplicateSimilarURLs": true,
271
272
  "sitemap": "include"
@@ -702,12 +703,6 @@ function isExtractOptions(args) {
702
703
  return (Array.isArray(urls) &&
703
704
  urls.every((url) => typeof url === 'string'));
704
705
  }
705
- function isGenerateLLMsTextOptions(args) {
706
- return (typeof args === 'object' &&
707
- args !== null &&
708
- 'url' in args &&
709
- typeof args.url === 'string');
710
- }
711
706
  function removeEmptyTopLevel(obj) {
712
707
  const out = {};
713
708
  for (const [k, v] of Object.entries(obj)) {
@@ -905,7 +900,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
905
900
  }
906
901
  return {
907
902
  content: [
908
- { type: 'text', text: trimResponseText(JSON.stringify(response.links, null, 2)) },
903
+ {
904
+ type: 'text',
905
+ text: trimResponseText(JSON.stringify(response.links, null, 2)),
906
+ },
909
907
  ],
910
908
  isError: false,
911
909
  };
@@ -1040,44 +1038,6 @@ ${response.data.length > 0 ? '\nResults:\n' + formatResults(response.data) : ''}
1040
1038
  };
1041
1039
  }
1042
1040
  }
1043
- case 'firecrawl_generate_llmstxt': {
1044
- if (!isGenerateLLMsTextOptions(args)) {
1045
- throw new Error('Invalid arguments for firecrawl_generate_llmstxt');
1046
- }
1047
- try {
1048
- const { url, ...params } = args;
1049
- const generateStartTime = Date.now();
1050
- safeLog('info', `Starting LLMs.txt generation for URL: ${url}`);
1051
- // Start the generation process
1052
- const response = await withRetry(async () =>
1053
- // @ts-expect-error Extended API options including origin
1054
- client.generateLLMsText(url, { ...params, origin: 'mcp-server' }), 'LLMs.txt generation');
1055
- if (!response.success) {
1056
- throw new Error(response.error || 'LLMs.txt generation failed');
1057
- }
1058
- // Log performance metrics
1059
- safeLog('info', `LLMs.txt generation completed in ${Date.now() - generateStartTime}ms`);
1060
- // Format the response
1061
- let resultText = '';
1062
- if ('data' in response) {
1063
- resultText = `LLMs.txt content:\n\n${response.data.llmstxt}`;
1064
- if (args.showFullText && response.data.llmsfulltxt) {
1065
- resultText += `\n\nLLMs-full.txt content:\n\n${response.data.llmsfulltxt}`;
1066
- }
1067
- }
1068
- return {
1069
- content: [{ type: 'text', text: trimResponseText(resultText) }],
1070
- isError: false,
1071
- };
1072
- }
1073
- catch (error) {
1074
- const errorMessage = error instanceof Error ? error.message : String(error);
1075
- return {
1076
- content: [{ type: 'text', text: trimResponseText(errorMessage) }],
1077
- isError: true,
1078
- };
1079
- }
1080
- }
1081
1041
  default:
1082
1042
  return {
1083
1043
  content: [
@@ -1315,8 +1275,14 @@ async function runSSECloudServer() {
1315
1275
  });
1316
1276
  }
1317
1277
  if (process.env.CLOUD_SERVICE === 'true') {
1318
- runSSECloudServer().catch((error) => {
1319
- console.error('Fatal error running server:', error);
1278
+ // Use versioned server for cloud service
1279
+ import('./versioned-server.js').then(({ runVersionedSSECloudServer }) => {
1280
+ runVersionedSSECloudServer().catch((error) => {
1281
+ console.error('Fatal error running versioned server:', error);
1282
+ process.exit(1);
1283
+ });
1284
+ }).catch((error) => {
1285
+ console.error('Fatal error importing versioned server:', error);
1320
1286
  process.exit(1);
1321
1287
  });
1322
1288
  }