firecrawl-mcp 3.29.1 → 3.30.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.
- package/README.md +9 -48
- package/dist/index.js +57 -227
- package/dist/server.d.ts +28 -6
- package/dist/server.js +50 -223
- package/package.json +1 -1
- package/dist/agent-hints.js +0 -46
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firecrawl-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.0",
|
|
4
4
|
"description": "MCP server for Firecrawl — search, scrape, and interact with the web, and search scientific papers. Supports both cloud and self-hosted instances. Features include web search, scraping, page interaction, batch processing, LLM-powered content analysis, and research paper search over biomedical and arXiv literature (PubMed, bioRxiv, medRxiv, arXiv) with citation-graph expansion and full-text reading.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"mcpName": "io.github.firecrawl/firecrawl-mcp-server",
|
package/dist/agent-hints.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// src/agent-hints.ts
|
|
2
|
-
var AGENT_HINTS_HEADERS = { "X-Firecrawl-Agent-Hints": "true" };
|
|
3
|
-
function readAgentHints(value) {
|
|
4
|
-
if (!value || typeof value !== "object") return void 0;
|
|
5
|
-
const hints = value.agent_hints;
|
|
6
|
-
return Array.isArray(hints) && hints.every((hint) => typeof hint === "string") ? hints : void 0;
|
|
7
|
-
}
|
|
8
|
-
function preserveAgentHints(data, envelope) {
|
|
9
|
-
const hints = readAgentHints(envelope);
|
|
10
|
-
if (!hints) return data;
|
|
11
|
-
return data && typeof data === "object" && !Array.isArray(data) ? { ...data, agent_hints: hints } : { data, agent_hints: hints };
|
|
12
|
-
}
|
|
13
|
-
function agentHintsText(hints) {
|
|
14
|
-
return `Firecrawl API agent_hints (response guidance, separate from page content):
|
|
15
|
-
${JSON.stringify(hints, null, 2)}`;
|
|
16
|
-
}
|
|
17
|
-
function withAgentHints(result, response, separateText = false) {
|
|
18
|
-
const hints = readAgentHints(response);
|
|
19
|
-
if (!hints) return result;
|
|
20
|
-
return {
|
|
21
|
-
...result,
|
|
22
|
-
content: separateText && hints.length ? [...result.content, { type: "text", text: agentHintsText(hints) }] : result.content,
|
|
23
|
-
structuredContent: { ...result.structuredContent, agent_hints: hints }
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
function readErrorAgentHints(error) {
|
|
27
|
-
const hints = readAgentHints(error);
|
|
28
|
-
if (hints) return hints;
|
|
29
|
-
if (!error || typeof error !== "object") return void 0;
|
|
30
|
-
const extras = error.extras;
|
|
31
|
-
const extrasHints = readAgentHints(extras);
|
|
32
|
-
if (extrasHints) return extrasHints;
|
|
33
|
-
const details = error.details;
|
|
34
|
-
const detailsHints = readAgentHints(details);
|
|
35
|
-
if (detailsHints) return detailsHints;
|
|
36
|
-
const response = error.response;
|
|
37
|
-
return readAgentHints(response?.data);
|
|
38
|
-
}
|
|
39
|
-
export {
|
|
40
|
-
AGENT_HINTS_HEADERS,
|
|
41
|
-
agentHintsText,
|
|
42
|
-
preserveAgentHints,
|
|
43
|
-
readAgentHints,
|
|
44
|
-
readErrorAgentHints,
|
|
45
|
-
withAgentHints
|
|
46
|
-
};
|