@cyanheads/biorxiv-mcp-server 0.2.0 → 0.2.2

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 (38) hide show
  1. package/AGENTS.md +5 -5
  2. package/CLAUDE.md +5 -5
  3. package/Dockerfile +1 -1
  4. package/README.md +10 -4
  5. package/changelog/0.2.x/0.2.1.md +30 -0
  6. package/changelog/0.2.x/0.2.2.md +21 -0
  7. package/dist/config/server-config.d.ts +5 -4
  8. package/dist/config/server-config.d.ts.map +1 -1
  9. package/dist/config/server-config.js +12 -11
  10. package/dist/config/server-config.js.map +1 -1
  11. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts +24 -6
  12. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts.map +1 -1
  13. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js +77 -23
  14. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts +17 -2
  16. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js +56 -37
  18. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts +17 -2
  20. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js +41 -10
  22. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts +18 -2
  24. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js +104 -23
  26. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts +2 -2
  28. package/dist/mcp-server/tools/definitions/index.d.ts +54 -9
  29. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  30. package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -1
  31. package/dist/services/biorxiv/biorxiv-service.js.map +1 -1
  32. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts +29 -7
  33. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts.map +1 -1
  34. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js +136 -14
  35. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js.map +1 -1
  36. package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
  37. package/package.json +15 -9
  38. package/server.json +31 -3
@@ -5,9 +5,20 @@
5
5
  *
6
6
  * This is a DISTINCT fetch path from BiorxivApiService: it EXPECTS an HTML
7
7
  * document (the rendered article page), so it never routes through the JSON
8
- * API's "HTML response = upstream error" guard. Cloudflare challenge/block pages
9
- * and empty extractions are surfaced as a typed `unavailable` result rather than
10
- * crashing or feeding interstitial garbage to the extractor.
8
+ * API's "HTML response = upstream error" guard. Cloudflare challenge/block pages,
9
+ * origin rate limiting (HTTP 429), and empty extractions are surfaced as a typed
10
+ * `unavailable` result rather than crashing or feeding interstitial garbage to
11
+ * the extractor.
12
+ *
13
+ * Extracted articles are cached in `ctx.state` under
14
+ * `fulltext/v1/{server}/{doi}/{version}` for {@link FULLTEXT_CACHE_TTL_SECONDS}
15
+ * seconds, so paging a long article with offset/limit costs one origin fetch and
16
+ * one extraction instead of one per chunk. `ctx.state` is tenant-scoped, which is
17
+ * the intended blast radius — no cross-tenant or process-wide sharing. Only
18
+ * `kind: 'article'` results are written: a blocked, rate-limited, or empty page
19
+ * must be able to recover on a later call. The cache is an optimization and never
20
+ * a dependency — a storage backend that refuses a read or a write degrades to an
21
+ * origin fetch instead of failing the caller.
11
22
  * @module services/biorxiv-fulltext/biorxiv-fulltext-service
12
23
  */
13
24
  import { McpError } from '@cyanheads/mcp-ts-core/errors';
@@ -31,6 +42,58 @@ const FULLTEXT_CONTENT_SELECTOR = '.fulltext-view';
31
42
  * is what medRxiv's Cloudflare edge returns for programmatic access.
32
43
  */
33
44
  const DETERMINISTIC_UNAVAILABLE_STATUSES = new Set([401, 403, 404, 410, 451]);
45
+ /**
46
+ * Statuses this service classifies itself rather than treating as a bug — the
47
+ * deterministic set plus 429, which becomes a `rate_limited` result. Passing them
48
+ * to `fetchWithTimeout` only lowers the log severity from `error` to `debug`; the
49
+ * thrown error and its classification are unchanged.
50
+ */
51
+ const EXPECTED_STATUSES = [...DETERMINISTIC_UNAVAILABLE_STATUSES, 429];
52
+ /**
53
+ * Lifetime of a cached extraction. A published version's rendered page is
54
+ * effectively immutable (a revision gets a new version, hence a new cache key),
55
+ * so this only bounds how long a re-render or a corrected page goes unseen. An
56
+ * hour comfortably covers paging through even the longest article.
57
+ */
58
+ const FULLTEXT_CACHE_TTL_SECONDS = 3_600;
59
+ /**
60
+ * Cache key: `fulltext/v1/{server}/{doi}/{version}`. Slash-delimited because the
61
+ * storage layer validates keys against `[a-zA-Z0-9_.\-/]` — a colon separator is
62
+ * rejected outright, and a DOI's own `/` and `.` are already inside the allowed
63
+ * set. The `v1` segment is the cached-value schema generation — bump it when
64
+ * {@link CachedArticle} changes so entries written by an older build are never
65
+ * read back under the new shape.
66
+ */
67
+ const cacheKeyFor = (server, doi, version) => `fulltext/v1/${server}/${doi}/${version}`;
68
+ /**
69
+ * Reads a cached extraction, treating any storage failure as a miss. A key the
70
+ * backend rejects, an unreachable provider, or an in-memory store at capacity
71
+ * must cost an origin fetch, not the caller's request.
72
+ */
73
+ async function readCachedArticle(ctx, key) {
74
+ try {
75
+ return (await ctx.state.get(key)) ?? undefined;
76
+ }
77
+ catch (err) {
78
+ ctx.log.warning('Full-text cache read failed — falling through to the origin', {
79
+ key,
80
+ error: err instanceof Error ? err.message : String(err),
81
+ });
82
+ return;
83
+ }
84
+ }
85
+ /** Writes an extraction to the cache; a storage failure only costs the next page a refetch. */
86
+ async function writeCachedArticle(ctx, key, article) {
87
+ try {
88
+ await ctx.state.set(key, article, { ttl: FULLTEXT_CACHE_TTL_SECONDS });
89
+ }
90
+ catch (err) {
91
+ ctx.log.warning('Full-text cache write failed — the next page will refetch the origin', {
92
+ key,
93
+ error: err instanceof Error ? err.message : String(err),
94
+ });
95
+ }
96
+ }
34
97
  /**
35
98
  * Markers unique to Cloudflare's interstitial / block pages. Deliberately narrow:
36
99
  * a genuine bioRxiv article page references `cloudflare-static/email-decode.min.js`
@@ -49,6 +112,24 @@ const CHALLENGE_MARKERS = [
49
112
  function isChallengePage(html) {
50
113
  return CHALLENGE_MARKERS.some((marker) => html.includes(marker));
51
114
  }
115
+ /**
116
+ * Reads a `Retry-After` header value as a wait in whole seconds. RFC 9110 §10.2.3
117
+ * allows either delta-seconds or an HTTP-date; the date form is converted to a
118
+ * wait from now and clamped at zero. Returns undefined for an absent, malformed,
119
+ * or unparseable value so callers fall back to generic wording rather than
120
+ * echoing an uninterpretable header into agent-facing prose.
121
+ */
122
+ function parseRetryAfterSeconds(raw) {
123
+ if (typeof raw !== 'string')
124
+ return;
125
+ const trimmed = raw.trim();
126
+ if (/^\d+$/.test(trimmed))
127
+ return Number(trimmed);
128
+ const dateMs = Date.parse(trimmed);
129
+ if (Number.isNaN(dateMs))
130
+ return;
131
+ return Math.max(0, Math.round((dateMs - Date.now()) / 1000));
132
+ }
52
133
  export class BiorxivFullTextService {
53
134
  webBaseUrls;
54
135
  userAgent;
@@ -67,20 +148,36 @@ export class BiorxivFullTextService {
67
148
  *
68
149
  * Resolves to `{ kind: 'article', markdown, ... }` on success, or
69
150
  * `{ kind: 'unavailable', reason }` when the page is blocked (Cloudflare 403 /
70
- * challenge), missing, or yields no extractable text (PDF-only preprints).
71
- * Transient failures (5xx, timeout, network) bubble as `ServiceUnavailable`
72
- * after retry so the framework classifies them as retryable.
151
+ * challenge), rate-limited (429), missing, or yields no extractable text
152
+ * (PDF-only preprints). Transient failures (5xx, timeout, network) bubble as
153
+ * `ServiceUnavailable` after retry so the framework classifies them as retryable.
154
+ *
155
+ * A successful extraction is served from the tenant-scoped `ctx.state` cache on
156
+ * subsequent calls for the same server/DOI/version, so offset paging does not
157
+ * refetch the origin per chunk.
73
158
  */
74
159
  async fetchFullText(server, doi, version, ctx) {
75
160
  const encodedDoi = doi.split('/').map(encodeURIComponent).join('/');
76
161
  const sourceUrl = `${this.webBaseUrls[server]}/content/${encodedDoi}v${version}.full`;
77
162
  const rc = asRc(ctx);
163
+ // ctx.state is tenant-scoped and throws without a tenant (HTTP + JWT whose
164
+ // token carries no `tid` claim), so a tenant-less caller runs uncached rather
165
+ // than losing full-text retrieval entirely.
166
+ const cacheKey = ctx.tenantId === undefined ? undefined : cacheKeyFor(server, doi, version);
167
+ if (cacheKey) {
168
+ const cached = await readCachedArticle(ctx, cacheKey);
169
+ if (cached) {
170
+ ctx.log.debug('Serving full text from cache', { cacheKey, sourceUrl });
171
+ return { kind: 'article', ...cached };
172
+ }
173
+ }
78
174
  let html;
79
175
  try {
80
176
  html = await withRetry(async () => {
81
177
  const response = await fetchWithTimeout(sourceUrl, 30_000, rc, {
82
178
  signal: ctx.signal,
83
179
  headers: { 'User-Agent': this.userAgent, Accept: 'text/html' },
180
+ expectedStatuses: EXPECTED_STATUSES,
84
181
  });
85
182
  return await response.text();
86
183
  }, {
@@ -91,13 +188,34 @@ export class BiorxivFullTextService {
91
188
  });
92
189
  }
93
190
  catch (err) {
94
- // fetchWithTimeout throws on non-2xx with data.statusCode set. Deterministic
95
- // access failures (403 block, 404 missing) become an `unavailable` result;
96
- // transient codes (5xx / timeout / network) bubble unchanged as ServiceUnavailable.
97
- const status = err instanceof McpError &&
98
- typeof err.data?.statusCode === 'number'
99
- ? err.data.statusCode
191
+ // fetchWithTimeout throws on non-2xx with data.status set. Deterministic
192
+ // access failures (403 block, 404 missing) and origin rate limiting (429)
193
+ // become an `unavailable` result; transient codes (5xx / timeout / network)
194
+ // bubble unchanged as ServiceUnavailable.
195
+ const errData = err instanceof McpError
196
+ ? err.data
100
197
  : undefined;
198
+ const status = typeof errData?.status === 'number' ? errData.status : undefined;
199
+ if (status === 429) {
200
+ // Only the parsed Retry-After crosses into the result — err.data also
201
+ // carries the origin's block-page HTML (body/responseBody), which must
202
+ // never reach the client payload.
203
+ const retryAfter = parseRetryAfterSeconds(errData?.retryAfter);
204
+ ctx.log.info('Full-text origin rate-limited the request', {
205
+ sourceUrl,
206
+ status,
207
+ ...(retryAfter !== undefined && { retryAfter }),
208
+ });
209
+ return {
210
+ kind: 'unavailable',
211
+ reason: 'rate_limited',
212
+ detail: retryAfter === undefined
213
+ ? 'The full-text origin is rate-limiting this host (HTTP 429).'
214
+ : `The full-text origin is rate-limiting this host (HTTP 429) and asked for a ${retryAfter}-second wait before the next request.`,
215
+ ...(retryAfter !== undefined && { retryAfter }),
216
+ sourceUrl,
217
+ };
218
+ }
101
219
  if (status !== undefined && DETERMINISTIC_UNAVAILABLE_STATUSES.has(status)) {
102
220
  ctx.log.info('Full-text HTML page unavailable', { sourceUrl, status });
103
221
  return {
@@ -134,13 +252,17 @@ export class BiorxivFullTextService {
134
252
  sourceUrl,
135
253
  };
136
254
  }
137
- return {
138
- kind: 'article',
255
+ const article = {
139
256
  markdown,
140
257
  ...(extracted.title && { title: extracted.title }),
141
258
  ...(typeof extracted.wordCount === 'number' && { wordCount: extracted.wordCount }),
142
259
  sourceUrl,
143
260
  };
261
+ // Success path only — an unavailable result must recover on a later call.
262
+ if (cacheKey) {
263
+ await writeCachedArticle(ctx, cacheKey, article);
264
+ }
265
+ return { kind: 'article', ...article };
144
266
  }
145
267
  }
146
268
  // ─── Init / accessor ─────────────────────────────────────────────────────────
@@ -1 +1 @@
1
- {"version":3,"file":"biorxiv-fulltext-service.js","sourceRoot":"","sources":["../../../src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AAS,CAAS;IAEnC,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAMvD;IAED;;;;;OAKG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAwFjF;CACF;AAMD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAErF;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,CAItD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyanheads/biorxiv-mcp-server",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "mcpName": "io.github.cyanheads/biorxiv-mcp-server",
5
5
  "description": "Search and retrieve bioRxiv and medRxiv preprints — by DOI, date interval, or keyword — via MCP. STDIO or Streamable HTTP.",
6
6
  "type": "module",
@@ -86,21 +86,27 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
+ "overrides": {
90
+ "fast-uri": "^3.1.5",
91
+ "ip-address": "^10.3.1",
92
+ "js-yaml": "^3.15.1",
93
+ "postcss": "^8.5.23"
94
+ },
89
95
  "dependencies": {
90
- "@cyanheads/mcp-ts-core": "^0.10.14",
91
- "defuddle": "^0.19.0",
92
- "linkedom": "^0.18.12",
96
+ "@cyanheads/mcp-ts-core": "^0.11.1",
97
+ "defuddle": "^0.19.2",
98
+ "linkedom": "^0.18.13",
93
99
  "pino-pretty": "^13.1.3",
94
100
  "zod": "^4.4.3"
95
101
  },
96
102
  "devDependencies": {
97
- "@biomejs/biome": "2.5.2",
103
+ "@biomejs/biome": "2.5.7",
98
104
  "@socketsecurity/bun-security-scanner": "^1.1.2",
99
- "@types/node": "26.1.0",
105
+ "@types/node": "26.1.2",
100
106
  "depcheck": "^1.4.7",
101
- "ignore": "^7.0.5",
102
- "tsc-alias": "^1.9.0",
103
- "typescript": "^6.0.3",
107
+ "ignore": "^7.0.6",
108
+ "tsc-alias": "^1.9.1",
109
+ "typescript": "^7.0.2",
104
110
  "vitest": "^4.1.10"
105
111
  }
106
112
  }
package/server.json CHANGED
@@ -6,14 +6,14 @@
6
6
  "url": "https://github.com/cyanheads/biorxiv-mcp-server",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.2.0",
9
+ "version": "0.2.2",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "registryBaseUrl": "https://registry.npmjs.org",
14
14
  "identifier": "@cyanheads/biorxiv-mcp-server",
15
15
  "runtimeHint": "bun",
16
- "version": "0.2.0",
16
+ "version": "0.2.2",
17
17
  "packageArguments": [
18
18
  {
19
19
  "type": "positional",
@@ -31,6 +31,20 @@
31
31
  "format": "string",
32
32
  "isRequired": false
33
33
  },
34
+ {
35
+ "name": "BIORXIV_WEB_BASE_URL",
36
+ "description": "bioRxiv website base URL \u2014 source of rendered full-text HTML pages for biorxiv_get_fulltext.",
37
+ "format": "string",
38
+ "isRequired": false,
39
+ "default": "https://www.biorxiv.org"
40
+ },
41
+ {
42
+ "name": "MEDRXIV_WEB_BASE_URL",
43
+ "description": "medRxiv website base URL \u2014 source of rendered full-text HTML pages for biorxiv_get_fulltext.",
44
+ "format": "string",
45
+ "isRequired": false,
46
+ "default": "https://www.medrxiv.org"
47
+ },
34
48
  {
35
49
  "name": "MCP_LOG_LEVEL",
36
50
  "description": "Sets the minimum log level for output (e.g., 'debug', 'info', 'warn').",
@@ -48,7 +62,7 @@
48
62
  "registryBaseUrl": "https://registry.npmjs.org",
49
63
  "identifier": "@cyanheads/biorxiv-mcp-server",
50
64
  "runtimeHint": "bun",
51
- "version": "0.2.0",
65
+ "version": "0.2.2",
52
66
  "packageArguments": [
53
67
  {
54
68
  "type": "positional",
@@ -66,6 +80,20 @@
66
80
  "format": "string",
67
81
  "isRequired": false
68
82
  },
83
+ {
84
+ "name": "BIORXIV_WEB_BASE_URL",
85
+ "description": "bioRxiv website base URL \u2014 source of rendered full-text HTML pages for biorxiv_get_fulltext.",
86
+ "format": "string",
87
+ "isRequired": false,
88
+ "default": "https://www.biorxiv.org"
89
+ },
90
+ {
91
+ "name": "MEDRXIV_WEB_BASE_URL",
92
+ "description": "medRxiv website base URL \u2014 source of rendered full-text HTML pages for biorxiv_get_fulltext.",
93
+ "format": "string",
94
+ "isRequired": false,
95
+ "default": "https://www.medrxiv.org"
96
+ },
69
97
  {
70
98
  "name": "MCP_HTTP_HOST",
71
99
  "description": "The hostname for the HTTP server.",