@cyanheads/biorxiv-mcp-server 0.2.7 → 0.2.8

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 (49) hide show
  1. package/AGENTS.md +7 -6
  2. package/CLAUDE.md +7 -6
  3. package/README.md +11 -7
  4. package/changelog/0.2.x/0.2.7.md +3 -2
  5. package/changelog/0.2.x/0.2.8.md +26 -0
  6. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts +18 -5
  7. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts.map +1 -1
  8. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js +87 -33
  9. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js.map +1 -1
  10. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts +4 -2
  11. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts.map +1 -1
  12. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js +19 -12
  13. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js.map +1 -1
  14. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts +19 -9
  15. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts.map +1 -1
  16. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js +125 -40
  17. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js.map +1 -1
  18. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.js +1 -1
  19. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.js.map +1 -1
  20. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts +5 -2
  21. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js +74 -47
  23. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js.map +1 -1
  24. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts +12 -1
  25. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts.map +1 -1
  26. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js +31 -6
  27. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js.map +1 -1
  28. package/dist/mcp-server/tools/definitions/index.d.ts +30 -11
  29. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  30. package/dist/services/biorxiv/biorxiv-service.d.ts +27 -4
  31. package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -1
  32. package/dist/services/biorxiv/biorxiv-service.js +104 -46
  33. package/dist/services/biorxiv/biorxiv-service.js.map +1 -1
  34. package/dist/services/biorxiv/types.d.ts +5 -0
  35. package/dist/services/biorxiv/types.d.ts.map +1 -1
  36. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts +5 -2
  37. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts.map +1 -1
  38. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js +5 -6
  39. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js.map +1 -1
  40. package/dist/services/europe-pmc/europe-pmc-service.d.ts +7 -3
  41. package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
  42. package/dist/services/europe-pmc/europe-pmc-service.js +54 -12
  43. package/dist/services/europe-pmc/europe-pmc-service.js.map +1 -1
  44. package/dist/services/shared.d.ts +23 -1
  45. package/dist/services/shared.d.ts.map +1 -1
  46. package/dist/services/shared.js +45 -1
  47. package/dist/services/shared.js.map +1 -1
  48. package/package.json +4 -4
  49. package/server.json +3 -3
package/AGENTS.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** biorxiv-mcp-server
4
- **Version:** 0.2.7
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.5`
4
+ **Version:** 0.2.8
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
8
8
  **Zod:** ^4.6.5
@@ -144,7 +144,7 @@ Handlers receive a unified `ctx` object. Key properties:
144
144
 
145
145
  Handlers throw — the framework catches, classifies, and formats.
146
146
 
147
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive a typed `ctx.fail(reason, …)` keyed by the declared reason union. TypeScript catches `ctx.fail('typo')` at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. The `recovery` field is required (≥ 5 words, lint-validated). Spread `ctx.recoveryFor('reason')` into `data` to mirror the contract recovery onto the wire (`data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim). Every declared reason must be named by a literal `ctx.fail('<reason>'` or `ctx.recoveryFor('<reason>')` in its handler — `lint:mcp`'s `error-contract-unthrown` flags one that isn't. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
147
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive a typed `ctx.fail(reason, …)` keyed by the declared reason union. TypeScript catches `ctx.fail('typo')` at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. The `recovery` field is required (≥ 5 words, lint-validated). Spread `ctx.recoveryFor('reason')` into `data` to mirror the contract recovery onto the wire (`data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim), or pass an explicit `recovery: { hint }` when the hint needs runtime context (a computed wait). Forwarding is lint-enforced per throw site — a `ctx.fail` carrying neither warns as `error-contract-recovery-unforwarded`. Every declared reason must be named by a literal `ctx.fail('<reason>'` or `ctx.recoveryFor('<reason>')` in its handler — `lint:mcp`'s `error-contract-unthrown` flags one that isn't; mark an entry the service layer throws with `thrownBy: 'service'` (lint-only metadata) instead. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
148
148
 
149
149
  ```ts
150
150
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -187,7 +187,7 @@ src/
187
187
  config/
188
188
  server-config.ts # bioRxiv-specific env vars (BIORXIV_MAILTO, API base URLs)
189
189
  services/
190
- shared.ts # Shared utilities (detectHtmlError, normalizeUpstreamText,
190
+ shared.ts # Shared utilities (detectHtmlError, normalizeDoi, normalizeUpstreamText,
191
191
  # isValidCalendarDate, parseRetryAfterSeconds, findRateLimit, describeWait,
192
192
  # SERVER_VERSION)
193
193
  biorxiv/
@@ -223,7 +223,8 @@ src/
223
223
 
224
224
  ## Domain Conventions
225
225
 
226
- - **DOI format:** `10.1101/YYYY.MM.DD.NNNNNN`. Validate on input — the bioRxiv API returns empty collections for malformed DOIs without an error code.
226
+ - **DOI format:** `10.1101/YYYY.MM.DD.NNNNNN` or `10.64898/…`. Run every DOI input through `normalizeDoi()` (`src/services/shared.ts`), which strips doi.org/article URLs, `doi:`, and `vN`/`.full` suffixes and returns `undefined` for anything still malformed — the bioRxiv API returns empty collections for malformed DOIs without an error code. `/pubs` keyed by preprint DOI never parses a `10.64898/` DOI; see `getPublishedVersionByJournalDoi()`.
227
+ - **Category spelling:** the listing API filters only on lowercase with `/` and `_` read as a space (`hiv aids`), and answers anything else with its unfiltered listing, echoing `messages[0].category: "all"`. `BiorxivApiService` owns the spelling and flags `categoryIgnored`; never present a flagged page as filtered.
227
228
  - **Server parameter:** `"biorxiv" | "medrxiv" | "both"`. Default to `"both"`, including for DOI-resolution tools — both servers issue `10.1101/` DOIs, so the DOI never identifies the server and a single-server default silently misses records held by the other. Fan out via `Promise.allSettled` when `"both"` and name the answering server in the output.
228
229
  - **Pagination:** integer `cursor` offset (0, 30, 60, …). Page size is fixed at 30 by the API — do not expose a `limit` parameter.
229
230
  - **Two-server pagination:** when `server="both"`, surface per-server state: `{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`. A merged cursor is ambiguous.
@@ -382,7 +383,7 @@ import { getEuropePmcService } from '@/services/europe-pmc/europe-pmc-service.js
382
383
  - [ ] bioRxiv API wrapping: normalization and `format()` preserve uncertainty; do not fabricate facts from missing upstream data (e.g., `published` field may be `"NA"` — surface it as absent, not empty)
383
384
  - [ ] bioRxiv API wrapping: tests include at least one sparse payload case with omitted upstream fields
384
385
  - [ ] `BIORXIV_MAILTO` included in outbound User-Agent header when set (optional env var)
385
- - [ ] DOI format validated on input (`10.1101/` prefix check) before calling API
386
+ - [ ] DOI input normalized and validated with `normalizeDoi()` before calling API
386
387
  - [ ] Two-server fan-out uses `Promise.allSettled`; partial failures reported per-DOI in `failed[]`
387
388
  - [ ] `biorxiv_list_recent` with `server="both"` surfaces per-server pagination state, not a merged cursor
388
389
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
package/CLAUDE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Agent Protocol
2
2
 
3
3
  **Server:** biorxiv-mcp-server
4
- **Version:** 0.2.7
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.5`
4
+ **Version:** 0.2.8
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
6
6
  **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
8
8
  **Zod:** ^4.6.5
@@ -144,7 +144,7 @@ Handlers receive a unified `ctx` object. Key properties:
144
144
 
145
145
  Handlers throw — the framework catches, classifies, and formats.
146
146
 
147
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive a typed `ctx.fail(reason, …)` keyed by the declared reason union. TypeScript catches `ctx.fail('typo')` at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. The `recovery` field is required (≥ 5 words, lint-validated). Spread `ctx.recoveryFor('reason')` into `data` to mirror the contract recovery onto the wire (`data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim). Every declared reason must be named by a literal `ctx.fail('<reason>'` or `ctx.recoveryFor('<reason>')` in its handler — `lint:mcp`'s `error-contract-unthrown` flags one that isn't. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
147
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` on `tool()` / `resource()` to receive a typed `ctx.fail(reason, …)` keyed by the declared reason union. TypeScript catches `ctx.fail('typo')` at compile time, `data.reason` is auto-populated for observability, and the linter enforces conformance against the handler body. The `recovery` field is required (≥ 5 words, lint-validated). Spread `ctx.recoveryFor('reason')` into `data` to mirror the contract recovery onto the wire (`data.recovery.hint`, mirrored into `content[]` text unless the message already contains it verbatim), or pass an explicit `recovery: { hint }` when the hint needs runtime context (a computed wait). Forwarding is lint-enforced per throw site — a `ctx.fail` carrying neither warns as `error-contract-recovery-unforwarded`. Every declared reason must be named by a literal `ctx.fail('<reason>'` or `ctx.recoveryFor('<reason>')` in its handler — `lint:mcp`'s `error-contract-unthrown` flags one that isn't; mark an entry the service layer throws with `thrownBy: 'service'` (lint-only metadata) instead. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
148
148
 
149
149
  ```ts
150
150
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -187,7 +187,7 @@ src/
187
187
  config/
188
188
  server-config.ts # bioRxiv-specific env vars (BIORXIV_MAILTO, API base URLs)
189
189
  services/
190
- shared.ts # Shared utilities (detectHtmlError, normalizeUpstreamText,
190
+ shared.ts # Shared utilities (detectHtmlError, normalizeDoi, normalizeUpstreamText,
191
191
  # isValidCalendarDate, parseRetryAfterSeconds, findRateLimit, describeWait,
192
192
  # SERVER_VERSION)
193
193
  biorxiv/
@@ -223,7 +223,8 @@ src/
223
223
 
224
224
  ## Domain Conventions
225
225
 
226
- - **DOI format:** `10.1101/YYYY.MM.DD.NNNNNN`. Validate on input — the bioRxiv API returns empty collections for malformed DOIs without an error code.
226
+ - **DOI format:** `10.1101/YYYY.MM.DD.NNNNNN` or `10.64898/…`. Run every DOI input through `normalizeDoi()` (`src/services/shared.ts`), which strips doi.org/article URLs, `doi:`, and `vN`/`.full` suffixes and returns `undefined` for anything still malformed — the bioRxiv API returns empty collections for malformed DOIs without an error code. `/pubs` keyed by preprint DOI never parses a `10.64898/` DOI; see `getPublishedVersionByJournalDoi()`.
227
+ - **Category spelling:** the listing API filters only on lowercase with `/` and `_` read as a space (`hiv aids`), and answers anything else with its unfiltered listing, echoing `messages[0].category: "all"`. `BiorxivApiService` owns the spelling and flags `categoryIgnored`; never present a flagged page as filtered.
227
228
  - **Server parameter:** `"biorxiv" | "medrxiv" | "both"`. Default to `"both"`, including for DOI-resolution tools — both servers issue `10.1101/` DOIs, so the DOI never identifies the server and a single-server default silently misses records held by the other. Fan out via `Promise.allSettled` when `"both"` and name the answering server in the output.
228
229
  - **Pagination:** integer `cursor` offset (0, 30, 60, …). Page size is fixed at 30 by the API — do not expose a `limit` parameter.
229
230
  - **Two-server pagination:** when `server="both"`, surface per-server state: `{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`. A merged cursor is ambiguous.
@@ -382,7 +383,7 @@ import { getEuropePmcService } from '@/services/europe-pmc/europe-pmc-service.js
382
383
  - [ ] bioRxiv API wrapping: normalization and `format()` preserve uncertainty; do not fabricate facts from missing upstream data (e.g., `published` field may be `"NA"` — surface it as absent, not empty)
383
384
  - [ ] bioRxiv API wrapping: tests include at least one sparse payload case with omitted upstream fields
384
385
  - [ ] `BIORXIV_MAILTO` included in outbound User-Agent header when set (optional env var)
385
- - [ ] DOI format validated on input (`10.1101/` prefix check) before calling API
386
+ - [ ] DOI input normalized and validated with `normalizeDoi()` before calling API
386
387
  - [ ] Two-server fan-out uses `Promise.allSettled`; partial failures reported per-DOI in `failed[]`
387
388
  - [ ] `biorxiv_list_recent` with `server="both"` surfaces per-server pagination state, not a merged cursor
388
389
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.2.7-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/biorxiv-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/biorxiv-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/biorxiv-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.2.8-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/biorxiv-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/biorxiv-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/biorxiv-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.4.0-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -47,6 +47,7 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
47
47
  ### `biorxiv_get_preprint` <sub>tool</sub>
48
48
 
49
49
  - Batch fetch up to 10 DOIs in a single request
50
+ - Accepts a bare DOI or a pasted form of one — `https://doi.org/…`, `doi:…`, a `biorxiv.org`/`medrxiv.org` article URL, a `vN` or article-page suffix (`.full`, `.full.pdf`, `.article-metrics`, …) — and reports the bare DOI
50
51
  - Each DOI returns its full revision history in `revisions[]` — one API call per DOI, no enumeration loop
51
52
  - Includes title, authors, abstract, category, license, JATS XML full-text link (`jatsxmlUrl`), and published journal DOI (`publishedJournalDoi`) once accepted
52
53
  - Scope to `biorxiv`, `medrxiv`, or `both` (default `both`); when `both`, each DOI fans out in parallel and partial failures report per-DOI in `failed[]`
@@ -57,7 +58,8 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
57
58
 
58
59
  ### `biorxiv_list_recent` <sub>tool</sub>
59
60
 
60
- - Optional server-side category filter — pass a value from `biorxiv_list_categories`
61
+ - Optional server-side category filter — pass a value from `biorxiv_list_categories`, in any case, with `_`, `-`, or a space (`Cell Biology`, `cell_biology`, `cell-biology`)
62
+ - A server that answers the filter with its unfiltered listing is left out with a notice, never returned as filtered; `invalid_category` when no server applied it
61
63
  - Fixed page size of 30 (API constraint); advance with integer `cursor` (0, 30, 60, …)
62
64
  - Response includes a `total` count per server; a cursor past the last page is marked `exhausted: true` rather than reading as zero results in the interval
63
65
  - When `server="both"` (default), per-server pagination state is independent (`{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`); one server not answering is named in `failed[]` while the other's page still returns
@@ -68,7 +70,8 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
68
70
  ### `biorxiv_search_preprints` <sub>tool</sub>
69
71
 
70
72
  - Query and/or author required (author maps to an EuropePMC `AUTH:"…"` field query, ANDed with the keyword query); optional `date_from`/`date_to` range and `server` scope (default `both`)
71
- - Up to 100 results per page (default 25); `cursor_mark` pages through the same ranked list
73
+ - Up to 100 results per page (default 25); `cursor_mark` pages through the same ranked list; a page past the last match comes back empty with a notice saying so, and a token EuropePMC does not recognize raises `invalid_cursor_mark`
74
+ - An EuropePMC response missing its result list is retried, never reported as zero matches; one that persists on a first page raises `search_unavailable`
72
75
  - EuropePMC powers relevance ranking (indexes new preprints within 1–2 days of posting); the bioRxiv/medRxiv API enriches matches with canonical metadata
73
76
  - Enriched results carry the same latest-revision fields as `biorxiv_get_preprint`, including `type`, `license`, `funder`, and `authorCorrespondingInstitution`
74
77
  - Enrichment failures degrade to EuropePMC-only metadata, surfaced via `partial_results` and a per-record `enrichment_error` (`service_error`, `rate_limited`, or `not_found`)
@@ -80,7 +83,8 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
80
83
 
81
84
  - Uses the `/pubs/{server}/{doi}` endpoint for richer metadata than the `publishedJournalDoi` field on `biorxiv_get_preprint`
82
85
  - Returns journal DOI, journal name, published date, and corresponding-author institution; the output `server` field names which server answered (never `"both"`)
83
- - Scope to `biorxiv`, `medrxiv`, or `both` (default `both`) — the two servers share the `10.1101/` DOI prefix, so a DOI alone doesn't identify one
86
+ - Scope to `biorxiv`, `medrxiv`, or `both` (default `both`) — the two servers share their DOI prefixes, so a DOI alone doesn't identify one
87
+ - `10.64898/` DOIs, which `/pubs` cannot look up by preprint DOI, resolve through the preprint's own journal DOI; when the crosswalk has no record either way, that journal DOI returns alone, without journal name or date, with a notice saying so
84
88
  - No server answering raises a retryable `upstream_unavailable`, or `rate_limited` with the origin's wait on an HTTP 429 — never `doi_not_found`, which would assert an absence nothing established
85
89
 
86
90
  ---
@@ -88,8 +92,8 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
88
92
  ### `biorxiv_get_fulltext` <sub>tool</sub>
89
93
 
90
94
  - Fetches the rendered HTML article page (`www.{server}.org/content/{doi}v{N}.full`) and extracts Markdown — there is no keyless JATS source
91
- - Resolves the latest version via the details API first; only DOI resolution fans out across `biorxiv`/`medrxiv`/`both` (default `both`) — the full-text fetch itself targets whichever server answered, named in the output `server` field
92
- - Long articles page via `offset`/`limit` character chunking (default `limit` 20,000, max 50,000); response reports `totalChars`, `remainingChars`, and `hasMore`, and the extracted article is cached per version so paging costs one origin fetch
95
+ - Reads the latest version, or the one requested by `version` or a `vN` suffix on the DOI (the two must agree; a version the preprint lacks raises `version_not_found`), confirmed via the details API first; only DOI resolution fans out across `biorxiv`/`medrxiv`/`both` (default `both`) — the full-text fetch itself targets whichever server answered, named in the output `server` field
96
+ - Long articles page via `offset`/`limit` character chunking (default `limit` 20,000, max 50,000); response reports `totalChars`, `remainingChars`, `hasMore`, and a full-article `wordCount` counted from the same Markdown, and the extracted article is cached per version so paging costs one origin fetch
93
97
  - PDF-only preprints and blocked/challenge pages return a typed `fulltext_unavailable` error routing to `biorxiv_get_preprint`
94
98
  - An origin rate limit (HTTP 429) — on either the article-page host or `api.biorxiv.org` during resolution — returns a retryable `rate_limited` error carrying the origin's `Retry-After` wait, with the recovery hint naming which origin is limiting
95
99
 
@@ -97,7 +101,7 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
97
101
 
98
102
  ### `biorxiv_list_categories` <sub>tool</sub>
99
103
 
100
- - No API call — hardcoded static list (~30 bioRxiv + ~50 medRxiv categories)
104
+ - No API call — hardcoded static list (25 bioRxiv + 51 medRxiv categories), limited to the ones the listing API actually filters on
101
105
  - Use to validate category strings before passing to `biorxiv_list_recent`
102
106
 
103
107
  ## Features
@@ -9,14 +9,15 @@ security: false
9
9
  ## Added
10
10
 
11
11
  - **`inputAliases`** lets `biorxiv_list_recent` accept `date_from`/`date_to` and `biorxiv_search_preprints` accept `start_date`/`end_date`, so a caller reusing the sibling tool's field names still succeeds. Framework 0.13.4 also rewrites a case-style variant of any declared key to its canonical form and repairs a JSON-stringified array after a failed parse. Advertised `inputSchema` is byte-identical to 0.2.6.
12
- - `.github/workflows/codeql.yml` — the fleet-standard CodeQL static-analysis workflow.
12
+ - **Hosted endpoint** — `server.json` lists `https://biorxiv.caseyjhand.com/mcp` as a `streamable-http` remote, and the README documents the public instance.
13
+ - `.github/workflows/codeql.yml` — a CodeQL static-analysis workflow.
13
14
 
14
15
  ## Changed
15
16
 
16
17
  - **Tool-argument rejections** return `isError` with `structuredContent.error.code` `-32602`; the text carries a `Recovery:` hint and `data.reason: "invalid_arguments"`, and an omitted required field now reads as missing rather than a generic type error (mcp-ts-core 0.12.7, 0.13.3).
17
18
  - **Tool error text** closes with `(reason <reason>)`, plus ` · not retryable` when `data.retryable` is false (0.13.5).
18
19
  - **Upstream 5xx handling** — an HTTP 500 now retries as `ServiceUnavailable`; a 501 does not retry (0.12.4).
19
- - **Session mode** — `src/index.ts` now declares `createApp({ sessionMode: 'stateless' })`, so an HTTP source run with `MCP_SESSION_MODE` unset serves stateless instead of resolving `auto` to stateful; an explicitly set `MCP_SESSION_MODE` still overrides it. The Docker image and `.env.example` already pinned `stateless`.
20
+ - **Session mode** — `src/index.ts` now declares `createApp({ sessionMode: 'stateless' })`, so an HTTP source run with `MCP_SESSION_MODE` unset serves stateless instead of resolving `auto` to stateful; an explicitly set `MCP_SESSION_MODE` still overrides it. The Docker image and `.env.example` already pinned `stateless` (option from 0.13.1).
20
21
  - **Env config** — every server env var now reads an empty or unsubstituted `${…}` value as unset (0.13.0), not just the three fields that previously carried a placeholder guard.
21
22
  - Graceful shutdown — `SIGTERM`/`SIGINT` now end the process explicitly (0.13.1).
22
23
  - Server `instructions` rewritten to name `biorxiv_get_fulltext`.
@@ -0,0 +1,26 @@
1
+ ---
2
+ summary: "Fixes empty EuropePMC bodies, category-filter mismatches, 10.64898/ crosswalk lookups, and DOI/version input handling"
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.2.8 — 2026-09-22
8
+
9
+ ## Changed
10
+
11
+ - Repo tooling — `scripts/lint-mcp.ts` reads `lint.truncationAllowlist` from `devcheck.config.json`; framework skills re-synced from mcp-ts-core 0.13.6.
12
+
13
+ ## Fixed
14
+
15
+ - **`EuropePmcService`** retries an HTTP 200 body with no `resultList` instead of reading it as zero matches; a body that persists raises `invalid_cursor_mark` on a cursor page or `search_unavailable` on a first page. A blank `cursor_mark` reads as the first page ([#43](https://github.com/cyanheads/biorxiv-mcp-server/issues/43), [#47](https://github.com/cyanheads/biorxiv-mcp-server/issues/47)).
16
+ - **`biorxiv_search_preprints`** answers an empty `cursor_mark` page past the last match with a notice that the list is exhausted, instead of suggesting broader search terms ([#43](https://github.com/cyanheads/biorxiv-mcp-server/issues/43)).
17
+ - **`biorxiv_list_recent` category filter** is sent in the API's own spelling (lowercase, `/` and `_` as a space), so `HIV/AIDS` now filters, and input matches case-, `_`-, `-`-, and `/`-insensitively. A server that silently ignored the filter is dropped with a notice, or raises `invalid_category` when every server that answered ignored it. Three taxonomy entries the API never filters on (`Epidemiology` and `Clinical Trials` on bioRxiv, `Vascular Medicine` on medRxiv) are removed from `biorxiv_list_categories` ([#45](https://github.com/cyanheads/biorxiv-mcp-server/issues/45), [#50](https://github.com/cyanheads/biorxiv-mcp-server/issues/50)).
18
+ - **`biorxiv_get_published_version`** resolves `10.64898/` DOIs, which `/pubs` keyed by preprint DOI never parses: it now falls back to the preprint's `/details` record for the journal DOI, then `/pubs` keyed by that. When the reverse lookup also finds nothing, the journal DOI still comes back with a notice rather than a false `doi_not_found` ([#46](https://github.com/cyanheads/biorxiv-mcp-server/issues/46)).
19
+ - **DOI input** across `biorxiv_get_preprint`, `biorxiv_get_published_version`, and `biorxiv_get_fulltext` now accepts a `doi.org`/article URL, a `doi:` label, and a trailing `vN`/`.full` suffix, normalizing to the bare DOI before any API call. `biorxiv_get_fulltext` takes a `version` input honoring a DOI's `vN` suffix, raising `version_conflict` when they disagree and `version_not_found` when the preprint lacks the requested revision ([#50](https://github.com/cyanheads/biorxiv-mcp-server/issues/50)).
20
+ - **`biorxiv_get_fulltext` `wordCount`** is now counted from the Markdown the tool actually serves, not the extractor's own figure, which measured its intermediate HTML rather than the served text and ran low. The full-text cache key moved to `fulltext/v2` so no stale entry is read back ([#51](https://github.com/cyanheads/biorxiv-mcp-server/issues/51)).
21
+
22
+ ## Dependencies
23
+
24
+ - `@cyanheads/mcp-ts-core` ^0.13.5 → ^0.13.6
25
+ - `defuddle` ^0.19.3 → ^0.19.4
26
+ - `@types/node` 26.6.1 → 26.6.2
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * @fileoverview biorxiv_get_fulltext tool — retrieves a preprint's full text by
3
3
  * fetching its rendered HTML page (`www.{server}.org/content/{doi}v{N}.full`) and
4
- * extracting readable Markdown. The latest version is resolved via the details
5
- * API first (for the URL version and clean not-found handling), then the HTML is
6
- * fetched and run through the framework extractor. bioRxiv and medRxiv share the
4
+ * extracting readable Markdown. The version is the one requested — the version
5
+ * input or a vN suffix on the DOI, which must agree when both are given — or
6
+ * else the latest; either way the details API is queried first (to confirm the
7
+ * version exists and for clean not-found handling), then the HTML is fetched
8
+ * and run through the framework extractor. bioRxiv and medRxiv share the
7
9
  * 10.1101/ DOI prefix, so the default server="both" resolves the DOI against both
8
10
  * in parallel; the fan-out is narrower than biorxiv_get_published_version's — only
9
11
  * the resolution step fans out, and the full-text fetch targets the single server
@@ -29,6 +31,7 @@ import { z } from '@cyanheads/mcp-ts-core';
29
31
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
30
32
  export declare const biorxivGetFulltextTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
31
33
  doi: z.ZodString;
34
+ version: z.ZodOptional<z.ZodNumber>;
32
35
  server: z.ZodDefault<z.ZodEnum<{
33
36
  biorxiv: "biorxiv";
34
37
  both: "both";
@@ -46,7 +49,7 @@ export declare const biorxivGetFulltextTool: import("@cyanheads/mcp-ts-core").To
46
49
  title: z.ZodOptional<z.ZodString>;
47
50
  content: z.ZodString;
48
51
  contentFormat: z.ZodLiteral<"html-markdown">;
49
- wordCount: z.ZodOptional<z.ZodNumber>;
52
+ wordCount: z.ZodNumber;
50
53
  sourceUrl: z.ZodString;
51
54
  offset: z.ZodNumber;
52
55
  length: z.ZodNumber;
@@ -56,8 +59,18 @@ export declare const biorxivGetFulltextTool: import("@cyanheads/mcp-ts-core").To
56
59
  }, z.core.$strip>, readonly [{
57
60
  readonly reason: "invalid_doi_format";
58
61
  readonly code: JsonRpcErrorCode.ValidationError;
59
- readonly when: "The input DOI does not match the 10.NNNN/ pattern.";
62
+ readonly when: "The input DOI does not match the 10.NNNN/ pattern, even after URL, doi:, and suffix stripping.";
60
63
  readonly recovery: "Correct the DOI format — bioRxiv/medRxiv DOIs start with 10.1101/ or 10.64898/ followed by the manuscript ID.";
64
+ }, {
65
+ readonly reason: "version_conflict";
66
+ readonly code: JsonRpcErrorCode.ValidationError;
67
+ readonly when: "The DOI carries a vN suffix and the version input names a different version.";
68
+ readonly recovery: "Name the version once — drop the vN suffix from the DOI or the version input — or make the two agree.";
69
+ }, {
70
+ readonly reason: "version_not_found";
71
+ readonly code: JsonRpcErrorCode.NotFound;
72
+ readonly when: "The preprint exists but has no revision with the requested version number.";
73
+ readonly recovery: "Request one of the available versions listed in the error, or omit the version to read the latest revision.";
61
74
  }, {
62
75
  readonly reason: "doi_not_found";
63
76
  readonly code: JsonRpcErrorCode.NotFound;
@@ -1 +1 @@
1
- {"version":3,"file":"biorxiv-get-fulltext.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAQjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0VjC,CAAC"}
1
+ {"version":3,"file":"biorxiv-get-fulltext.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAMjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4ZjC,CAAC"}
@@ -1,9 +1,11 @@
1
1
  /**
2
2
  * @fileoverview biorxiv_get_fulltext tool — retrieves a preprint's full text by
3
3
  * fetching its rendered HTML page (`www.{server}.org/content/{doi}v{N}.full`) and
4
- * extracting readable Markdown. The latest version is resolved via the details
5
- * API first (for the URL version and clean not-found handling), then the HTML is
6
- * fetched and run through the framework extractor. bioRxiv and medRxiv share the
4
+ * extracting readable Markdown. The version is the one requested — the version
5
+ * input or a vN suffix on the DOI, which must agree when both are given — or
6
+ * else the latest; either way the details API is queried first (to confirm the
7
+ * version exists and for clean not-found handling), then the HTML is fetched
8
+ * and run through the framework extractor. bioRxiv and medRxiv share the
7
9
  * 10.1101/ DOI prefix, so the default server="both" resolves the DOI against both
8
10
  * in parallel; the fan-out is narrower than biorxiv_get_published_version's — only
9
11
  * the resolution step fans out, and the full-text fetch targets the single server
@@ -29,16 +31,21 @@ import { tool, z } from '@cyanheads/mcp-ts-core';
29
31
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
30
32
  import { getBiorxivApiService } from '../../../services/biorxiv/biorxiv-service.js';
31
33
  import { getBiorxivFullTextService } from '../../../services/biorxiv-fulltext/biorxiv-fulltext-service.js';
32
- import { describeWait, findRateLimit } from '../../../services/shared.js';
33
- const DOI_REGEX = /^10\.\d{4,}\//;
34
+ import { describeWait, findRateLimit, normalizeDoi } from '../../../services/shared.js';
34
35
  export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
35
36
  title: 'Get Preprint Full Text',
36
- description: 'Retrieve a preprint\'s full text as best-effort Markdown, extracted from its rendered HTML article page. Resolves the latest version via the details API, then fetches and extracts the body — abstract, sections, and references. bioRxiv and medRxiv share the 10.1101/ DOI prefix, so server="both" (the default) resolves the DOI against both in parallel and the response reports which server answered. This is HTML-to-Markdown extraction, not structured JATS: section structure is approximate and not guaranteed. Long articles exceed a single response, so use offset and limit to page through them (the response reports totalChars, remainingChars, and hasMore); paging is cheap because the extracted article is cached per version for an hour after the first read, so only the first chunk pays for a fetch. Not every preprint has an extractable HTML page — some are PDF-only and some origins block programmatic access — in which case a fulltext_unavailable error routes you to biorxiv_get_preprint for the title, abstract, and metadata. For a preprint that has been published in a journal, the journal\'s version may have richer full text elsewhere.',
37
+ description: 'Retrieve a preprint\'s full text as best-effort Markdown, extracted from its rendered HTML article page. Reads the latest version unless one is requested (the version input, or a vN suffix on the DOI), confirms it via the details API, then fetches and extracts the body — abstract, sections, and references. bioRxiv and medRxiv share the 10.1101/ DOI prefix, so server="both" (the default) resolves the DOI against both in parallel and the response reports which server answered. This is HTML-to-Markdown extraction, not structured JATS: section structure is approximate and not guaranteed. Long articles exceed a single response, so use offset and limit to page through them (the response reports totalChars, remainingChars, and hasMore); paging is cheap because the extracted article is cached per version for an hour after the first read, so only the first chunk pays for a fetch. Not every preprint has an extractable HTML page — some are PDF-only and some origins block programmatic access — in which case a fulltext_unavailable error routes you to biorxiv_get_preprint for the title, abstract, and metadata. For a preprint that has been published in a journal, the journal\'s version may have richer full text elsewhere.',
37
38
  annotations: { readOnlyHint: true, openWorldHint: true },
38
39
  input: z.object({
39
40
  doi: z
40
41
  .string()
41
- .describe('Preprint DOI (e.g. 10.1101/2024.05.28.596311 or 10.64898/2026.05.07.723463). The latest version is resolved automatically.'),
42
+ .describe('Preprint DOI (e.g. 10.1101/2024.05.28.596311 or 10.64898/2026.05.07.723463). A doi.org or biorxiv.org/medrxiv.org article URL, a doi: prefix, or a .full suffix is accepted and stripped; a trailing vN (…596311v2) requests that version. Without one, the latest version is resolved automatically.'),
43
+ version: z
44
+ .number()
45
+ .int()
46
+ .min(1)
47
+ .optional()
48
+ .describe('Preprint version to read (1, 2, …) — the revision numbers biorxiv_get_preprint lists. Omit for the latest version. Must match a vN suffix on the DOI when both are given.'),
42
49
  server: z
43
50
  .enum(['biorxiv', 'medrxiv', 'both'])
44
51
  .default('both')
@@ -58,11 +65,11 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
58
65
  .describe('Maximum number of characters to return in this chunk. Default 20,000; increase toward 50,000 for large context windows. Check the length field for the actual count returned.'),
59
66
  }),
60
67
  output: z.object({
61
- doi: z.string().describe('The resolved preprint DOI.'),
68
+ doi: z.string().describe('The resolved preprint DOI, in bare form.'),
62
69
  server: z.enum(['biorxiv', 'medrxiv']).describe('Server the preprint was resolved on.'),
63
70
  version: z
64
71
  .string()
65
- .describe('Preprint version whose full text was retrieved (the latest revision).'),
72
+ .describe('Preprint version whose full text was retrieved — the requested one, or the latest revision when none was requested. Pass it back as version when paging.'),
66
73
  title: z
67
74
  .string()
68
75
  .optional()
@@ -75,8 +82,7 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
75
82
  .describe('How content was produced: Markdown extracted from the rendered HTML article page (constant).'),
76
83
  wordCount: z
77
84
  .number()
78
- .optional()
79
- .describe('Approximate word count of the FULL extracted article as reported by the extractor (not just the returned chunk). Absent when the extractor reported none.'),
85
+ .describe('Approximate word count of the FULL extracted article, not just the returned chunk — whitespace-delimited tokens of the same Markdown text that totalChars measures, so Markdown markers such as # and - count too.'),
80
86
  sourceUrl: z.string().describe('The full-text HTML page the content was extracted from.'),
81
87
  offset: z
82
88
  .number()
@@ -112,9 +118,21 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
112
118
  {
113
119
  reason: 'invalid_doi_format',
114
120
  code: JsonRpcErrorCode.ValidationError,
115
- when: 'The input DOI does not match the 10.NNNN/ pattern.',
121
+ when: 'The input DOI does not match the 10.NNNN/ pattern, even after URL, doi:, and suffix stripping.',
116
122
  recovery: 'Correct the DOI format — bioRxiv/medRxiv DOIs start with 10.1101/ or 10.64898/ followed by the manuscript ID.',
117
123
  },
124
+ {
125
+ reason: 'version_conflict',
126
+ code: JsonRpcErrorCode.ValidationError,
127
+ when: 'The DOI carries a vN suffix and the version input names a different version.',
128
+ recovery: 'Name the version once — drop the vN suffix from the DOI or the version input — or make the two agree.',
129
+ },
130
+ {
131
+ reason: 'version_not_found',
132
+ code: JsonRpcErrorCode.NotFound,
133
+ when: 'The preprint exists but has no revision with the requested version number.',
134
+ recovery: 'Request one of the available versions listed in the error, or omit the version to read the latest revision.',
135
+ },
118
136
  {
119
137
  reason: 'doi_not_found',
120
138
  code: JsonRpcErrorCode.NotFound,
@@ -155,23 +173,41 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
155
173
  offset: input.offset,
156
174
  limit: input.limit,
157
175
  });
158
- if (!DOI_REGEX.test(input.doi)) {
176
+ const parsed = normalizeDoi(input.doi);
177
+ if (!parsed) {
159
178
  throw ctx.fail('invalid_doi_format', `Invalid DOI format: ${input.doi}`, {
160
179
  ...ctx.recoveryFor('invalid_doi_format'),
161
180
  });
162
181
  }
163
- // Resolve the preprint and its latest version via the JSON details API — this
164
- // provides the version for the full-text URL and clean not-found handling.
165
- // Only this step fans out; the full-text fetch targets the server that answered.
182
+ const { doi } = parsed;
183
+ // A version can arrive two ways — a vN suffix on a pasted DOI or URL, and the
184
+ // version input. Agreeing is fine; disagreeing is ambiguous, and fetching
185
+ // either one would silently hand back text the caller did not ask for.
186
+ const inputVersion = input.version === undefined ? undefined : String(input.version);
187
+ if (parsed.version !== undefined &&
188
+ inputVersion !== undefined &&
189
+ parsed.version !== inputVersion) {
190
+ throw ctx.fail('version_conflict', `The DOI names version v${parsed.version} but the version input is ${inputVersion}.`, {
191
+ doi,
192
+ doiVersion: parsed.version,
193
+ version: input.version,
194
+ ...ctx.recoveryFor('version_conflict'),
195
+ });
196
+ }
197
+ const requestedVersion = inputVersion ?? parsed.version;
198
+ // Resolve the preprint and its versions via the JSON details API — this
199
+ // confirms the requested version exists (or supplies the latest), and gives
200
+ // clean not-found handling. Only this step fans out; the full-text fetch
201
+ // targets the server that answered.
166
202
  const service = getBiorxivApiService();
167
203
  const servers = input.server === 'both' ? ['biorxiv', 'medrxiv'] : [input.server];
168
- const settled = await Promise.allSettled(servers.map((server) => service.getDetails(input.doi, server, ctx)));
204
+ const settled = await Promise.allSettled(servers.map((server) => service.getDetails(doi, server, ctx)));
169
205
  let resolved;
170
206
  for (const [i, settledResult] of settled.entries()) {
171
207
  if (settledResult.status === 'fulfilled' && settledResult.value.length > 0) {
172
208
  resolved = {
173
209
  server: servers[i],
174
- version: settledResult.value.at(-1)?.version ?? '1',
210
+ versions: settledResult.value.map((r) => r.version ?? '1'),
175
211
  };
176
212
  break;
177
213
  }
@@ -190,8 +226,8 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
190
226
  const rateLimit = findRateLimit(rejections.map((f) => f.error));
191
227
  if (rateLimit) {
192
228
  const wait = describeWait(rateLimit.retryAfter);
193
- throw ctx.fail('rate_limited', `Version lookup for ${input.doi} failed — ${detail}`, {
194
- doi: input.doi,
229
+ throw ctx.fail('rate_limited', `Version lookup for ${doi} failed — ${detail}`, {
230
+ doi,
195
231
  servers: rejections.map((f) => f.server),
196
232
  ...(rateLimit.retryAfter !== undefined && { retryAfter: rateLimit.retryAfter }),
197
233
  recovery: {
@@ -199,16 +235,31 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
199
235
  },
200
236
  }, { cause: rejections[0]?.error });
201
237
  }
202
- throw ctx.fail('upstream_unavailable', `Version lookup for ${input.doi} failed — ${detail}`, {
203
- doi: input.doi,
238
+ throw ctx.fail('upstream_unavailable', `Version lookup for ${doi} failed — ${detail}`, {
239
+ doi,
204
240
  servers: rejections.map((f) => f.server),
205
241
  ...ctx.recoveryFor('upstream_unavailable'),
206
242
  }, { cause: rejections[0]?.error });
207
243
  }
208
- throw ctx.fail('doi_not_found', `No preprint found for ${input.doi} on ${servers.join(' or ')}.`, { doi: input.doi, servers, ...ctx.recoveryFor('doi_not_found') });
244
+ throw ctx.fail('doi_not_found', `No preprint found for ${doi} on ${servers.join(' or ')}.`, {
245
+ doi,
246
+ servers,
247
+ ...ctx.recoveryFor('doi_not_found'),
248
+ });
209
249
  }
210
- const { server, version } = resolved;
211
- const result = await getBiorxivFullTextService().fetchFullText(server, input.doi, version, ctx);
250
+ const { server, versions } = resolved;
251
+ const latestVersion = versions.at(-1) ?? '1';
252
+ if (requestedVersion !== undefined && !versions.includes(requestedVersion)) {
253
+ throw ctx.fail('version_not_found', `${doi} has no version ${requestedVersion} on ${server} — available versions: ${versions.join(', ')}.`, {
254
+ doi,
255
+ server,
256
+ version: requestedVersion,
257
+ availableVersions: versions,
258
+ ...ctx.recoveryFor('version_not_found'),
259
+ });
260
+ }
261
+ const version = requestedVersion ?? latestVersion;
262
+ const result = await getBiorxivFullTextService().fetchFullText(server, doi, version, ctx);
212
263
  if (result.kind === 'unavailable') {
213
264
  if (result.reason === 'rate_limited') {
214
265
  // Dynamic recovery — the origin's own wait is more actionable than the
@@ -226,7 +277,7 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
226
277
  const retryAfter = waits.length > 0 ? Math.max(...waits) : undefined;
227
278
  const wait = describeWait(retryAfter);
228
279
  throw ctx.fail('rate_limited', result.detail, {
229
- doi: input.doi,
280
+ doi,
230
281
  server,
231
282
  version,
232
283
  sourceUrl: result.sourceUrl,
@@ -239,14 +290,18 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
239
290
  });
240
291
  }
241
292
  throw ctx.fail('fulltext_unavailable', result.detail, {
242
- doi: input.doi,
293
+ doi,
243
294
  server,
244
295
  version,
245
296
  sourceUrl: result.sourceUrl,
246
297
  ...ctx.recoveryFor('fulltext_unavailable'),
247
298
  });
248
299
  }
300
+ // Both measure the one string this call pages over, so they cannot disagree
301
+ // with each other or with content. The service trims the Markdown and never
302
+ // returns it empty, so splitting yields no empty tokens.
249
303
  const totalChars = result.markdown.length;
304
+ const wordCount = result.markdown.split(/\s+/).length;
250
305
  if (input.offset >= totalChars) {
251
306
  throw ctx.fail('offset_out_of_range', `Offset ${input.offset} is past the end of the text (totalChars: ${totalChars}).`, { offset: input.offset, totalChars, ...ctx.recoveryFor('offset_out_of_range') });
252
307
  }
@@ -259,17 +314,17 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
259
314
  ctx.enrich.truncated({
260
315
  shown: length,
261
316
  cap: input.limit,
262
- guidance: `Full text truncated at the ${input.limit}-character limit. Call biorxiv_get_fulltext again with offset=${end} to read the next chunk.`,
317
+ guidance: `Full text truncated at the ${input.limit}-character limit. Call biorxiv_get_fulltext again with version=${version}, offset=${end} to read the next chunk.`,
263
318
  });
264
319
  }
265
320
  return {
266
- doi: input.doi,
321
+ doi,
267
322
  server,
268
323
  version,
269
324
  ...(result.title && { title: result.title }),
270
325
  content,
271
326
  contentFormat: 'html-markdown',
272
- ...(result.wordCount !== undefined && { wordCount: result.wordCount }),
327
+ wordCount,
273
328
  sourceUrl: result.sourceUrl,
274
329
  offset: input.offset,
275
330
  length,
@@ -284,15 +339,14 @@ export const biorxivGetFulltextTool = tool('biorxiv_get_fulltext', {
284
339
  lines.push(`**DOI:** ${result.doi} | **Server:** ${result.server} | **Version:** v${result.version}`);
285
340
  const end = result.offset + result.length;
286
341
  lines.push(`**Characters ${result.offset.toLocaleString()}–${(end - 1).toLocaleString()} of ${result.totalChars.toLocaleString()}** | Length: ${result.length.toLocaleString()} | Remaining: ${result.remainingChars.toLocaleString()} | hasMore: ${result.hasMore}`);
287
- if (result.wordCount !== undefined)
288
- lines.push(`**Full-article word count:** ${result.wordCount}`);
342
+ lines.push(`**Full-article word count:** ${result.wordCount}`);
289
343
  lines.push(`**Source:** ${result.sourceUrl}`);
290
344
  lines.push(`**Format:** ${result.contentFormat}`);
291
345
  lines.push('\n> Extracted from the rendered HTML page — section structure is best-effort and not guaranteed (this is not JATS). Treat headings and reference formatting as approximate.');
292
346
  lines.push('\n---\n');
293
347
  lines.push(result.content);
294
348
  if (result.hasMore) {
295
- lines.push(`\n---\n_Call biorxiv_get_fulltext again with doi=${result.doi}, offset=${end} to read the next chunk._`);
349
+ lines.push(`\n---\n_Call biorxiv_get_fulltext again with doi=${result.doi}, version=${result.version}, offset=${end} to read the next chunk._`);
296
350
  }
297
351
  else {
298
352
  lines.push('\n---\n_End of extracted text._');
@@ -1 +1 @@
1
- {"version":3,"file":"biorxiv-get-fulltext.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,EAAE;IACjE,KAAK,EAAE,wBAAwB;IAC/B,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AAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"biorxiv-get-fulltext.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACpG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,EAAE;IACjE,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,4sCAA4sC;IAC9sC,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAExD,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,CAAC;aACH,MAAM,EAAE;aACR,QAAQ,CACP,uSAAuS,CACxS;QACH,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CACP,2KAA2K,CAC5K;QACH,MAAM,EAAE,CAAC;aACN,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;aACpC,OAAO,CAAC,MAAM,CAAC;aACf,QAAQ,CACP,+NAA+N,CAChO;QACH,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,OAAO,CAAC,CAAC,CAAC;aACV,QAAQ,CACP,mNAAmN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