@cyanheads/biorxiv-mcp-server 0.2.7 → 0.3.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 (58) hide show
  1. package/AGENTS.md +15 -11
  2. package/CLAUDE.md +15 -11
  3. package/README.md +22 -11
  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/changelog/0.3.x/0.3.0.md +22 -0
  7. package/dist/index.js +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts +18 -5
  10. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts.map +1 -1
  11. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js +91 -34
  12. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js.map +1 -1
  13. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts +5 -3
  14. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts.map +1 -1
  15. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js +36 -24
  16. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js.map +1 -1
  17. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts +19 -9
  18. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts.map +1 -1
  19. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js +135 -47
  20. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js.map +1 -1
  21. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.js +1 -1
  22. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts +21 -3
  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 +171 -76
  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 +21 -2
  28. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts.map +1 -1
  29. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js +99 -25
  30. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js.map +1 -1
  31. package/dist/mcp-server/tools/definitions/index.d.ts +41 -14
  32. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  33. package/dist/services/biorxiv/biorxiv-service.d.ts +35 -7
  34. package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -1
  35. package/dist/services/biorxiv/biorxiv-service.js +137 -61
  36. package/dist/services/biorxiv/biorxiv-service.js.map +1 -1
  37. package/dist/services/biorxiv/types.d.ts +27 -2
  38. package/dist/services/biorxiv/types.d.ts.map +1 -1
  39. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts +5 -2
  40. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts.map +1 -1
  41. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js +5 -6
  42. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js.map +1 -1
  43. package/dist/services/europe-pmc/europe-pmc-service.d.ts +23 -6
  44. package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
  45. package/dist/services/europe-pmc/europe-pmc-service.js +118 -19
  46. package/dist/services/europe-pmc/europe-pmc-service.js.map +1 -1
  47. package/dist/services/europe-pmc/types.d.ts +9 -3
  48. package/dist/services/europe-pmc/types.d.ts.map +1 -1
  49. package/dist/services/shared.d.ts +83 -10
  50. package/dist/services/shared.d.ts.map +1 -1
  51. package/dist/services/shared.js +287 -16
  52. package/dist/services/shared.js.map +1 -1
  53. package/dist/services/upstream-text-tables.d.ts +44 -0
  54. package/dist/services/upstream-text-tables.d.ts.map +1 -0
  55. package/dist/services/upstream-text-tables.js +296 -0
  56. package/dist/services/upstream-text-tables.js.map +1 -0
  57. package/package.json +4 -4
  58. 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.3.0
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,9 +187,10 @@ 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,
191
- # isValidCalendarDate, parseRetryAfterSeconds, findRateLimit, describeWait,
192
- # SERVER_VERSION)
190
+ shared.ts # Shared utilities (detectHtmlError, normalizeDoi, normalizeRorId,
191
+ # normalizeUpstreamText, escapeMarkdown, isValidCalendarDate,
192
+ # parseRetryAfterSeconds, findRateLimit, describeWait, SERVER_VERSION)
193
+ upstream-text-tables.ts # Closed tables normalizeUpstreamText reads: Highwire placeholders, section headings
193
194
  biorxiv/
194
195
  biorxiv-service.ts # BiorxivApiService — details, publications, pubs endpoints
195
196
  types.ts # Domain types (Preprint, PublishedVersion, …)
@@ -223,12 +224,15 @@ src/
223
224
 
224
225
  ## Domain Conventions
225
226
 
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.
227
+ - **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()`.
228
+ - **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.
229
+ - **Funder data:** upstream funder `name`s and ROR `id`s on records are misattributed — expose only `awards` (verbatim, never split), never a funder name or ID. The listing's `funder` filter takes a bare ROR ID (`normalizeRorId()` strips the URL form and checks the checksum), is bioRxiv-only, and `"funder value not found"` (flagged `funderNotFound`) is an error, never an empty page.
227
230
  - **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
231
  - **Pagination:** integer `cursor` offset (0, 30, 60, …). Page size is fixed at 30 by the API — do not expose a `limit` parameter.
229
232
  - **Two-server pagination:** when `server="both"`, surface per-server state: `{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`. A merged cursor is ambiguous.
230
- - **EuropePMC enrichment:** `biorxiv_search_preprints` uses EuropePMC for relevance then enriches matching DOIs via the details endpoint. Enrichment routes based on `input.server` — when explicit ("biorxiv" or "medrxiv"), always use that server. `10.1101/` prefix is used as a hint only within `server="both"` to prefer bioRxiv first, but is not a reliable discriminator (both servers share this prefix).
231
- - **`format()` must be content-complete:** Claude Desktop reads `content[]` from `format()`, not `structuredContent`. Revision list, crosswalk data, pagination state, and abstracts must all appear in the rendered markdown, not just counts.
233
+ - **EuropePMC enrichment:** `biorxiv_search_preprints` uses EuropePMC for relevance then enriches matching DOIs via the details endpoint. Enrichment routes based on `input.server` — when explicit ("biorxiv" or "medrxiv"), always use that server. `10.1101/` prefix is used as a hint only within `server="both"` to prefer bioRxiv first, but is not a reliable discriminator (both servers share this prefix). The ranked search stays `resulttype=lite`, which never carries an abstract; records that fall back to EuropePMC metadata get theirs from one DOI-keyed `resultType=core` query (`getAbstracts`), made only when abstracts are requested and something fell back. A failed lookup is a notice, never a failed search.
234
+ - **`format()` must be content-complete:** Claude Desktop reads `content[]` from `format()`, not `structuredContent`. Revision list, crosswalk data, pagination state, and every abstract a record carries must all appear in the rendered markdown, not just counts. `include_abstract` (default `false` on `biorxiv_list_recent`, `true` on `biorxiv_search_preprints`) removes the abstract from both surfaces together and no other field.
235
+ - **Upstream text in `format()`:** run titles and abstracts through `normalizeUpstreamText()` in the service (never in `format()`), and pass every upstream free-text field through `escapeMarkdown()` where `format()` interpolates it. It escapes only characters that would change rendering (`A\*T`, `\<COMP id>`; `p<0.05` and `cc_by` stay raw), because agents copy spans out of `content[]` — keep it that narrow. Never escape DOIs, URLs, `structuredContent`, or `biorxiv_get_fulltext`'s extracted `content`.
232
236
  - **Polite access:** include `BIORXIV_MAILTO` in the `User-Agent` header when set: `biorxiv-mcp-server/0.1.0 (mailto:${config.mailto})`. The env var is optional — omit the mailto segment when not configured.
233
237
 
234
238
  ---
@@ -377,12 +381,12 @@ import { getEuropePmcService } from '@/services/europe-pmc/europe-pmc-service.js
377
381
  - [ ] JSDoc `@fileoverview` + `@module` on every file
378
382
  - [ ] `ctx.log` for logging, `ctx.state` for storage
379
383
  - [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
380
- - [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data — including revision list, crosswalk fields, abstract, and pagination state
384
+ - [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data — including revision list, crosswalk fields, pagination state, and the abstract whenever the record carries one (`include_abstract` drops it from both surfaces at once)
381
385
  - [ ] bioRxiv API wrapping: raw/domain/output schemas reviewed against real upstream sparsity/nullability before finalizing required vs optional fields
382
386
  - [ ] 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
387
  - [ ] bioRxiv API wrapping: tests include at least one sparse payload case with omitted upstream fields
384
388
  - [ ] `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
389
+ - [ ] DOI input normalized and validated with `normalizeDoi()` before calling API
386
390
  - [ ] Two-server fan-out uses `Promise.allSettled`; partial failures reported per-DOI in `failed[]`
387
391
  - [ ] `biorxiv_list_recent` with `server="both"` surfaces per-server pagination state, not a merged cursor
388
392
  - [ ] 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.3.0
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,9 +187,10 @@ 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,
191
- # isValidCalendarDate, parseRetryAfterSeconds, findRateLimit, describeWait,
192
- # SERVER_VERSION)
190
+ shared.ts # Shared utilities (detectHtmlError, normalizeDoi, normalizeRorId,
191
+ # normalizeUpstreamText, escapeMarkdown, isValidCalendarDate,
192
+ # parseRetryAfterSeconds, findRateLimit, describeWait, SERVER_VERSION)
193
+ upstream-text-tables.ts # Closed tables normalizeUpstreamText reads: Highwire placeholders, section headings
193
194
  biorxiv/
194
195
  biorxiv-service.ts # BiorxivApiService — details, publications, pubs endpoints
195
196
  types.ts # Domain types (Preprint, PublishedVersion, …)
@@ -223,12 +224,15 @@ src/
223
224
 
224
225
  ## Domain Conventions
225
226
 
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.
227
+ - **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()`.
228
+ - **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.
229
+ - **Funder data:** upstream funder `name`s and ROR `id`s on records are misattributed — expose only `awards` (verbatim, never split), never a funder name or ID. The listing's `funder` filter takes a bare ROR ID (`normalizeRorId()` strips the URL form and checks the checksum), is bioRxiv-only, and `"funder value not found"` (flagged `funderNotFound`) is an error, never an empty page.
227
230
  - **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
231
  - **Pagination:** integer `cursor` offset (0, 30, 60, …). Page size is fixed at 30 by the API — do not expose a `limit` parameter.
229
232
  - **Two-server pagination:** when `server="both"`, surface per-server state: `{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`. A merged cursor is ambiguous.
230
- - **EuropePMC enrichment:** `biorxiv_search_preprints` uses EuropePMC for relevance then enriches matching DOIs via the details endpoint. Enrichment routes based on `input.server` — when explicit ("biorxiv" or "medrxiv"), always use that server. `10.1101/` prefix is used as a hint only within `server="both"` to prefer bioRxiv first, but is not a reliable discriminator (both servers share this prefix).
231
- - **`format()` must be content-complete:** Claude Desktop reads `content[]` from `format()`, not `structuredContent`. Revision list, crosswalk data, pagination state, and abstracts must all appear in the rendered markdown, not just counts.
233
+ - **EuropePMC enrichment:** `biorxiv_search_preprints` uses EuropePMC for relevance then enriches matching DOIs via the details endpoint. Enrichment routes based on `input.server` — when explicit ("biorxiv" or "medrxiv"), always use that server. `10.1101/` prefix is used as a hint only within `server="both"` to prefer bioRxiv first, but is not a reliable discriminator (both servers share this prefix). The ranked search stays `resulttype=lite`, which never carries an abstract; records that fall back to EuropePMC metadata get theirs from one DOI-keyed `resultType=core` query (`getAbstracts`), made only when abstracts are requested and something fell back. A failed lookup is a notice, never a failed search.
234
+ - **`format()` must be content-complete:** Claude Desktop reads `content[]` from `format()`, not `structuredContent`. Revision list, crosswalk data, pagination state, and every abstract a record carries must all appear in the rendered markdown, not just counts. `include_abstract` (default `false` on `biorxiv_list_recent`, `true` on `biorxiv_search_preprints`) removes the abstract from both surfaces together and no other field.
235
+ - **Upstream text in `format()`:** run titles and abstracts through `normalizeUpstreamText()` in the service (never in `format()`), and pass every upstream free-text field through `escapeMarkdown()` where `format()` interpolates it. It escapes only characters that would change rendering (`A\*T`, `\<COMP id>`; `p<0.05` and `cc_by` stay raw), because agents copy spans out of `content[]` — keep it that narrow. Never escape DOIs, URLs, `structuredContent`, or `biorxiv_get_fulltext`'s extracted `content`.
232
236
  - **Polite access:** include `BIORXIV_MAILTO` in the `User-Agent` header when set: `biorxiv-mcp-server/0.1.0 (mailto:${config.mailto})`. The env var is optional — omit the mailto segment when not configured.
233
237
 
234
238
  ---
@@ -377,12 +381,12 @@ import { getEuropePmcService } from '@/services/europe-pmc/europe-pmc-service.js
377
381
  - [ ] JSDoc `@fileoverview` + `@module` on every file
378
382
  - [ ] `ctx.log` for logging, `ctx.state` for storage
379
383
  - [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
380
- - [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data — including revision list, crosswalk fields, abstract, and pagination state
384
+ - [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data — including revision list, crosswalk fields, pagination state, and the abstract whenever the record carries one (`include_abstract` drops it from both surfaces at once)
381
385
  - [ ] bioRxiv API wrapping: raw/domain/output schemas reviewed against real upstream sparsity/nullability before finalizing required vs optional fields
382
386
  - [ ] 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
387
  - [ ] bioRxiv API wrapping: tests include at least one sparse payload case with omitted upstream fields
384
388
  - [ ] `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
389
+ - [ ] DOI input normalized and validated with `normalizeDoi()` before calling API
386
390
  - [ ] Two-server fan-out uses `Promise.allSettled`; partial failures reported per-DOI in `failed[]`
387
391
  - [ ] `biorxiv_list_recent` with `server="both"` surfaces per-server pagination state, not a merged cursor
388
392
  - [ ] 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.3.0-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
 
@@ -36,7 +36,7 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
36
36
  | Tool | Description |
37
37
  |:---|:---|
38
38
  | `biorxiv_get_preprint` | Fetch full metadata, abstract, revision history, and journal crosswalk for one or more preprints by DOI |
39
- | `biorxiv_list_recent` | List preprints posted or updated within a date interval, with optional server and category filters |
39
+ | `biorxiv_list_recent` | List preprints posted or updated within a date interval, with optional server, category, and funder filters |
40
40
  | `biorxiv_search_preprints` | Search preprints by keyword and/or author via EuropePMC for relevance ranking, enriched with bioRxiv/medRxiv metadata |
41
41
  | `biorxiv_get_published_version` | Resolve a preprint DOI to its journal publication record (journal DOI, name, published date) |
42
42
  | `biorxiv_get_fulltext` | Retrieve a preprint's full text as best-effort Markdown extracted from its rendered HTML article page |
@@ -47,8 +47,10 @@ 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
- - Includes title, authors, abstract, category, license, JATS XML full-text link (`jatsxmlUrl`), and published journal DOI (`publishedJournalDoi`) once accepted
52
+ - Includes title, authors, abstract, category, license, grant award numbers (`awards`), JATS XML full-text link (`jatsxmlUrl`), and published journal DOI (`publishedJournalDoi`) once accepted
53
+ - `awards` holds each award value as upstream records it (one value can run several grants together), deduplicated; funder names are left out because `api.biorxiv.org` attributes them to unrelated organizations
52
54
  - Scope to `biorxiv`, `medrxiv`, or `both` (default `both`); when `both`, each DOI fans out in parallel and partial failures report per-DOI in `failed[]`
53
55
  - Each `failed[]` entry carries a `reason` (`not_found`, `invalid_doi_format`, `upstream_unavailable`, `rate_limited`) and a `retryable` flag — a DOI is only reported `not_found` when every attempted server answered
54
56
  - A rate-limited lookup (HTTP 429) reports `reason: "rate_limited"` rather than folding into `upstream_unavailable`, carrying `retryAfter` — the wait in seconds `api.biorxiv.org` asked for
@@ -57,8 +59,13 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
57
59
 
58
60
  ### `biorxiv_list_recent` <sub>tool</sub>
59
61
 
60
- - Optional server-side category filter — pass a value from `biorxiv_list_categories`
62
+ - 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`)
63
+ - 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
64
+ - Optional `funder` filter by ROR ID, bare (`021nxhr62`) or as `https://ror.org/021nxhr62`, checked against the ROR pattern and checksum before any request; combines with `category`
65
+ - The funder filter is bioRxiv-only — medRxiv records carry no funder data — so `server="both"` queries bioRxiv alone with a notice, and `server="medrxiv"` raises `invalid_funder`
66
+ - A ROR ID `api.biorxiv.org` has no funder record for raises `invalid_funder`, never an empty page
61
67
  - Fixed page size of 30 (API constraint); advance with integer `cursor` (0, 30, 60, …)
68
+ - Abstracts are omitted by default — they are about three quarters of a page — and every other record field is returned; `include_abstract: true` adds them for the whole page, and `biorxiv_get_preprint` returns them for up to 10 DOIs per call
62
69
  - 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
70
  - 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
64
71
  - Every attempted server failing raises a retryable `upstream_unavailable` (or `rate_limited`) error instead of an empty page
@@ -68,10 +75,12 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
68
75
  ### `biorxiv_search_preprints` <sub>tool</sub>
69
76
 
70
77
  - 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
78
+ - 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`
79
+ - 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
80
  - EuropePMC powers relevance ranking (indexes new preprints within 1–2 days of posting); the bioRxiv/medRxiv API enriches matches with canonical metadata
73
- - Enriched results carry the same latest-revision fields as `biorxiv_get_preprint`, including `type`, `license`, `funder`, and `authorCorrespondingInstitution`
74
- - Enrichment failures degrade to EuropePMC-only metadata, surfaced via `partial_results` and a per-record `enrichment_error` (`service_error`, `rate_limited`, or `not_found`)
81
+ - Enriched results carry the same latest-revision fields as `biorxiv_get_preprint`, including `type`, `license`, `awards`, and `authorCorrespondingInstitution`
82
+ - Enrichment failures degrade to EuropePMC-only metadata, surfaced via `partial_results` and a per-record `enrichment_error` (`service_error`, `rate_limited`, or `not_found`); those records' abstracts come from one EuropePMC lookup keyed by their DOIs, and a failed lookup leaves them without one, with a notice
83
+ - Abstracts are included by default; `include_abstract: false` drops them from every result, enriched and fallback alike, for a response about a third the size, keeping every other field
75
84
  - A EuropePMC rate limit (HTTP 429) raises a retryable `rate_limited` error carrying the origin's `Retry-After` wait — the search itself has no metadata to fall back on, unlike enrichment
76
85
 
77
86
  ---
@@ -80,7 +89,8 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
80
89
 
81
90
  - Uses the `/pubs/{server}/{doi}` endpoint for richer metadata than the `publishedJournalDoi` field on `biorxiv_get_preprint`
82
91
  - 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
92
+ - Scope to `biorxiv`, `medrxiv`, or `both` (default `both`) — the two servers share their DOI prefixes, so a DOI alone doesn't identify one
93
+ - `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
94
  - 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
95
 
86
96
  ---
@@ -88,8 +98,8 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
88
98
  ### `biorxiv_get_fulltext` <sub>tool</sub>
89
99
 
90
100
  - 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
101
+ - 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
102
+ - 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
103
  - PDF-only preprints and blocked/challenge pages return a typed `fulltext_unavailable` error routing to `biorxiv_get_preprint`
94
104
  - 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
105
 
@@ -97,7 +107,7 @@ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. F
97
107
 
98
108
  ### `biorxiv_list_categories` <sub>tool</sub>
99
109
 
100
- - No API call — hardcoded static list (~30 bioRxiv + ~50 medRxiv categories)
110
+ - No API call — hardcoded static list (25 bioRxiv + 51 medRxiv categories), limited to the ones the listing API actually filters on
101
111
  - Use to validate category strings before passing to `biorxiv_list_recent`
102
112
 
103
113
  ## Features
@@ -119,6 +129,7 @@ Agent-friendly output:
119
129
  - Rate-limit transparency — a 429 from any upstream surfaces as `reason: "rate_limited"` carrying the origin's parsed `retryAfter` wait, distinguished from a generic `upstream_unavailable`
120
130
  - Discriminated enrichment outputs — `biorxiv_search_preprints` results carry `enriched` plus a typed `enrichment_error` (`service_error` / `rate_limited` / `not_found`) so callers branch on data, not string parsing
121
131
  - Paging and pagination state — `exhausted` cursors are flagged as an out-of-range artifact rather than an empty interval, and `biorxiv_get_fulltext` reports `totalChars` / `remainingChars` / `hasMore` for chunked reads
132
+ - Clean titles and abstracts — Highwire export markup is resolved to plain text on both surfaces: symbol placeholders (`{beta}`, `{+/-}`, `[&ge;]`) become their characters, structured-abstract headings read `Results: …`, list items read `• …`, and figure and table blocks are dropped. The Markdown in `content[]` escapes upstream text so it renders as written
122
133
 
123
134
  ## Getting started
124
135
 
@@ -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
@@ -0,0 +1,22 @@
1
+ ---
2
+ summary: "Adds a bioRxiv funder filter and awards field, defaults biorxiv_list_recent to omit abstracts, and cleans Highwire markup from titles and abstracts"
3
+ breaking: true
4
+ security: false
5
+ ---
6
+
7
+ # 0.3.0 — 2026-09-22
8
+
9
+ ## Added
10
+
11
+ - **`funder` filter on `biorxiv_list_recent`** — a ROR id, normalized and checksum-checked before any call. bioRxiv-only: narrows `server="both"` to bioRxiv and raises `invalid_funder` for `server="medrxiv"` or an id `api.biorxiv.org` holds no record for ([#52](https://github.com/cyanheads/biorxiv-mcp-server/issues/52)).
12
+ - **`include_abstract`** on `biorxiv_list_recent` (default `false`) and `biorxiv_search_preprints` (default `true`) — drops the abstract from `structuredContent` and `content[]` together, no other field changes. Callers reading `abstract` from `biorxiv_list_recent` must now pass `include_abstract: true` ([#49](https://github.com/cyanheads/biorxiv-mcp-server/issues/49)).
13
+ - **`biorxiv_search_preprints` fallback abstracts** — a record that falls back to EuropePMC metadata now gets its abstract from one DOI-keyed `resultType=core` lookup (`EuropePmcService.getAbstracts`); a failed lookup degrades like enrichment, with a notice ([#55](https://github.com/cyanheads/biorxiv-mcp-server/issues/55)).
14
+ - **`normalizeUpstreamText`** resolves Highwire symbol placeholders and fused section headings through closed tables in `upstream-text-tables.ts`, renders `O_ST_ABS` headings and `O_LI` list items as plain text, and drops table blocks (`O_TBL`) alongside existing figure handling. `escapeMarkdown` escapes upstream text at `format()` interpolation so `content[]` renders it literally ([#48](https://github.com/cyanheads/biorxiv-mcp-server/issues/48)).
15
+
16
+ ## Changed
17
+
18
+ - **`awards: string[]`** replaces `funder` on `biorxiv_get_preprint`, `biorxiv_list_recent`, and `biorxiv_search_preprints` — upstream funder `name`s and ROR `id`s are misattributed to unrelated organizations, so only the verbatim, deduplicated `award` values are kept. Callers reading `funder` must switch to `awards` ([#54](https://github.com/cyanheads/biorxiv-mcp-server/issues/54)).
19
+
20
+ ## Fixed
21
+
22
+ - **`normalizeUpstreamText` inline-tag stripping** no longer splices a tag together from the text around a removed one: `<scr<i>ipt>` stays as sent instead of becoming `<script>`.
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ await createApp({
16
16
  tools: [...allToolDefinitions],
17
17
  resources: [],
18
18
  prompts: [],
19
- instructions: 'bioRxiv/medRxiv preprints, addressed by 10.1101/ DOI and searched across both servers by default. Find preprints with biorxiv_search_preprints (keyword or author, ranked by EuropePMC) or biorxiv_list_recent (a date interval, filtered by a category string from biorxiv_list_categories). Resolve a DOI with biorxiv_get_preprint for metadata and revisions, biorxiv_get_fulltext for the article body as Markdown, and biorxiv_get_published_version for the journal crosswalk once a preprint has been published.',
19
+ instructions: 'bioRxiv/medRxiv preprints, addressed by 10.1101/ DOI and searched across both servers by default. Find preprints with biorxiv_search_preprints (keyword or author, ranked by EuropePMC) or biorxiv_list_recent (a date interval, filtered by a category string from biorxiv_list_categories and, on bioRxiv, by a funder ROR ID). Resolve a DOI with biorxiv_get_preprint for metadata and revisions, biorxiv_get_fulltext for the article body as Markdown, and biorxiv_get_published_version for the journal crosswalk once a preprint has been published.',
20
20
  // Stateless HTTP: no tool gates on ctx.requestInput, so no session store is needed.
21
21
  sessionMode: 'stateless',
22
22
  // Public hosted catalog — serve full landing inventory even when MCP_AUTH_MODE=jwt/oauth.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,oBAAoB;IAC3B,KAAK,EAAE,CAAC,GAAG,kBAAkB,CAAC;IAC9B,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EACV,0fAA0f;IAC5f,oFAAoF;IACpF,WAAW,EAAE,WAAW;IACxB,0FAA0F;IAC1F,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAC/B,KAAK,CAAC,IAAI;QACR,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,0BAA0B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACxD,CAAC;CACF,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,MAAM,SAAS,CAAC;IACd,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,oBAAoB;IAC3B,KAAK,EAAE,CAAC,GAAG,kBAAkB,CAAC;IAC9B,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;IACX,YAAY,EACV,8hBAA8hB;IAChiB,oFAAoF;IACpF,WAAW,EAAE,WAAW;IACxB,0FAA0F;IAC1F,OAAO,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE;IAC/B,KAAK,CAAC,IAAI;QACR,qBAAqB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,0BAA0B,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IACxD,CAAC;CACF,CAAC,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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+ZjC,CAAC"}