firecrawl-mcp 3.23.3 → 3.23.6

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 +36 -68
  2. package/dist/index.js +73 -50
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -35,15 +35,29 @@ Connect to the remote hosted server with no setup:
35
35
  https://mcp.firecrawl.dev/v2/mcp
36
36
  ```
37
37
 
38
- On the keyless free tier, `scrape`, `search`, and `interact` work without an API key (rate-limited). Other tools such as `crawl`, `map`, `agent`, and `extract` still need a key.
38
+ On the keyless free tier, `scrape`, `search`, and `interact` work without an API key (rate-limited). Other tools such as `crawl`, `map`, and `agent` still need a key.
39
39
 
40
- Prefer an API key or OAuth whenever the human can sign up. It unlocks the full tool set and higher limits. With a key, use:
40
+ Prefer OAuth or an API key whenever the human can sign up. It unlocks the full tool set and higher limits.
41
+
42
+ For an interactive account connection, use:
43
+
44
+ ```
45
+ https://mcp.firecrawl.dev/v2/mcp-oauth
46
+ ```
47
+
48
+ For an API-key connection (for example, an unattended integration), keep the server URL as:
49
+
50
+ ```
51
+ https://mcp.firecrawl.dev/v2/mcp
52
+ ```
53
+
54
+ Then configure the client's secure header or secret setting with:
41
55
 
42
56
  ```
43
- https://mcp.firecrawl.dev/{FIRECRAWL_API_KEY}/v2/mcp
57
+ Authorization: Bearer <FIRECRAWL_API_KEY>
44
58
  ```
45
59
 
46
- See the [MCP server docs](https://docs.firecrawl.dev/mcp-server) and the [agent onboarding guide](https://www.firecrawl.dev/agent-onboarding/SKILL.md) for setup details.
60
+ Never put an API key in the server URL. See the [hosted MCP setup guide](https://docs.firecrawl.dev/developer-guides/mcp-setup-guides/oauth) and the [agent onboarding guide](https://www.firecrawl.dev/agent-onboarding/SKILL.md) for client-specific instructions.
47
61
 
48
62
  #### Search-only endpoint
49
63
 
@@ -290,7 +304,6 @@ Use this guide to select the right tool for your task:
290
304
  | map | Discovering URLs on a site | URL[] |
291
305
  | crawl | Multi-page extraction (with limits) | final crawl status/data after internal polling |
292
306
  | parse | Files and hosted upload refs | markdown, JSON, or document output |
293
- | extract | Structured extraction from URLs | JSON structured data |
294
307
  | search | Web search for info | results[] |
295
308
  | developer | Programming questions over developer sources | results[] with passages |
296
309
  | agent | Complex multi-source research | JSON (structured data) |
@@ -643,79 +656,34 @@ Parse local files or hosted upload references with Firecrawl's `/v2/parse` endpo
643
656
 
644
657
  **Returns:** Parsed document content or hosted upload instructions with a `nextToolCall`.
645
658
 
646
- ### 7. Extract Tool (`firecrawl_extract`)
647
-
648
- Extract structured information from web pages using LLM capabilities. Supports both cloud AI and self-hosted LLM extraction.
649
-
650
- **Best for:**
651
-
652
- - Extracting specific structured data like prices, names, details.
653
-
654
- **Not recommended for:**
655
-
656
- - When you need the full content of a page (use scrape)
657
- - When you're not looking for specific structured data
658
-
659
- **Arguments:**
660
-
661
- - `urls`: Array of URLs to extract information from
662
- - `prompt`: Custom prompt for the LLM extraction
663
- - `systemPrompt`: System prompt to guide the LLM
664
- - `schema`: JSON schema for structured data extraction
665
- - `allowExternalLinks`: Allow extraction from external links
666
- - `enableWebSearch`: Enable web search for additional context
667
- - `includeSubdomains`: Include subdomains in extraction
668
-
669
- When using a self-hosted instance, the extraction will use your configured LLM. For cloud API, it uses Firecrawl's managed LLM service.
670
- **Prompt Example:**
671
-
672
- > "Extract the product name, price, and description from these product pages."
659
+ ### 7. Structured data with Scrape JSON
673
660
 
674
- **Usage Example:**
661
+ For structured data from a known page, call `firecrawl_scrape` once per URL with `formats: ["json"]`. Put the extraction prompt and JSON schema in `jsonOptions`.
675
662
 
676
663
  ```json
677
664
  {
678
- "name": "firecrawl_extract",
665
+ "name": "firecrawl_scrape",
679
666
  "arguments": {
680
- "urls": ["https://example.com/page1", "https://example.com/page2"],
681
- "prompt": "Extract product information including name, price, and description",
682
- "systemPrompt": "You are a helpful assistant that extracts product information",
683
- "schema": {
684
- "type": "object",
685
- "properties": {
686
- "name": { "type": "string" },
687
- "price": { "type": "number" },
688
- "description": { "type": "string" }
689
- },
690
- "required": ["name", "price"]
691
- },
692
- "allowExternalLinks": false,
693
- "enableWebSearch": false,
694
- "includeSubdomains": false
695
- }
696
- }
697
- ```
698
-
699
- **Returns:**
700
-
701
- - Extracted structured data as defined by your schema
702
-
703
- ```json
704
- {
705
- "content": [
706
- {
707
- "type": "text",
708
- "text": {
709
- "name": "Example Product",
710
- "price": 99.99,
711
- "description": "This is an example product description"
667
+ "url": "https://example.com/product",
668
+ "formats": ["json"],
669
+ "jsonOptions": {
670
+ "prompt": "Extract the product name, price, and description.",
671
+ "schema": {
672
+ "type": "object",
673
+ "properties": {
674
+ "name": { "type": "string" },
675
+ "price": { "type": "number" },
676
+ "description": { "type": "string" }
677
+ },
678
+ "required": ["name", "price"]
712
679
  }
713
680
  }
714
- ],
715
- "isError": false
681
+ }
716
682
  }
717
683
  ```
718
684
 
685
+ For unknown URLs or multi-source research, use `firecrawl_search` or `firecrawl_agent` before Scrape.
686
+
719
687
  ### 8. Agent Tool (`firecrawl_agent`)
720
688
 
721
689
  Autonomous web research agent. This is a separate AI agent layer that independently browses the internet, searches for information, navigates through pages, and extracts structured data based on your query.
package/dist/index.js CHANGED
@@ -1059,15 +1059,7 @@ async function authenticateRequest(request, profile) {
1059
1059
  if (process.env.CLOUD_SERVICE === "true") {
1060
1060
  if (!headerCred && !managedCred) {
1061
1061
  if (resolved?.invalid) {
1062
- if (!profile.acceptApiKeys) {
1063
- throw new Error(
1064
- `OAuth access token required for the Firecrawl MCP resource ${profile.endpoint}`
1065
- );
1066
- }
1067
- if (isLegacyKeyPathRequest(request)) {
1068
- throw new InvalidFirecrawlCredentialError();
1069
- }
1070
- return { authType: "none", credentialError: "CREDENTIAL_INVALID" };
1062
+ throw new InvalidFirecrawlCredentialError();
1071
1063
  }
1072
1064
  if (profile.allowKeyless) {
1073
1065
  return {
@@ -1281,8 +1273,8 @@ var ConsoleLogger = class {
1281
1273
  var openAiAppsChallengeToken = normalizeHeader(
1282
1274
  process.env.OPENAI_APPS_CHALLENGE_TOKEN
1283
1275
  );
1284
- var FULL_PROFILE_INSTRUCTIONS = `Firecrawl provides web search, page retrieval, site URL discovery, multi-page collection, structured extraction, monitoring, and asynchronous research. Match the requested operation to the tool boundary: firecrawl_scrape retrieves one supplied page, firecrawl_map enumerates URLs under a site without retrieving their content, and firecrawl_agent starts multi-source research whose result is read with firecrawl_agent_status. Provide only the required inputs and account for stated network or external side effects.`;
1285
- var KEYLESS_PROFILE_INSTRUCTIONS = `Without authentication, this endpoint exposes Search, Scrape, and Parse with usage limits. An OAuth connection or Authorization bearer API key exposes account tools; unavailable tools return connection guidance. Firecrawl provides web search, page retrieval, site URL discovery, multi-page collection, structured extraction, monitoring, and asynchronous research. Match the requested operation to the tool boundary: firecrawl_scrape retrieves one supplied page, firecrawl_map enumerates URLs under a site without retrieving their content, and firecrawl_agent starts multi-source research whose result is read with firecrawl_agent_status. Provide only the required inputs.`;
1276
+ var FULL_PROFILE_INSTRUCTIONS = `Firecrawl provides web search, page retrieval, site URL discovery, multi-page collection, structured page data, monitoring, and asynchronous research. Match the requested operation to the tool boundary: firecrawl_scrape retrieves one supplied page and can return JSON matching a supplied schema, firecrawl_map enumerates URLs under a site without retrieving their content, and firecrawl_agent starts multi-source research whose result is read with firecrawl_agent_status. Provide only the required inputs and account for stated network or external side effects.`;
1277
+ var KEYLESS_PROFILE_INSTRUCTIONS = `Without authentication, this endpoint exposes Search, Scrape, and Parse with usage limits. An OAuth connection or Authorization bearer API key exposes account tools; unavailable tools return connection guidance. Firecrawl provides web search, page retrieval, site URL discovery, multi-page collection, structured page data, monitoring, and asynchronous research. Match the requested operation to the tool boundary: firecrawl_scrape retrieves one supplied page and can return JSON matching a supplied schema, firecrawl_map enumerates URLs under a site without retrieving their content, and firecrawl_agent starts multi-source research whose result is read with firecrawl_agent_status. Provide only the required inputs.`;
1286
1278
  var SEARCH_PROFILE_INSTRUCTIONS = `Firecrawl provides web, developer, and research search. Use firecrawl_search to find relevant results across the web and specialized indexes. For a programming question, use firecrawl_search with categories: ["developer"] to search indexed GitHub issues, merged pull requests, READMEs, and documentation. Use the firecrawl_research_* tools to search academic and research literature, expand from anchor papers via the citation graph, read full-text passages from a specific paper, and search public code repositories. All tools are read-only and return ranked results.`;
1287
1279
  var SEARCH_PROFILE_TOOLS = /* @__PURE__ */ new Set([
1288
1280
  "firecrawl_search",
@@ -1388,7 +1380,7 @@ function recoveryPayload(code, requestId = randomUUID(), options = {}) {
1388
1380
  code,
1389
1381
  request_id: requestId,
1390
1382
  auth_mode: code === "CREDENTIAL_INVALID" ? "credential_error" : "keyless",
1391
- message: code === "CREDENTIAL_INVALID" ? "The supplied Firecrawl credential is invalid or revoked. Replace it or reconnect the account, then retry." : isQuotaExhausted ? `The free daily limit for this network has been reached${retryAfterSeconds ? `; try again in about ${retryAfterSeconds} seconds` : ""}. To continue now, connect a Firecrawl account via OAuth or configure an API key.` : isToolUnavailable ? "The free tier includes Search, Scrape, and Parse. This tool needs a connected account; Search, Scrape, and Parse still work, so no action is required." : isKeylessAccessUnavailable ? "Anonymous keyless access is unavailable for this request. To continue, connect a Firecrawl account via OAuth or configure an API key." : isKeylessEligibilityUnavailable ? "The anonymous keyless eligibility check is temporarily unavailable. Retry shortly." : "This tool requires a Firecrawl account or API key. Connect an account or configure Authorization: Bearer <FIRECRAWL_API_KEY>, then retry.",
1383
+ message: code === "CREDENTIAL_INVALID" ? `The supplied Firecrawl credential is invalid or revoked. Reconnect the account via OAuth (https://mcp.firecrawl.dev/v2/mcp-oauth) or create a new API key at https://www.firecrawl.dev/signin and send it as Authorization: Bearer <FIRECRAWL_API_KEY>, then retry.` : isQuotaExhausted ? `The free daily limit for this network has been reached${retryAfterSeconds ? `; try again in about ${retryAfterSeconds} seconds` : ""}. To continue now, connect a Firecrawl account via OAuth (https://mcp.firecrawl.dev/v2/mcp-oauth) or create a free API key at https://www.firecrawl.dev/signin and send it as Authorization: Bearer <FIRECRAWL_API_KEY>.` : isToolUnavailable ? "The free tier includes Search, Scrape, and Parse. This tool needs a connected account; Search, Scrape, and Parse still work, so no action is required." : isKeylessAccessUnavailable ? `Anonymous keyless access is unavailable for this request. To continue, connect a Firecrawl account via OAuth (https://mcp.firecrawl.dev/v2/mcp-oauth) or create a free API key at https://www.firecrawl.dev/signin and send it as Authorization: Bearer <FIRECRAWL_API_KEY>.` : isKeylessEligibilityUnavailable ? "The anonymous keyless eligibility check is temporarily unavailable. Retry shortly." : `This tool requires a Firecrawl account or API key. Connect an account via OAuth (https://mcp.firecrawl.dev/v2/mcp-oauth) or create a free API key at https://www.firecrawl.dev/signin and send it as Authorization: Bearer <FIRECRAWL_API_KEY>, then retry.`,
1392
1384
  ...isKeylessAccessUnavailable ? {} : { available_tools: [...KEYLESS_TOOL_NAMES] },
1393
1385
  docs_url: "https://docs.firecrawl.dev/mcp-server",
1394
1386
  ...retryAfterSeconds ? { retry_after_seconds: retryAfterSeconds } : {},
@@ -1401,6 +1393,28 @@ function recoveryPayload(code, requestId = randomUUID(), options = {}) {
1401
1393
  ]
1402
1394
  };
1403
1395
  }
1396
+ function deprecatedExtractPayload() {
1397
+ return {
1398
+ code: "DEPRECATED_TOOL",
1399
+ message: 'firecrawl_extract is deprecated and unavailable through MCP. For structured data from a known page, call firecrawl_scrape once per URL with formats: ["json"] and jsonOptions containing the prompt and schema. For unknown URLs or multi-source research, use firecrawl_search or firecrawl_agent first.',
1400
+ replacement: {
1401
+ name: "firecrawl_scrape",
1402
+ instructions: 'Call once per known URL. Set formats to ["json"] and pass the extraction prompt and JSON schema in jsonOptions.',
1403
+ example_arguments: {
1404
+ url: "https://example.com/page",
1405
+ formats: ["json"],
1406
+ jsonOptions: {
1407
+ prompt: "Extract the requested fields from this page.",
1408
+ schema: {
1409
+ type: "object",
1410
+ properties: {}
1411
+ }
1412
+ }
1413
+ }
1414
+ },
1415
+ docs_url: "https://docs.firecrawl.dev/developer-guides/usage-guides/choosing-the-data-extractor"
1416
+ };
1417
+ }
1404
1418
  function emitActionLog(toolName, status, session, error, requestId = randomUUID(), code) {
1405
1419
  if (process.env.CLOUD_SERVICE !== "true") return;
1406
1420
  const payload = {
@@ -1436,22 +1450,39 @@ function emitActionLog(toolName, status, session, error, requestId = randomUUID(
1436
1450
  function guardHostedTool(tool, { logActions }) {
1437
1451
  const keylessTool = KEYLESS_TOOL_NAMES.has(tool.name);
1438
1452
  const execute = tool.execute;
1453
+ const canList = tool.canList;
1454
+ const beforeValidate = tool.beforeValidate;
1439
1455
  return {
1440
1456
  ...tool,
1441
- canList: (session) => !session?.credentialError && (!isHostedKeylessSession(session) || keylessTool),
1442
- beforeValidate: (_args, session) => {
1457
+ canList: (session) => !session?.credentialError && (!isHostedKeylessSession(session) || keylessTool) && (canList?.(session) ?? true),
1458
+ beforeValidate: async (args2, session) => {
1443
1459
  const code = session?.credentialError ? "CREDENTIAL_INVALID" : isHostedKeylessSession(session) && !keylessTool ? "KEYLESS_TOOL_NOT_AVAILABLE" : void 0;
1444
- if (!code) return void 0;
1445
- const requestId = randomUUID();
1446
- const payload = recoveryPayload(code, requestId);
1447
- if (logActions) {
1448
- emitActionLog(tool.name, "error", session, new UserError(String(payload.message), payload), requestId, code);
1460
+ if (code) {
1461
+ const requestId = randomUUID();
1462
+ const payload2 = recoveryPayload(code, requestId);
1463
+ if (logActions) {
1464
+ emitActionLog(tool.name, "error", session, new UserError(String(payload2.message), payload2), requestId, code);
1465
+ }
1466
+ return {
1467
+ content: [{ type: "text", text: String(payload2.message) }],
1468
+ isError: true,
1469
+ structuredContent: payload2
1470
+ };
1449
1471
  }
1450
- return {
1451
- content: [{ type: "text", text: String(payload.message) }],
1452
- isError: true,
1453
- structuredContent: payload
1454
- };
1472
+ const earlyResult = await beforeValidate?.(args2, session);
1473
+ const payload = earlyResult?.structuredContent;
1474
+ const recoveryCode = payload && typeof payload === "object" && "code" in payload && typeof payload.code === "string" ? payload.code : void 0;
1475
+ if (logActions && earlyResult?.isError && recoveryCode) {
1476
+ emitActionLog(
1477
+ tool.name,
1478
+ "error",
1479
+ session,
1480
+ new UserError(`Tool validation failed: ${recoveryCode}`, payload),
1481
+ randomUUID(),
1482
+ recoveryCode
1483
+ );
1484
+ }
1485
+ return earlyResult;
1455
1486
  },
1456
1487
  execute: async (args2, context) => {
1457
1488
  const requestId = randomUUID();
@@ -1742,7 +1773,7 @@ var parseOptionParamsSchema = z4.object({
1742
1773
  skipTlsVerification: z4.boolean().optional(),
1743
1774
  storeInCache: z4.boolean().optional(),
1744
1775
  zeroDataRetention: z4.boolean().optional(),
1745
- maxAge: z4.number().optional(),
1776
+ maxAge: z4.number().optional().describe("Ignored: parse never reuses or stores indexed content."),
1746
1777
  proxy: z4.enum(["basic", "auto"]).optional()
1747
1778
  });
1748
1779
  var localParseParamsSchema = parseOptionParamsSchema.extend({
@@ -1980,6 +2011,8 @@ Retrieve and extract content from one supplied URL through Firecrawl. Use this w
1980
2011
 
1981
2012
  This tool operates on a known page. For a set of pages use \`firecrawl_crawl\`, and to discover page URLs use \`firecrawl_map\` or \`firecrawl_search\`. Options include JavaScript render delay, cache age, main-content filtering, PII redaction, and lockdown cache-only retrieval. Browser actions may change the live page when interactive actions are enabled.
1982
2013
 
2014
+ Firecrawl may reuse recently indexed content instead of refetching the page, and the reuse window varies by domain. Set \`maxAge: 0\` to force a live fetch, or a smaller \`maxAge\` to bound how stale reused content may be. A successful response does not by itself confirm that the state it describes is still current.
2015
+
1983
2016
  Returns the selected content formats and page metadata.
1984
2017
  `,
1985
2018
  parameters: scrapeParamsSchema,
@@ -2066,7 +2099,7 @@ Search web, news, or image sources and return ranked results. Operators include
2066
2099
 
2067
2100
  For a programming question, add \`categories: ["developer"]\`. It searches an index of GitHub issues, merged pull requests, repository READMEs, and curated documentation sites, and returns the hits in \`data.developer\` beside the web results.
2068
2101
 
2069
- \`scrapeOptions\` can attach extracted page content. Returns source-type result groups and usage metadata. Authenticated responses can include an \`id\` for optional search feedback.
2102
+ \`scrapeOptions\` can attach extracted page content; pages fetched this way use a fixed reuse window and ignore \`maxAge\`, so use \`firecrawl_scrape\` when a live fetch is required. Returns source-type result groups and usage metadata. Authenticated responses can include an \`id\` for optional search feedback.
2070
2103
  `,
2071
2104
  parameters: z4.object({
2072
2105
  ...searchToolBaseFields,
@@ -2584,18 +2617,13 @@ Retrieve the current status, progress, and available results for an existing cra
2584
2617
  server.addTool({
2585
2618
  name: "firecrawl_extract",
2586
2619
  annotations: {
2587
- title: "Extract structured data",
2620
+ title: "Deprecated: use Scrape JSON",
2588
2621
  readOnlyHint: true,
2589
- // Uses LLM extraction to pull structured data from URLs without modifying those sites.
2590
2622
  openWorldHint: true,
2591
- // Accepts arbitrary user-supplied URLs on the public web.
2592
2623
  destructiveHint: false
2593
- // Read-only extraction; no destructive changes to external content.
2594
2624
  },
2595
2625
  description: `
2596
- Extract structured information from one or more URLs with an optional natural-language prompt and JSON schema. It can include subdomains, follow external links, or use web search when those options are enabled.
2597
-
2598
- Use this for a defined structured result rather than full page content. Returns data shaped by the supplied schema or prompt.
2626
+ Deprecated compatibility entry point. Use firecrawl_scrape once per known URL with formats: ["json"] and jsonOptions containing the prompt and schema. Use firecrawl_search or firecrawl_agent before Scrape when URLs are not known.
2599
2627
  `,
2600
2628
  parameters: z4.object({
2601
2629
  urls: z4.array(z4.string()),
@@ -2605,23 +2633,18 @@ Use this for a defined structured result rather than full page content. Returns
2605
2633
  enableWebSearch: z4.boolean().optional(),
2606
2634
  includeSubdomains: z4.boolean().optional()
2607
2635
  }),
2608
- execute: async (args2, { session, log }) => {
2609
- const client = getClient(session);
2610
- const a = args2;
2611
- log.info("Extracting from URLs", {
2612
- count: Array.isArray(a.urls) ? a.urls.length : 0
2613
- });
2614
- const extractBody = removeEmptyTopLevel({
2615
- urls: a.urls,
2616
- prompt: a.prompt,
2617
- schema: a.schema || void 0,
2618
- allowExternalLinks: a.allowExternalLinks,
2619
- enableWebSearch: a.enableWebSearch,
2620
- includeSubdomains: a.includeSubdomains,
2621
- origin: ORIGIN
2622
- });
2623
- const res = await client.extract(extractBody);
2624
- return asText2(res);
2636
+ canList: () => false,
2637
+ beforeValidate: () => {
2638
+ const payload = deprecatedExtractPayload();
2639
+ return {
2640
+ content: [{ type: "text", text: payload.message }],
2641
+ isError: true,
2642
+ structuredContent: payload
2643
+ };
2644
+ },
2645
+ execute: async () => {
2646
+ const payload = deprecatedExtractPayload();
2647
+ throw new UserError(payload.message, payload);
2625
2648
  }
2626
2649
  });
2627
2650
  server.addTool({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl-mcp",
3
- "version": "3.23.3",
3
+ "version": "3.23.6",
4
4
  "description": "MCP server for Firecrawl — search, scrape, and interact with the web. Supports both cloud and self-hosted instances. Features include web search, scraping, page interaction, batch processing, and LLM-powered content analysis.",
5
5
  "type": "module",
6
6
  "mcpName": "io.github.firecrawl/firecrawl-mcp-server",