firecrawl-mcp 3.25.5 → 3.26.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 +78 -1
- package/dist/agent-hints.js +46 -0
- package/dist/index.js +447 -69
- package/dist/introspection-cache.js +67 -0
- package/package.json +15 -14
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/introspection-cache.ts
|
|
2
|
+
import { createHash } from "crypto";
|
|
3
|
+
function createIntrospectionCache(options) {
|
|
4
|
+
const now = options.now ?? Date.now;
|
|
5
|
+
const entries = /* @__PURE__ */ new Map();
|
|
6
|
+
const inflight = /* @__PURE__ */ new Map();
|
|
7
|
+
function store(key, value) {
|
|
8
|
+
const at = now();
|
|
9
|
+
const ttl = options.ttlMs(value, at);
|
|
10
|
+
if (!(ttl > 0)) return;
|
|
11
|
+
entries.delete(key);
|
|
12
|
+
entries.set(key, { expiresAt: at + ttl, value });
|
|
13
|
+
while (entries.size > options.maxEntries) {
|
|
14
|
+
const oldest = entries.keys().next().value;
|
|
15
|
+
if (oldest === void 0) break;
|
|
16
|
+
entries.delete(oldest);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
async get(parts, load) {
|
|
21
|
+
const key = createHash("sha256").update(parts.join("\0")).digest("hex");
|
|
22
|
+
const hit = entries.get(key);
|
|
23
|
+
if (hit) {
|
|
24
|
+
entries.delete(key);
|
|
25
|
+
if (hit.expiresAt > now()) {
|
|
26
|
+
entries.set(key, hit);
|
|
27
|
+
return hit.value;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const pending = inflight.get(key);
|
|
31
|
+
if (pending) return pending;
|
|
32
|
+
const request = load().then(
|
|
33
|
+
(value) => {
|
|
34
|
+
inflight.delete(key);
|
|
35
|
+
store(key, value);
|
|
36
|
+
return value;
|
|
37
|
+
},
|
|
38
|
+
(error) => {
|
|
39
|
+
inflight.delete(key);
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
inflight.set(key, request);
|
|
44
|
+
return request;
|
|
45
|
+
},
|
|
46
|
+
clear() {
|
|
47
|
+
entries.clear();
|
|
48
|
+
},
|
|
49
|
+
get size() {
|
|
50
|
+
return entries.size;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
var INTROSPECTION_ACTIVE_TTL_MS = 6e4;
|
|
55
|
+
var INTROSPECTION_INACTIVE_TTL_MS = 1e4;
|
|
56
|
+
function introspectionTtlMs(value, now, activeTtlMs = INTROSPECTION_ACTIVE_TTL_MS, inactiveTtlMs = INTROSPECTION_INACTIVE_TTL_MS) {
|
|
57
|
+
if (!value.active) return inactiveTtlMs;
|
|
58
|
+
if (value.exp === void 0) return activeTtlMs;
|
|
59
|
+
if (typeof value.exp !== "number" || !Number.isFinite(value.exp)) return 0;
|
|
60
|
+
return Math.min(activeTtlMs, value.exp * 1e3 - now);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
INTROSPECTION_ACTIVE_TTL_MS,
|
|
64
|
+
INTROSPECTION_INACTIVE_TTL_MS,
|
|
65
|
+
createIntrospectionCache,
|
|
66
|
+
introspectionTtlMs
|
|
67
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "firecrawl-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.26.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",
|
|
@@ -13,11 +13,23 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "rm -rf dist && tsup && node -e \"require('fs').chmodSync('dist/index.js', '755')\"",
|
|
18
|
+
"test": "npm run build && node --test --test-concurrency=1 tests/*.test.mjs",
|
|
19
|
+
"start": "node dist/index.js",
|
|
20
|
+
"start:cloud": "CLOUD_SERVICE=true node dist/index.js",
|
|
21
|
+
"lint": "eslint src/**/*.ts",
|
|
22
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
23
|
+
"format": "prettier --write .",
|
|
24
|
+
"prepare": "npm run build",
|
|
25
|
+
"publish-prod": "npm run build && npm publish",
|
|
26
|
+
"publish-beta": "npm run build && npm publish --tag beta"
|
|
27
|
+
},
|
|
16
28
|
"license": "MIT",
|
|
17
29
|
"dependencies": {
|
|
18
30
|
"dotenv": "^17.2.2",
|
|
19
31
|
"fastmcp": "4.3.2",
|
|
20
|
-
"firecrawl": "4.
|
|
32
|
+
"firecrawl": "4.42.0",
|
|
21
33
|
"zod": "^4.2.1"
|
|
22
34
|
},
|
|
23
35
|
"engines": {
|
|
@@ -53,16 +65,5 @@
|
|
|
53
65
|
"eslint-config-prettier": "10.1.8",
|
|
54
66
|
"tsup": "^8.5.0",
|
|
55
67
|
"typescript": "^5.9.2"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"build": "rm -rf dist && tsup && node -e \"require('fs').chmodSync('dist/index.js', '755')\"",
|
|
59
|
-
"test": "npm run build && node --test tests/*.test.mjs",
|
|
60
|
-
"start": "node dist/index.js",
|
|
61
|
-
"start:cloud": "CLOUD_SERVICE=true node dist/index.js",
|
|
62
|
-
"lint": "eslint src/**/*.ts",
|
|
63
|
-
"lint:fix": "eslint src/**/*.ts --fix",
|
|
64
|
-
"format": "prettier --write .",
|
|
65
|
-
"publish-prod": "npm run build && npm publish",
|
|
66
|
-
"publish-beta": "npm run build && npm publish --tag beta"
|
|
67
68
|
}
|
|
68
|
-
}
|
|
69
|
+
}
|