firecrawl-mcp 3.28.2 → 3.29.1

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/README.md CHANGED
@@ -83,9 +83,6 @@ https://mcp.firecrawl.dev/v2/mcp-search
83
83
 
84
84
  It exposes a fixed set of nine tools: `firecrawl_search`, `firecrawl_developer_search`, `firecrawl_gov_search`, the four `firecrawl_research_*` tools, and the two Alexandria tools `firecrawl_find_tools` and `firecrawl_scrape`. Its `firecrawl_search` fetches no page content, and the surface has its own OAuth identity; the full endpoint above is unchanged. It backs a published connector listing, so its tool set is a contract rather than a profile to tune. See [docs/search-profile.md](docs/search-profile.md) for the full contract and what a change to it involves.
85
85
 
86
- For packaged MCP workflows in ChatGPT, Codex, or Claude Code, see
87
- [MCP plugin packages](plugins/README.md).
88
-
89
86
  ### Running with npx
90
87
 
91
88
  ```bash
@@ -169,6 +166,41 @@ env HTTP_STREAMABLE_SERVER=true FIRECRAWL_API_KEY=fc-YOUR_API_KEY npx -y firecra
169
166
 
170
167
  Use the url: http://localhost:3000/mcp
171
168
 
169
+ ### Running with Docker
170
+
171
+ The `ghcr.io/firecrawl/firecrawl-mcp-server` image runs the same server as `npx -y firecrawl-mcp`. Every build from `main` is tagged `latest`, `v<package version>` and `sha-<commit sha>`. `v<package version>` moves to the newest build of that version, so pin `sha-<commit sha>` (or a digest) when you need a fixed image.
172
+
173
+ stdio (the default), for MCP clients that launch the server as a command:
174
+
175
+ ```bash
176
+ docker run -i --rm -e FIRECRAWL_API_KEY=fc-YOUR_API_KEY ghcr.io/firecrawl/firecrawl-mcp-server:latest
177
+ ```
178
+
179
+ ```json
180
+ {
181
+ "mcpServers": {
182
+ "firecrawl-mcp": {
183
+ "command": "docker",
184
+ "args": ["run", "-i", "--rm", "-e", "FIRECRAWL_API_KEY", "ghcr.io/firecrawl/firecrawl-mcp-server:latest"],
185
+ "env": {
186
+ "FIRECRAWL_API_KEY": "YOUR_API_KEY"
187
+ }
188
+ }
189
+ }
190
+ }
191
+ ```
192
+
193
+ Streamable HTTP, served at `http://localhost:3000/mcp`:
194
+
195
+ ```bash
196
+ docker run --rm -p 127.0.0.1:3000:3000 \
197
+ -e HTTP_STREAMABLE_SERVER=true \
198
+ -e FIRECRAWL_API_KEY=fc-YOUR_API_KEY \
199
+ ghcr.io/firecrawl/firecrawl-mcp-server:latest
200
+ ```
201
+
202
+ The image sets `HOST=0.0.0.0` and `PORT=3000`; override `PORT` (and the `-p` mapping) to listen elsewhere. The server uses the container's `FIRECRAWL_API_KEY` for requests that don't send their own credential, so the example publishes the port on `127.0.0.1` only; don't expose it more widely unless clients must supply their own key. Set `FIRECRAWL_API_URL` to use a self-hosted Firecrawl API. The container runs as the unprivileged `node` user.
203
+
172
204
  ### Installing via Smithery (Legacy)
173
205
 
174
206
  To install Firecrawl for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@mendableai/mcp-server-firecrawl):
@@ -255,11 +287,21 @@ Hosted Firecrawl can issue OAuth **access tokens** (`fco_…`) via the authoriza
255
287
 
256
288
  Use **access** tokens (`fco_…`) only. Refresh tokens (`fcr_…`) must be exchanged at the token endpoint, not passed to the scrape/search API.
257
289
 
290
+ #### Hardened HTTP preset (`CLOUD_SERVICE=true`)
291
+
292
+ `CLOUD_SERVICE=true` serves the tools over streamable HTTP on `PORT` (default `3000`), bound to `0.0.0.0`, with stricter defaults for a shared deployment:
293
+
294
+ - every request must carry a credential (an API key or an OAuth access token);
295
+ - safe mode: scrape is read-only (see the scrape tool below);
296
+ - `firecrawl_parse` accepts uploads only and never reads local files.
297
+
298
+ `FASTMCP_ENDPOINT` selects the surface: `/v2/mcp` (default) serves the full tool set, `/v2/mcp-oauth` the account surface, and `/v2/mcp-search` (which also requires `FIRECRAWL_MCP_SEARCH_OAUTH_ONLY=true`) the [search-only surface](#search-only-surface-hosted) described below.
299
+
258
300
  #### Search-only surface (hosted)
259
301
 
260
- In hosted mode (`CLOUD_SERVICE=true`) a second in-process instance serves the [search-only endpoint](#search-only-endpoint). The bundled service has a fixed deployment contract: nginx routes `/v2/mcp-search` to the instance on local port `3001`, and the OAuth protected-resource identifier is `https://mcp.firecrawl.dev/v2/mcp-search`.
302
+ In hosted mode (`CLOUD_SERVICE=true`) a second in-process instance serves the [search-only endpoint](#search-only-endpoint) on local port `3001`. The hosted deployment's reverse proxy routes `/v2/mcp-search` to that port, and the OAuth protected-resource identifier is `https://mcp.firecrawl.dev/v2/mcp-search`.
261
303
 
262
- `FIRECRAWL_MCP_SEARCH_ENABLED` (default `true`) is the supported operational toggle; set it to `false` to prevent the search instance from starting. The Node process also accepts `FIRECRAWL_MCP_SEARCH_PORT`, `FIRECRAWL_MCP_SEARCH_ENDPOINT`, and `FIRECRAWL_MCP_SEARCH_RESOURCE_URL` for isolated tests. Those overrides do not reconfigure the bundled nginx routes or the authorization server allowlist and must not be used independently in the hosted deployment.
304
+ `FIRECRAWL_MCP_SEARCH_ENABLED` (default `true`) is the supported operational toggle; set it to `false` to prevent the search instance from starting. The Node process also accepts `FIRECRAWL_MCP_SEARCH_PORT`, `FIRECRAWL_MCP_SEARCH_ENDPOINT`, and `FIRECRAWL_MCP_SEARCH_RESOURCE_URL` for isolated tests. Those overrides do not reconfigure the deployment's proxy routes or the authorization server allowlist and must not be used independently in the hosted deployment.
263
305
 
264
306
  The search instance requires authentication for every request (including `tools/list`) and rejects OAuth tokens whose audience does not match its own resource.
265
307
 
@@ -421,7 +463,7 @@ Scrape content from a single URL with advanced options.
421
463
 
422
464
  **Branding format:** Extracts comprehensive brand identity (colors, fonts, typography, spacing, logo, UI components) for design analysis or style replication.
423
465
  **Privacy:** Set `redactPII: true` to return content with personally identifiable information redacted.
424
- **Hosted server:** On the hosted server (`CLOUD_SERVICE=true`) scrape is read-only. It takes no browser `actions` and cannot accept provider terms. A named `profile` loads saved browser state without saving changes to it, and the full endpoint's `firecrawl_search` treats `scrapeOptions.profile` the same way. To save browser state to a profile, open the page with `firecrawl_interact` (see below). An organization admin accepts terms in the dashboard.
466
+ **Hardened HTTP preset and the hosted server:** With `CLOUD_SERVICE=true`, as on the hosted server, scrape is read-only. It takes no browser `actions` and cannot accept provider terms. A named `profile` loads saved browser state without saving changes to it, and the full endpoint's `firecrawl_search` treats `scrapeOptions.profile` the same way. To save browser state to a profile, open the page with `firecrawl_interact` (see below). An organization admin accepts terms in the dashboard.
425
467
 
426
468
  **Returns:**
427
469
 
@@ -1159,6 +1201,63 @@ The tool requires an authenticated Firecrawl account and is read-only.
1159
1201
  - `firecrawl_credit_usage` defaults to `{ "view": "current" }` and returns `remainingCredits`, `planCredits`, `billingPeriodStart`, and `billingPeriodEnd`. Remaining credits can exceed plan credits when the team has top-ups or grants.
1160
1202
  - Pass `{ "view": "historical" }` for calendar-month periods containing `startDate`, `endDate`, and `creditsUsed`. Passing `{ "byApiKey": true }` also selects the historical view and splits periods by API key; each row then includes `apiKey`. Do not combine `byApiKey` with `{ "view": "current" }`. The latest period's `endDate` can be null.
1161
1203
 
1204
+ ## Programmatic use (unstable)
1205
+
1206
+ The package also exposes a library entry point for embedding the server in another runtime. It is **unstable**: the API, its options and its types may change in any release, including minor and patch releases, so pin an exact version.
1207
+
1208
+ ```sh
1209
+ npm install --save-exact firecrawl-mcp zod
1210
+ ```
1211
+
1212
+ The example defines tool parameters with `zod`, so the embedding project installs it as its own dependency.
1213
+
1214
+ ```js
1215
+ import { createFirecrawlMcpServer } from 'firecrawl-mcp/server';
1216
+ import { z } from 'zod';
1217
+
1218
+ const server = createFirecrawlMcpServer({
1219
+ transport: 'httpStream',
1220
+ apiKey: process.env.FIRECRAWL_API_KEY,
1221
+ unstable_hooks: {
1222
+ registerExtraTools: (registrar) => {
1223
+ registrar.addTool({
1224
+ name: 'my_tool',
1225
+ description: 'An extra tool served next to the Firecrawl tools.',
1226
+ parameters: z.object({ text: z.string() }),
1227
+ execute: async ({ text }) => text,
1228
+ });
1229
+ },
1230
+ },
1231
+ });
1232
+
1233
+ await server.start({
1234
+ transportType: 'httpStream',
1235
+ httpStream: { port: 3000, host: '127.0.0.1', endpoint: '/mcp', stateless: true },
1236
+ });
1237
+ // MCP endpoint: http://127.0.0.1:3000/mcp
1238
+ ```
1239
+
1240
+ Set `host` explicitly. Without it the server listens on `localhost`, which Node binds to a single address (often only `::1`), so requests to `127.0.0.1` are refused. Use `0.0.0.0` or `::` to accept connections from other machines only behind network access controls or an `unstable_hooks.authenticate` check: without one, every caller that can reach the port is served with the configured `apiKey`.
1241
+
1242
+ Options mirror the CLI's environment variables: `apiUrl`, `apiKey`, `transport`, `logging`, `safeMode`, `fileAccess` (`local` or `upload`), `requireCredential`, `searchFeedback` and `endpointFeedback`. `unstable_hooks` accepts:
1243
+
1244
+ | Hook | Purpose |
1245
+ |---|---|
1246
+ | `authenticate(request)` | Resolve the session for a request; throw a `Response` to reject it. |
1247
+ | `wrapTool(tool)` | Decorate every registered tool. |
1248
+ | `onToolResult(event)` | Observe the start and outcome of each tool call, with any API agent hints. |
1249
+ | `instructions` | Server instructions, or a function choosing from the defaults. |
1250
+ | `registerExtraTools(registrar, context)` | Add tools after the built-in ones. |
1251
+ | `outboundRequest(session)` | Credential and extra headers for each Firecrawl API request. |
1252
+ | `beforeKeylessRequest(session, origin)` | Refuse a keyless request by throwing. |
1253
+ | `toolFilter(name)` | Leave built-in tools out of the instance. |
1254
+ | `configureHttp(app)` | Add HTTP routes. |
1255
+ | `oauth.protectedResource` | Serve OAuth protected-resource metadata. |
1256
+
1257
+ FastMCP is bundled inside the package, so use the types exported from `firecrawl-mcp/server` (`Session`, `ToolDefinition`, `ToolRegistrar`, `FirecrawlMcpServerHooks` and others) rather than importing `fastmcp` yourself.
1258
+
1259
+ The entry point also exports the helpers the built-in tools use, such as `recoveryPayload`, `normalizeHeader`, `requestOrigin`, `searchToolBaseFields`, `searchOutputSchema` and `structuredCompact`, so extra tools and hooks can match the built-in behaviour. They are unstable as well.
1260
+
1162
1261
  ## Logging System
1163
1262
 
1164
1263
  The server includes comprehensive logging: