firecrawl-mcp 3.0.2 → 3.0.3

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 (2) hide show
  1. package/dist/index.js +13 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,6 @@
1
- import dotenv from 'dotenv';
2
1
  import { FastMCP } from 'fastmcp';
3
2
  import { z } from 'zod';
4
3
  import FirecrawlApp from '@mendable/firecrawl-js';
5
- dotenv.config();
6
4
  function extractApiKey(headers) {
7
5
  const headerAuth = headers['authorization'];
8
6
  const headerApiKey = (headers['x-firecrawl-api-key'] ||
@@ -57,18 +55,20 @@ const server = new FastMCP({
57
55
  logger: new ConsoleLogger(),
58
56
  roots: { enabled: false },
59
57
  authenticate: async (request) => {
60
- const apiKey = extractApiKey(request.headers);
61
- if (!apiKey) {
62
- throw new Error('Firecrawl API key is required');
58
+ if (process.env.CLOUD_SERVICE === 'true') {
59
+ const apiKey = extractApiKey(request.headers);
60
+ if (!apiKey) {
61
+ throw new Error('Firecrawl API key is required');
62
+ }
63
+ return { firecrawlApiKey: apiKey };
64
+ }
65
+ else {
66
+ if (!process.env.FIRECRAWL_API_KEY) {
67
+ console.error('Firecrawl API key is required');
68
+ process.exit(1);
69
+ }
70
+ return { firecrawlApiKey: process.env.FIRECRAWL_API_KEY };
63
71
  }
64
- return { firecrawlApiKey: apiKey };
65
- // } else {
66
- // if (!process.env.FIRECRAWL_API_KEY) {
67
- // console.error('Firecrawl API key is required');
68
- // process.exit(1);
69
- // }
70
- // return { firecrawlApiKey: process.env.FIRECRAWL_API_KEY };
71
- // }
72
72
  },
73
73
  // Lightweight health endpoint for LB checks
74
74
  health: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl-mcp",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "description": "MCP server for Firecrawl web scraping integration. Supports both cloud and self-hosted instances. Features include web scraping, search, batch processing, structured data extraction, and LLM-powered content analysis.",
5
5
  "type": "module",
6
6
  "bin": {