firecrawl-mcp 3.18.0 → 3.19.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.
Files changed (3) hide show
  1. package/README.md +70 -4
  2. package/dist/monitor.js +130 -15
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -872,7 +872,73 @@ Check the status of an agent job and retrieve results when complete. Use this to
872
872
  - `completed`: Research finished - response includes the extracted data
873
873
  - `failed`: An error occurred
874
874
 
875
- ### 11. Browser Create (`firecrawl_browser_create`) — Deprecated
875
+ ### 11. Monitor Tools (`firecrawl_monitor_*`)
876
+
877
+ Create and manage recurring page monitors. Monitors run scheduled scrapes or crawls, diff each result against the last retained snapshot, and can notify by webhook or email.
878
+
879
+ **Best for:**
880
+
881
+ - Watching one page or a few pages over time
882
+ - Alerting on meaningful changes using a plain-English goal
883
+ - Tracking check history and page-level diffs
884
+
885
+ **Recommended create pattern:**
886
+
887
+ Use `page` or `pages` plus `goal`. The MCP server builds the monitor request with a 30-minute schedule and the API enables meaningful-change judging automatically.
888
+
889
+ Write goals as concise 2-3 sentence monitor instructions. Say what should trigger an alert, preserve any scope the user gave, and include intent-specific exclusions only when obvious from the request. Generic noise such as whitespace, formatting-only changes, request IDs, tracking params, generic metadata, and unrelated page chrome is already handled by the judge, so do not repeat it in every goal. If the user is vague, keep the goal broad; if they ask for broad monitoring or "any change", preserve that. If the user says they do not care about something, include that explicitly.
890
+
891
+ ```json
892
+ {
893
+ "name": "firecrawl_monitor_create",
894
+ "arguments": {
895
+ "page": "https://example.com/pricing",
896
+ "goal": "Alert when pricing, packaging, or launch messaging changes."
897
+ }
898
+ }
899
+ ```
900
+
901
+ **Multiple pages with webhooks:**
902
+
903
+ ```json
904
+ {
905
+ "name": "firecrawl_monitor_create",
906
+ "arguments": {
907
+ "pages": ["https://example.com/pricing", "https://example.com/changelog"],
908
+ "goal": "Alert when pricing, packaging, or launch messaging changes.",
909
+ "webhookUrl": "https://example.com/webhooks/firecrawl"
910
+ }
911
+ }
912
+ ```
913
+
914
+ **Advanced create requests:**
915
+
916
+ Pass `body` when you need crawl targets, JSON change tracking, custom retention, or explicit `judgeEnabled` control.
917
+
918
+ ```json
919
+ {
920
+ "name": "firecrawl_monitor_create",
921
+ "arguments": {
922
+ "body": {
923
+ "name": "Docs monitor",
924
+ "schedule": { "text": "hourly", "timezone": "UTC" },
925
+ "goal": "Alert when docs pages add, remove, or materially change API behavior.",
926
+ "targets": [{ "type": "crawl", "url": "https://example.com/docs" }]
927
+ }
928
+ }
929
+ }
930
+ ```
931
+
932
+ **Other monitor tools:**
933
+
934
+ - `firecrawl_monitor_list`: list monitors.
935
+ - `firecrawl_monitor_get`: get one monitor.
936
+ - `firecrawl_monitor_update`: update fields including `goal`, `judgeEnabled`, `webhook`, and `notification`.
937
+ - `firecrawl_monitor_run`: trigger a check now.
938
+ - `firecrawl_monitor_checks`: list checks, optionally filtered by status.
939
+ - `firecrawl_monitor_check`: get page-level results, including `diff`, `snapshot`, `judgment.meaningful`, and `judgment.meaningfulChanges`.
940
+
941
+ ### 12. Browser Create (`firecrawl_browser_create`) — Deprecated
876
942
 
877
943
  > **Deprecated:** Prefer `firecrawl_scrape` + `firecrawl_interact` instead. Interact lets you scrape a page and then click, fill forms, and navigate without managing sessions manually.
878
944
 
@@ -903,7 +969,7 @@ Create a cloud browser session for interactive automation.
903
969
 
904
970
  - Session ID, CDP URL, and live view URL
905
971
 
906
- ### 12. Browser Execute (`firecrawl_browser_execute`) — Deprecated
972
+ ### 13. Browser Execute (`firecrawl_browser_execute`) — Deprecated
907
973
 
908
974
  > **Deprecated:** Prefer `firecrawl_scrape` + `firecrawl_interact` instead.
909
975
 
@@ -947,7 +1013,7 @@ Execute code in a browser session. Supports agent-browser commands (bash), Pytho
947
1013
  }
948
1014
  ```
949
1015
 
950
- ### 13. Browser List (`firecrawl_browser_list`) — Deprecated
1016
+ ### 14. Browser List (`firecrawl_browser_list`) — Deprecated
951
1017
 
952
1018
  > **Deprecated:** Prefer `firecrawl_scrape` + `firecrawl_interact` instead.
953
1019
 
@@ -962,7 +1028,7 @@ List browser sessions, optionally filtered by status.
962
1028
  }
963
1029
  ```
964
1030
 
965
- ### 14. Browser Delete (`firecrawl_browser_delete`) — Deprecated
1031
+ ### 15. Browser Delete (`firecrawl_browser_delete`) — Deprecated
966
1032
 
967
1033
  > **Deprecated:** Prefer `firecrawl_scrape` + `firecrawl_interact` instead.
968
1034
 
package/dist/monitor.js CHANGED
@@ -53,6 +53,67 @@ function asText(data) {
53
53
  return JSON.stringify(data, null, 2);
54
54
  }
55
55
  const pageStatusSchema = z.enum(['same', 'new', 'changed', 'removed', 'error']);
56
+ const checkStatusSchema = z.enum([
57
+ 'queued',
58
+ 'running',
59
+ 'completed',
60
+ 'failed',
61
+ 'partial',
62
+ 'skipped_overlap',
63
+ ]);
64
+ function splitPages(page, pages) {
65
+ return [page, ...(pages ?? [])]
66
+ .filter((url) => typeof url === 'string')
67
+ .map(url => url.trim())
68
+ .filter(Boolean);
69
+ }
70
+ function buildMonitorCreateBody(args) {
71
+ if (args.body && typeof args.body === 'object' && !Array.isArray(args.body)) {
72
+ return args.body;
73
+ }
74
+ const urls = splitPages(args.page, args.pages);
75
+ if (urls.length === 0) {
76
+ throw new Error('firecrawl_monitor_create requires either `body`, `page`, or `pages`.');
77
+ }
78
+ const goal = typeof args.goal === 'string' ? args.goal.trim() : '';
79
+ if (!goal) {
80
+ throw new Error('firecrawl_monitor_create shorthand requires `goal`. Use `body` for advanced requests without a goal.');
81
+ }
82
+ const webhookUrl = typeof args.webhookUrl === 'string' ? args.webhookUrl.trim() : '';
83
+ const email = typeof args.email === 'string' && args.email.trim()
84
+ ? {
85
+ email: {
86
+ enabled: true,
87
+ recipients: [args.email.trim()],
88
+ includeDiffs: Boolean(args.includeDiffs),
89
+ },
90
+ }
91
+ : undefined;
92
+ return {
93
+ name: typeof args.name === 'string' && args.name.trim()
94
+ ? args.name.trim()
95
+ : `Monitor ${urls[0]}`,
96
+ schedule: {
97
+ text: typeof args.scheduleText === 'string' && args.scheduleText.trim()
98
+ ? args.scheduleText.trim()
99
+ : 'every 30 minutes',
100
+ timezone: typeof args.timezone === 'string' && args.timezone.trim()
101
+ ? args.timezone.trim()
102
+ : 'UTC',
103
+ },
104
+ goal,
105
+ targets: [{ type: 'scrape', urls }],
106
+ ...(email ? { notification: email } : {}),
107
+ ...(webhookUrl
108
+ ? {
109
+ webhook: {
110
+ url: webhookUrl,
111
+ events: ['monitor.page', 'monitor.check.completed'],
112
+ },
113
+ }
114
+ : {}),
115
+ };
116
+ }
56
117
  export function registerMonitorTools(server) {
57
118
  server.addTool({
58
119
  name: 'firecrawl_monitor_create',
@@ -64,7 +125,25 @@ export function registerMonitorTools(server) {
64
125
  description: `
65
126
  Create a Firecrawl monitor — a recurring scrape or crawl that diffs each result against the last retained snapshot.
66
127
 
67
- Pass the full request body. Required fields: \`name\`, \`schedule\` (with \`cron\` or \`text\`), and \`targets\` (one or more \`{ type: 'scrape', urls: [...] }\` or \`{ type: 'crawl', url: '...' }\`). Optional: \`webhook\`, \`notification\`, \`retentionDays\`.
128
+ Prefer the simple path: pass \`page\` or \`pages\` plus \`goal\`. The tool will create a scrape monitor with a 30-minute schedule and meaningful-change judging enabled by the API. Use \`body\` only for advanced requests such as crawl targets, JSON change tracking, custom retention, or manual \`judgeEnabled\` control.
129
+
130
+ Simple fields:
131
+ - \`page\`: one page URL to monitor.
132
+ - \`pages\`: multiple page URLs to monitor.
133
+ - \`goal\`: plain-English instruction for what changes matter. Required for the simple path.
134
+ - \`scheduleText\`: optional natural-language schedule, default \`every 30 minutes\`.
135
+ - \`email\`: optional email recipient for summaries.
136
+ - \`webhookUrl\`: optional webhook URL. Configures \`monitor.page\` and \`monitor.check.completed\`.
137
+
138
+ Goal guidance:
139
+ - Expand the user's one-line monitoring intent into a concise 2-3 sentence monitor goal.
140
+ - State what should trigger an alert, restate any scope the user gave, and include intent-specific exclusions only when obvious from the user's request.
141
+ - Generic noise such as whitespace, formatting-only changes, request IDs, tracking params, generic metadata, and unrelated page chrome is already handled by the judge; do not repeat it in every goal.
142
+ - If the user is vague, keep the goal broad rather than guessing exclusions. If the user asks for broad monitoring or "any change", preserve that and do not add exclusions that hide changes.
143
+ - If the user says they do not care about something, include that explicitly. It is okay to ask whether they want to ignore specific noise when it is likely to matter.
144
+ - Do not invent page-specific sections, thresholds, entities, or business rules unless the user mentioned them.
145
+
146
+ Full \`body\` requests require: \`name\`, \`schedule\` (with \`cron\` or \`text\`), and \`targets\` (one or more \`{ type: 'scrape', urls: [...] }\` or \`{ type: 'crawl', url: '...' }\`). Optional: \`goal\`, \`judgeEnabled\`, \`webhook\`, \`notification\`, \`retentionDays\`.
68
147
 
69
148
  **Markdown-mode (default):** Each check produces a unified text diff of the page's markdown. No extra configuration needed.
70
149
 
@@ -72,12 +151,22 @@ Pass the full request body. Required fields: \`name\`, \`schedule\` (with \`cron
72
151
  {
73
152
  "name": "firecrawl_monitor_create",
74
153
  "arguments": {
75
- "body": {
76
- "name": "Blog watch",
77
- "schedule": { "text": "every 30 minutes", "timezone": "UTC" },
78
- "targets": [{ "type": "scrape", "urls": ["https://example.com/blog"] }],
79
- "notification": { "email": { "enabled": true, "recipients": ["a@b.com"] } }
80
- }
154
+ "page": "https://example.com/blog",
155
+ "goal": "Alert when a new blog post is published or an existing headline changes.",
156
+ "email": "alerts@example.com"
157
+ }
158
+ }
159
+ \`\`\`
160
+
161
+ **Multiple pages:**
162
+
163
+ \`\`\`json
164
+ {
165
+ "name": "firecrawl_monitor_create",
166
+ "arguments": {
167
+ "pages": ["https://example.com/pricing", "https://example.com/changelog"],
168
+ "goal": "Alert when pricing, packaging, or launch messaging changes.",
169
+ "webhookUrl": "https://example.com/webhooks/firecrawl"
81
170
  }
82
171
  }
83
172
  \`\`\`
@@ -91,6 +180,7 @@ Pass the full request body. Required fields: \`name\`, \`schedule\` (with \`cron
91
180
  "body": {
92
181
  "name": "Pricing watch",
93
182
  "schedule": { "text": "hourly", "timezone": "UTC" },
183
+ "goal": "Alert when a pricing tier, price, billing period, limit, or headline feature changes. Ignore unrelated marketing copy unless it changes the pricing offer.",
94
184
  "targets": [{
95
185
  "type": "scrape",
96
186
  "urls": ["https://example.com/pricing"],
@@ -126,10 +216,19 @@ Pass the full request body. Required fields: \`name\`, \`schedule\` (with \`cron
126
216
  **Mixed mode (JSON + git-diff):** Use \`modes: ["json", "git-diff"]\` to get both per-field diffs and a markdown sidecar. The page is marked \`changed\` whenever either surface changed.
127
217
  `,
128
218
  parameters: z.object({
129
- body: z.record(z.string(), z.any()),
219
+ body: z.record(z.string(), z.any()).optional(),
220
+ page: z.string().optional(),
221
+ pages: z.array(z.string()).optional(),
222
+ goal: z.string().optional(),
223
+ name: z.string().optional(),
224
+ scheduleText: z.string().optional(),
225
+ timezone: z.string().optional(),
226
+ email: z.string().optional(),
227
+ includeDiffs: z.boolean().optional(),
228
+ webhookUrl: z.string().optional(),
130
229
  }),
131
230
  execute: async (args, { session, log }) => {
132
- const { body } = args;
231
+ const body = buildMonitorCreateBody(args);
133
232
  log.info('Creating monitor', { name: body.name });
134
233
  const res = await monitorRequest(session, '/monitor', {
135
234
  method: 'POST',
@@ -195,7 +294,7 @@ Get a single monitor by ID.
195
294
  openWorldHint: true,
196
295
  },
197
296
  description: `
198
- Update a monitor. Pass any subset of fields to patch: \`name\`, \`status\` ("active" | "paused"), \`schedule\`, \`targets\`, \`webhook\`, \`notification\`, \`retentionDays\`.
297
+ Update a monitor. Pass any subset of fields to patch: \`name\`, \`status\` ("active" | "paused"), \`schedule\`, \`targets\`, \`goal\`, \`judgeEnabled\`, \`webhook\`, \`notification\`, \`retentionDays\`.
199
298
 
200
299
  **Usage Example:**
201
300
  \`\`\`json
@@ -276,17 +375,18 @@ List historical checks for a monitor.
276
375
 
277
376
  **Usage Example:**
278
377
  \`\`\`json
279
- { "name": "firecrawl_monitor_checks", "arguments": { "id": "mon_abc123", "limit": 10 } }
378
+ { "name": "firecrawl_monitor_checks", "arguments": { "id": "mon_abc123", "limit": 10, "status": "completed" } }
280
379
  \`\`\`
281
380
  `,
282
381
  parameters: z.object({
283
382
  id: z.string(),
284
383
  limit: z.number().int().positive().optional(),
285
384
  offset: z.number().int().nonnegative().optional(),
385
+ status: checkStatusSchema.optional(),
286
386
  }),
287
387
  execute: async (args, { session }) => {
288
- const { id, limit, offset } = args;
289
- const res = await monitorRequest(session, `/monitor/${encodeURIComponent(id)}/checks`, { query: { limit, offset } });
388
+ const { id, limit, offset, status } = args;
389
+ const res = await monitorRequest(session, `/monitor/${encodeURIComponent(id)}/checks`, { query: { limit, offset, status } });
290
390
  return asText(res);
291
391
  },
292
392
  });
@@ -300,7 +400,7 @@ List historical checks for a monitor.
300
400
  description: `
301
401
  Get a single check with page-level diff results. Filter \`pageStatus\` to surface only the pages that changed (or were new, removed, etc.).
302
402
 
303
- Each entry in \`data.pages[]\` has \`url\`, \`status\` (\`same\` | \`new\` | \`changed\` | \`removed\` | \`error\`), and — when changed — a \`diff\` and possibly a \`snapshot\`. The shape of \`diff\` depends on the monitor's \`formats\` configuration:
403
+ Each entry in \`data.pages[]\` has \`url\`, \`status\` (\`same\` | \`new\` | \`changed\` | \`removed\` | \`error\`), optional \`judgment\` when goal-based judging ran, and — when changed — a \`diff\` and possibly a \`snapshot\`. The shape of \`diff\` depends on the monitor's \`formats\` configuration:
304
404
 
305
405
  - **Markdown mode (default).** \`diff.text\` is the unified markdown diff; \`diff.json\` is a parse-diff AST (\`{ files: [...] }\`). No \`snapshot\`.
306
406
  - **JSON mode** (\`changeTracking\` with \`modes: ["json"]\`). \`diff.json\` is a per-field map keyed by JSON path into the extraction, e.g. \`plans[0].price\`, with each value being \`{ previous, current }\`. \`snapshot.json\` is the full current extraction. No \`diff.text\`.
@@ -318,12 +418,27 @@ Each entry in \`data.pages[]\` has \`url\`, \`status\` (\`same\` | \`new\` | \`c
318
418
  "plans[1].features[2]": { "previous": "10 GB storage", "current": "25 GB storage" }
319
419
  }
320
420
  },
321
- "snapshot": { "json": { "plans": [/* current full extraction matching the monitor's schema */] } }
421
+ "snapshot": { "json": { "plans": [/* current full extraction matching the monitor's schema */] } },
422
+ "judgment": {
423
+ "meaningful": true,
424
+ "confidence": "high",
425
+ "reason": "The pricing changed, which matches the monitor goal.",
426
+ "meaningfulChanges": [
427
+ {
428
+ "type": "changed",
429
+ "before": "$19/mo",
430
+ "after": "$24/mo",
431
+ "reason": "The tracked plan price changed."
432
+ }
433
+ ]
434
+ }
322
435
  }
323
436
  \`\`\`
324
437
 
325
438
  When summarizing a check for the user, prefer \`diff.json\` paths (e.g. "plans[0].price changed from $19/mo to $24/mo") over re-printing the markdown diff — it's more concise and grounded in the schema fields they asked for.
326
439
 
440
+ When \`judgment\` is present, use it to decide what to surface. \`judgment.meaningful: false\` means the change was classified as noise for the monitor's goal. When \`judgment.meaningfulChanges\` is present, prefer those goal-relevant changes over raw diff hunks; each item includes \`type\`, \`before\`, \`after\`, and \`reason\`.
441
+
327
442
  The endpoint paginates via a top-level \`next\` URL; this tool returns one page at a time. Increase \`limit\` (max 100) to fetch fewer pages.
328
443
 
329
444
  **Usage Example:**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl-mcp",
3
- "version": "3.18.0",
3
+ "version": "3.19.0",
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",