firecrawl-mcp 1.7.0 → 1.7.2
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 +17 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -741,7 +741,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
741
741
|
try {
|
|
742
742
|
const scrapeStartTime = Date.now();
|
|
743
743
|
safeLog('info', `Starting scrape for URL: ${url} with options: ${JSON.stringify(options)}`);
|
|
744
|
-
|
|
744
|
+
//@ts-ignore
|
|
745
|
+
const response = await client.scrapeUrl(url, { ...options, origin: 'mcp-server' });
|
|
745
746
|
// Log performance metrics
|
|
746
747
|
safeLog('info', `Scrape completed in ${Date.now() - scrapeStartTime}ms`);
|
|
747
748
|
if ('success' in response && !response.success) {
|
|
@@ -767,6 +768,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
767
768
|
if (options.formats?.includes('extract') && response.extract) {
|
|
768
769
|
contentParts.push(JSON.stringify(response.extract, null, 2));
|
|
769
770
|
}
|
|
771
|
+
// If options.formats is empty, default to markdown
|
|
772
|
+
if (!options.formats || options.formats.length === 0) {
|
|
773
|
+
options.formats = ['markdown'];
|
|
774
|
+
}
|
|
770
775
|
// Add warning to response if present
|
|
771
776
|
if (response.warning) {
|
|
772
777
|
safeLog('warning', response.warning);
|
|
@@ -794,7 +799,8 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
794
799
|
throw new Error('Invalid arguments for firecrawl_map');
|
|
795
800
|
}
|
|
796
801
|
const { url, ...options } = args;
|
|
797
|
-
|
|
802
|
+
//@ts-ignore
|
|
803
|
+
const response = await client.mapUrl(url, { ...options, origin: 'mcp-server' });
|
|
798
804
|
if ('error' in response) {
|
|
799
805
|
throw new Error(response.error);
|
|
800
806
|
}
|
|
@@ -881,7 +887,9 @@ ${operation.result
|
|
|
881
887
|
throw new Error('Invalid arguments for firecrawl_crawl');
|
|
882
888
|
}
|
|
883
889
|
const { url, ...options } = args;
|
|
884
|
-
const response = await withRetry(
|
|
890
|
+
const response = await withRetry(
|
|
891
|
+
//@ts-ignore
|
|
892
|
+
async () => client.asyncCrawlUrl(url, { ...options, origin: 'mcp-server' }), 'crawl operation');
|
|
885
893
|
if (!response.success) {
|
|
886
894
|
throw new Error(response.error);
|
|
887
895
|
}
|
|
@@ -923,7 +931,7 @@ ${response.data.length > 0 ? '\nResults:\n' + formatResults(response.data) : ''}
|
|
|
923
931
|
throw new Error('Invalid arguments for firecrawl_search');
|
|
924
932
|
}
|
|
925
933
|
try {
|
|
926
|
-
const response = await withRetry(async () => client.search(args.query, args), 'search operation');
|
|
934
|
+
const response = await withRetry(async () => client.search(args.query, { ...args, origin: 'mcp-server' }), 'search operation');
|
|
927
935
|
if (!response.success) {
|
|
928
936
|
throw new Error(`Search failed: ${response.error || 'Unknown error'}`);
|
|
929
937
|
}
|
|
@@ -1032,6 +1040,8 @@ ${result.markdown ? `\nContent:\n${result.markdown}` : ''}`)
|
|
|
1032
1040
|
maxDepth: args.maxDepth,
|
|
1033
1041
|
timeLimit: args.timeLimit,
|
|
1034
1042
|
maxUrls: args.maxUrls,
|
|
1043
|
+
//@ts-ignore
|
|
1044
|
+
origin: 'mcp-server',
|
|
1035
1045
|
},
|
|
1036
1046
|
// Activity callback
|
|
1037
1047
|
(activity) => {
|
|
@@ -1079,7 +1089,9 @@ ${result.markdown ? `\nContent:\n${result.markdown}` : ''}`)
|
|
|
1079
1089
|
const generateStartTime = Date.now();
|
|
1080
1090
|
safeLog('info', `Starting LLMs.txt generation for URL: ${url}`);
|
|
1081
1091
|
// Start the generation process
|
|
1082
|
-
const response = await withRetry(
|
|
1092
|
+
const response = await withRetry(
|
|
1093
|
+
//@ts-ignore
|
|
1094
|
+
async () => client.generateLLMsText(url, { ...params, origin: 'mcp-server' }), 'LLMs.txt generation');
|
|
1083
1095
|
if (!response.success) {
|
|
1084
1096
|
throw new Error(response.error || 'LLMs.txt generation failed');
|
|
1085
1097
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firecrawl-mcp",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.2",
|
|
4
4
|
"description": "MCP server for FireCrawl web scraping integration. Supports both cloud and self-hosted instances. Features include web scraping, batch processing, structured data extraction, and LLM-powered content analysis.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|