@cyanheads/biorxiv-mcp-server 0.2.6 → 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 (58) hide show
  1. package/AGENTS.md +51 -24
  2. package/CLAUDE.md +51 -24
  3. package/Dockerfile +9 -7
  4. package/README.md +76 -60
  5. package/changelog/0.2.x/0.2.7.md +35 -0
  6. package/changelog/0.2.x/0.2.8.md +26 -0
  7. package/changelog/template.md +9 -26
  8. package/dist/config/server-config.d.ts +8 -6
  9. package/dist/config/server-config.d.ts.map +1 -1
  10. package/dist/config/server-config.js +10 -12
  11. package/dist/config/server-config.js.map +1 -1
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.js +6 -7
  14. package/dist/index.js.map +1 -1
  15. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts +18 -5
  16. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js +87 -33
  18. package/dist/mcp-server/tools/definitions/biorxiv-get-fulltext.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts +4 -2
  20. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js +19 -12
  22. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts +19 -9
  24. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js +125 -40
  26. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.js +1 -1
  28. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.js.map +1 -1
  29. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts +5 -2
  30. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js +76 -47
  32. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts +12 -1
  34. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts.map +1 -1
  35. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js +33 -6
  36. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js.map +1 -1
  37. package/dist/mcp-server/tools/definitions/index.d.ts +30 -11
  38. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  39. package/dist/services/biorxiv/biorxiv-service.d.ts +27 -4
  40. package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -1
  41. package/dist/services/biorxiv/biorxiv-service.js +105 -47
  42. package/dist/services/biorxiv/biorxiv-service.js.map +1 -1
  43. package/dist/services/biorxiv/types.d.ts +5 -0
  44. package/dist/services/biorxiv/types.d.ts.map +1 -1
  45. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts +6 -3
  46. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts.map +1 -1
  47. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js +6 -7
  48. package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js.map +1 -1
  49. package/dist/services/europe-pmc/europe-pmc-service.d.ts +7 -3
  50. package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
  51. package/dist/services/europe-pmc/europe-pmc-service.js +55 -13
  52. package/dist/services/europe-pmc/europe-pmc-service.js.map +1 -1
  53. package/dist/services/shared.d.ts +23 -1
  54. package/dist/services/shared.d.ts.map +1 -1
  55. package/dist/services/shared.js +45 -1
  56. package/dist/services/shared.js.map +1 -1
  57. package/package.json +14 -13
  58. package/server.json +9 -3
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.6-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
 
@@ -19,11 +19,19 @@
19
19
 
20
20
  </div>
21
21
 
22
+ <div align="center">
23
+
24
+ **Public Hosted Server:** [https://biorxiv.caseyjhand.com/mcp](https://biorxiv.caseyjhand.com/mcp)
25
+
26
+ </div>
27
+
22
28
  ---
23
29
 
24
- ## Tools
30
+ ## Overview
31
+
32
+ bioRxiv and medRxiv preprint metadata and full text, searchable via EuropePMC. Fetch preprints by DOI, browse by date interval or subject category, search by keyword and author, resolve journal-publication crosswalks, and extract full text from the rendered article page, from any MCP client. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
25
33
 
26
- Six tools for working with bioRxiv and medRxiv preprint data:
34
+ ### Tools
27
35
 
28
36
  | Tool | Description |
29
37
  |:---|:---|
@@ -34,101 +42,107 @@ Six tools for working with bioRxiv and medRxiv preprint data:
34
42
  | `biorxiv_get_fulltext` | Retrieve a preprint's full text as best-effort Markdown extracted from its rendered HTML article page |
35
43
  | `biorxiv_list_categories` | List valid subject category strings for bioRxiv and medRxiv |
36
44
 
37
- ### `biorxiv_get_preprint`
45
+ ## Capability reference
38
46
 
39
- Fetch preprint metadata by DOI — all revisions in one call.
47
+ ### `biorxiv_get_preprint` <sub>tool</sub>
40
48
 
41
49
  - Batch fetch up to 10 DOIs in a single request
42
- - Each DOI returns the full revision history in `collection[]` — one API call per DOI, no enumeration loop
43
- - Includes title, authors, abstract, category, license, JATS XML full-text link (`jatsxml`), and published journal DOI when the preprint has been accepted
44
- - Scope to `biorxiv`, `medrxiv`, or `both`; when `both`, each DOI fans out in parallel and partial failures report per-DOI in `failed[]`
45
- - Each `failed[]` entry carries a `reason` (`not_found`, `invalid_doi_format`, `upstream_unavailable`, `rate_limited`) and a `retryable` flag — a DOI is only reported as not found when every attempted server answered
46
- - A lookup the origin rate-limited (HTTP 429) reports as `rate_limited` rather than folding into `upstream_unavailable`, and carries `retryAfter` — the wait in seconds `api.biorxiv.org` asked for
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
51
+ - Each DOI returns its full revision history in `revisions[]` — one API call per DOI, no enumeration loop
52
+ - Includes title, authors, abstract, category, license, JATS XML full-text link (`jatsxmlUrl`), and published journal DOI (`publishedJournalDoi`) once accepted
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[]`
54
+ - 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
55
+ - 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
47
56
 
48
57
  ---
49
58
 
50
- ### `biorxiv_list_recent`
51
-
52
- Page through preprints in a date interval.
59
+ ### `biorxiv_list_recent` <sub>tool</sub>
53
60
 
54
- - Server-side category filtering via `?category=…` — 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
55
63
  - Fixed page size of 30 (API constraint); advance with integer `cursor` (0, 30, 60, …)
56
- - Response includes `total` count per server for calculating remaining pages
57
- - When `server="both"`, each server paginates independently; response surfaces per-server pagination state (`{ biorxiv: { cursor, total }, medrxiv: { cursor, total } }`)
58
- - A server whose cursor is past its last page is marked `exhausted: true` — the API reports `total: 0` for an out-of-range cursor, so that count is an artifact rather than the interval total
59
- - One server not answering under `server="both"` is named in `failed[]` rather than dropped; the other server's page is still returned, and a non-empty `failed[]` marks the result set as partial
60
- - Every attempted server failing raises a retryable `upstream_unavailable` (or `rate_limited`) error instead of returning an empty page — nothing answered, so an empty interval was never established
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
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
66
+ - Every attempted server failing raises a retryable `upstream_unavailable` (or `rate_limited`) error instead of an empty page
61
67
 
62
68
  ---
63
69
 
64
- ### `biorxiv_search_preprints`
70
+ ### `biorxiv_search_preprints` <sub>tool</sub>
65
71
 
66
- Keyword and/or author search with relevance ranking.
67
-
68
- - EuropePMC powers relevance ranking (indexes new preprints within 1–2 days of posting); bioRxiv/medRxiv API provides canonical metadata enrichment
69
- - Optional `author` maps to an EuropePMC `AUTH:"…"` field query, ANDed with the keyword query — supply `query`, `author`, or both
70
- - Covers both servers by default; scope down with `server`
71
- - Optional date range filters (`date_from`, `date_to`)
72
- - Enriched results carry the same latest-revision fields `biorxiv_get_preprint` returns — including `type`, `license`, `funder`, and `authorCorrespondingInstitution`
73
- - Enrichment failures degrade gracefully to EuropePMC-only metadata, surfaced via `partial_results` and a per-record `enrichment_error` (`service_error`, `rate_limited`, or `not_found`)
74
- - A EuropePMC rate limit (HTTP 429) raises a retryable `rate_limited` error carrying the origin's `Retry-After` wait — the search is the primary call and has no metadata to fall back on, unlike the enrichment step
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`)
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`
75
+ - EuropePMC powers relevance ranking (indexes new preprints within 1–2 days of posting); the bioRxiv/medRxiv API enriches matches with canonical metadata
76
+ - Enriched results carry the same latest-revision fields as `biorxiv_get_preprint`, including `type`, `license`, `funder`, and `authorCorrespondingInstitution`
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`)
78
+ - 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
75
79
 
76
80
  ---
77
81
 
78
- ### `biorxiv_get_published_version`
79
-
80
- Resolve a preprint DOI to its journal publication crosswalk.
82
+ ### `biorxiv_get_published_version` <sub>tool</sub>
81
83
 
82
- - Uses the `/pubs/{server}/{doi}` endpoint for richer metadata than the `publishedJournalDoi` field in `biorxiv_get_preprint`
83
- - Returns journal DOI, journal name, published date, and corresponding author institution
84
- - Use when the preprint's `publishedJournalDoi` field is present and you need the full crosswalk record
85
- - Scope to `biorxiv`, `medrxiv`, or `both`; `both` is the default because the two servers share the `10.1101/` DOI prefix, and the output `server` field names the one that answered
86
- - No server answering raises a retryable `upstream_unavailable`, or `rate_limited` with the origin's wait when the failure was an HTTP 429 — never `doi_not_found`, which would assert an absence nothing established
84
+ - Uses the `/pubs/{server}/{doi}` endpoint for richer metadata than the `publishedJournalDoi` field on `biorxiv_get_preprint`
85
+ - Returns journal DOI, journal name, published date, and corresponding-author institution; the output `server` field names which server answered (never `"both"`)
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
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
87
89
 
88
90
  ---
89
91
 
90
- ### `biorxiv_get_fulltext`
91
-
92
- Retrieve a preprint's full text as best-effort Markdown.
92
+ ### `biorxiv_get_fulltext` <sub>tool</sub>
93
93
 
94
94
  - Fetches the rendered HTML article page (`www.{server}.org/content/{doi}v{N}.full`) and extracts Markdown — there is no keyless JATS source
95
- - Resolves the latest version via the details API first, for the URL version and clean not-found handling
96
- - Scope to `biorxiv`, `medrxiv`, or `both`; `both` is the default because the two servers share the `10.1101/` DOI prefix. Only the DOI resolution fans out — the full-text fetch targets the single server that answered, named in the output `server` field
97
- - Long articles page via `offset`/`limit` character chunking (`totalChars`, `remainingChars`, `hasMore`); the extracted article is cached per version, so paging costs one origin fetch rather than one per chunk
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
98
97
  - PDF-only preprints and blocked/challenge pages return a typed `fulltext_unavailable` error routing to `biorxiv_get_preprint`
99
- - An origin rate limit (HTTP 429) returns a retryable `rate_limited` error carrying the origin's `Retry-After` wait, rather than a bare fetch failure. Both origins this tool touches can hit it — the article page during the full-text fetch, `api.biorxiv.org` during version resolution — and the recovery hint names which of them are limiting, since `biorxiv_get_preprint` is only a useful fallback while the metadata origin is answering
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
100
99
 
101
100
  ---
102
101
 
103
- ### `biorxiv_list_categories`
104
-
105
- Return the static subject category taxonomy for both servers.
102
+ ### `biorxiv_list_categories` <sub>tool</sub>
106
103
 
107
- - 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
108
105
  - Use to validate category strings before passing to `biorxiv_list_recent`
109
106
 
110
107
  ## Features
111
108
 
112
- Built on [`@cyanheads/mcp-ts-core`](https://www.npmjs.com/package/@cyanheads/mcp-ts-core):
113
-
114
- - Declarative tool definitions — single file per tool, framework handles registration and validation
115
- - Unified error handling across all tools
116
- - Pluggable auth (`none`, `jwt`, `oauth`)
117
- - Swappable storage backends: `in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`
118
- - Structured logging with optional OpenTelemetry tracing
119
- - STDIO and Streamable HTTP transports
109
+ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): stdio and Streamable HTTP transports, pluggable auth (`none` / `jwt` / `oauth`), swappable storage (`in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`), structured logging with optional OpenTelemetry tracing.
120
110
 
121
111
  bioRxiv-specific:
122
112
 
123
- - `BiorxivApiService` wraps `api.biorxiv.org` — details, publications, and crosswalk endpoints with retry and exponential backoff. An origin rate limit (HTTP 429) is classified as a retryable `rate_limited` error carrying the parsed `Retry-After` wait; the upstream response body never reaches the error payload
124
- - `EuropePmcService` wraps the EuropePMC search endpoint for relevance-ranked keyword and/or author results. An origin rate limit (HTTP 429) is classified the same way as the JSON API's — a retryable `rate_limited` error carrying the parsed `Retry-After` wait, with the upstream response body kept out of the error payload
113
+ - `BiorxivApiService` wraps `api.biorxiv.org` — details, publications, and crosswalk endpoints with retry and exponential backoff; a 429 is classified as a retryable `rate_limited` error carrying the parsed `Retry-After` wait, with the upstream response body kept out of the payload
114
+ - `EuropePmcService` wraps the EuropePMC search endpoint for relevance-ranked keyword and/or author results, classified the same way on a 429
125
115
  - `BiorxivFullTextService` fetches and extracts Markdown from the rendered HTML article pages on `www.biorxiv.org` / `www.medrxiv.org` — a distinct origin from the JSON API
126
116
  - Two-server fan-out via `Promise.allSettled` — both `biorxiv` and `medrxiv` queried in parallel when `server="both"`, results merged and deduplicated by DOI
127
117
  - Polite `User-Agent` header including a mailto address (`BIORXIV_MAILTO` env var) per Cold Spring Harbor Lab API guidelines
128
118
  - Pairs with **pubmed-mcp-server** (post-publication), **openalex-mcp-server** (citation analytics), and **crossref-mcp-server** (DOI metadata)
129
119
 
120
+ Agent-friendly output:
121
+
122
+ - Graceful partial failure — per-DOI and per-server failures land in `failed[]` with a typed `reason` and `retryable` flag instead of aborting the whole batch or listing call
123
+ - 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`
124
+ - 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
125
+ - 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
126
+
130
127
  ## Getting started
131
128
 
129
+ ### Public Hosted Instance
130
+
131
+ A public instance is available at `https://biorxiv.caseyjhand.com/mcp` — no installation required. Point any MCP client at it via Streamable HTTP:
132
+
133
+ ```json
134
+ {
135
+ "mcpServers": {
136
+ "biorxiv-mcp-server": {
137
+ "type": "streamable-http",
138
+ "url": "https://biorxiv.caseyjhand.com/mcp"
139
+ }
140
+ }
141
+ }
142
+ ```
143
+
144
+ ### Self-Hosted / Local
145
+
132
146
  Add the following to your MCP client configuration file.
133
147
 
134
148
  ```json
@@ -190,7 +204,7 @@ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 BIORXIV_MAILTO=your@email.com bun run
190
204
 
191
205
  ### Prerequisites
192
206
 
193
- - [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+).
207
+ - [Bun v1.4.0](https://bun.sh/) or higher (or Node.js v24+).
194
208
 
195
209
  ### Installation
196
210
 
@@ -238,6 +252,8 @@ All configuration is validated at startup via Zod schemas in `src/config/server-
238
252
  | `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |
239
253
  | `OTEL_ENABLED` | Enable OpenTelemetry instrumentation. | `false` |
240
254
 
255
+ See [`.env.example`](./.env.example) for the full list of optional overrides.
256
+
241
257
  ## Running the server
242
258
 
243
259
  ### Local development
@@ -294,7 +310,7 @@ See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rule
294
310
 
295
311
  ## Contributing
296
312
 
297
- Issues and pull requests are welcome. Run checks and tests before submitting:
313
+ Issues are welcome. Run checks and tests before submitting:
298
314
 
299
315
  ```sh
300
316
  bun run devcheck
@@ -0,0 +1,35 @@
1
+ ---
2
+ summary: "Adopts mcp-ts-core 0.13.5 — date-key parameter aliases, richer tool-error text, and a stateless HTTP session default"
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.2.7 — 2026-09-19
8
+
9
+ ## Added
10
+
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
+ - **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.
14
+
15
+ ## Changed
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).
18
+ - **Tool error text** closes with `(reason <reason>)`, plus ` · not retryable` when `data.retryable` is false (0.13.5).
19
+ - **Upstream 5xx handling** — an HTTP 500 now retries as `ServiceUnavailable`; a 501 does not retry (0.12.4).
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).
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.
22
+ - Graceful shutdown — `SIGTERM`/`SIGINT` now end the process explicitly (0.13.1).
23
+ - Server `instructions` rewritten to name `biorxiv_get_fulltext`.
24
+ - Repo tooling — Bun engines floor raised to `>=1.4.0`; skill tree moved `skills/` → `framework-skills/`; `.env.example` corrections; issue-form length budgets tightened.
25
+
26
+ ## Dependencies
27
+
28
+ - `@cyanheads/mcp-ts-core` ^0.12.3 → ^0.13.5
29
+ - `zod` ^4.4.3 → ^4.6.5
30
+ - `defuddle` ^0.19.2 → ^0.19.3
31
+ - `@biomejs/biome` 2.5.10 → 2.5.14
32
+ - `@types/node` 26.2.0 → 26.6.1
33
+ - `ignore` ^7.0.6 → ^7.0.9
34
+ - `tsc-alias` ^1.9.2 → ^1.9.5
35
+ - `vitest` ^4.1.11 → ^5.0.1
@@ -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
@@ -6,8 +6,8 @@
6
6
 
7
7
  # Required. One-line GitHub Release-style headline. 350 character cap — a
8
8
  # ceiling, not a target. Default short and scannable. Don't pad, don't stitch
9
- # unrelated changes with commas/semicolons into an inventory — pick the
10
- # headline, like a tag's theme line. Quotes required: unquoted YAML treats
9
+ # unrelated changes with commas/semicolons into an inventory — pick the one
10
+ # headline the release is about. Quotes required: unquoted YAML treats
11
11
  # `: ` inside the value as a key separator and fails GitHub's strict parser.
12
12
  summary: ""
13
13
 
@@ -117,30 +117,13 @@ security: false
117
117
  in that unrelated item's metadata.
118
118
 
119
119
  TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
120
- via `gh release create --notes-from-tag`. The tag is a derivative of this
121
- changelog entry — a condensed, scannable version, not a copy. Format:
122
-
123
- <theme — omit version number, GitHub prepends it>
124
- ← blank line
125
- <1-2 sentence context: what this release does>
126
- ← blank line
127
- Dependency bumps: ← section header
128
- ← blank line
129
- - `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
130
- ← blank line
131
- Changed: ← only sections with entries
132
- ← blank line
133
- - `format()` output includes `query` in text mode
134
- ← blank line
135
- Added:
136
- ← blank line
137
- - `manifest.json` scaffolded for MCPB bundle support
138
- - Install badges (Claude Desktop, Cursor, VS Code)
139
- ← blank line
140
- <N> tests pass; `bun run devcheck` clean. ← footer
141
-
142
- Never a flat comma-separated string. Always structured markdown with
143
- sections. The tag must scan well as a rendered GitHub Release page.
120
+ via `gh release create --notes-from-tag`. It is a condensed digest of this
121
+ entry, never a copy, and its format is owned by the `release-and-publish`
122
+ skill (step 4, "Create the annotated tag"): a short subject line without the
123
+ version, flat headline bullets — no Keep-a-Changelog section headers, no
124
+ gates line — at most one deps line, issue backlinks, and the changelog link
125
+ last. In release-PR mode the `git-wrapup` skill authors those bullets as the
126
+ PR body's `## Changes` and the tag copies them.
144
127
  -->
145
128
 
146
129
  ## Added
@@ -2,16 +2,18 @@
2
2
  * @fileoverview Server-specific configuration for biorxiv-mcp-server. Parses
3
3
  * domain env vars (BIORXIV_MAILTO, BIORXIV_API_BASE_URL, EUROPEPMC_API_BASE_URL,
4
4
  * BIORXIV_WEB_BASE_URL, MEDRXIV_WEB_BASE_URL) separately from the framework's
5
- * core config. Lazy-parsed on first access.
5
+ * core config. Lazy-parsed on first access. `parseEnvConfig` reads an empty
6
+ * value or an unsubstituted MCPB `${user_config.X}` placeholder as unset, so a
7
+ * blank optional field falls through to its default.
6
8
  * @module config/server-config
7
9
  */
8
10
  import { z } from '@cyanheads/mcp-ts-core';
9
11
  declare const ServerConfigSchema: z.ZodObject<{
10
- mailto: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
11
- apiBaseUrl: z.ZodDefault<z.ZodString>;
12
- europePmcBaseUrl: z.ZodDefault<z.ZodString>;
13
- biorxivWebBaseUrl: z.ZodPreprocess<z.ZodDefault<z.ZodString>>;
14
- medrxivWebBaseUrl: z.ZodPreprocess<z.ZodDefault<z.ZodString>>;
12
+ mailto: z.ZodOptional<z.ZodEmail>;
13
+ apiBaseUrl: z.ZodDefault<z.ZodURL>;
14
+ europePmcBaseUrl: z.ZodDefault<z.ZodURL>;
15
+ biorxivWebBaseUrl: z.ZodDefault<z.ZodURL>;
16
+ medrxivWebBaseUrl: z.ZodDefault<z.ZodURL>;
15
17
  }, z.core.$strip>;
16
18
  export type ServerConfig = z.infer<typeof ServerConfigSchema>;
17
19
  export declare function getServerConfig(): ServerConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAW3C,QAAA,MAAM,kBAAkB;;;;;;iBAsBtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAS9C;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
1
+ {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;;;iBAwBtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAS9C;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -2,34 +2,32 @@
2
2
  * @fileoverview Server-specific configuration for biorxiv-mcp-server. Parses
3
3
  * domain env vars (BIORXIV_MAILTO, BIORXIV_API_BASE_URL, EUROPEPMC_API_BASE_URL,
4
4
  * BIORXIV_WEB_BASE_URL, MEDRXIV_WEB_BASE_URL) separately from the framework's
5
- * core config. Lazy-parsed on first access.
5
+ * core config. Lazy-parsed on first access. `parseEnvConfig` reads an empty
6
+ * value or an unsubstituted MCPB `${user_config.X}` placeholder as unset, so a
7
+ * blank optional field falls through to its default.
6
8
  * @module config/server-config
7
9
  */
8
10
  import { z } from '@cyanheads/mcp-ts-core';
9
11
  import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
10
- /**
11
- * An unsubstituted MCPB placeholder (`${user_config.X}`) reads back as a literal
12
- * string when the user leaves the optional field blank. Strip it to undefined so
13
- * the field falls through to its default instead of failing format validation.
14
- */
15
- const stripMcpbPlaceholder = (v) => typeof v === 'string' && v.startsWith('${') ? undefined : v;
16
12
  const ServerConfigSchema = z.object({
17
13
  mailto: z
18
- .preprocess(stripMcpbPlaceholder, z.string().email().optional())
14
+ .email()
15
+ .optional()
19
16
  .describe('Contact email for User-Agent header — optional, used for polite API access'),
20
- apiBaseUrl: z.string().url().default('https://api.biorxiv.org').describe('bioRxiv API base URL'),
17
+ apiBaseUrl: z.url().default('https://api.biorxiv.org').describe('bioRxiv API base URL'),
21
18
  europePmcBaseUrl: z
22
- .string()
23
19
  .url()
24
20
  .default('https://www.ebi.ac.uk/europepmc/webservices/rest')
25
21
  .describe('EuropePMC REST API base URL'),
26
22
  // Full-text HTML lives on the public websites, not the JSON API host — a
27
23
  // distinct origin per server. Overridable for testing or mirrors.
28
24
  biorxivWebBaseUrl: z
29
- .preprocess(stripMcpbPlaceholder, z.string().url().default('https://www.biorxiv.org'))
25
+ .url()
26
+ .default('https://www.biorxiv.org')
30
27
  .describe('bioRxiv website base URL — source of rendered full-text HTML pages for biorxiv_get_fulltext'),
31
28
  medrxivWebBaseUrl: z
32
- .preprocess(stripMcpbPlaceholder, z.string().url().default('https://www.medrxiv.org'))
29
+ .url()
30
+ .default('https://www.medrxiv.org')
33
31
  .describe('medRxiv website base URL — source of rendered full-text HTML pages for biorxiv_get_fulltext'),
34
32
  });
35
33
  let _config;
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,oBAAoB,GAAG,CAAC,CAAU,EAAW,EAAE,CACnD,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;AAE9D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC;SACN,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC;SAC/D,QAAQ,CAAC,4EAA4E,CAAC;IACzF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IAChG,gBAAgB,EAAE,CAAC;SAChB,MAAM,EAAE;SACR,GAAG,EAAE;SACL,OAAO,CAAC,kDAAkD,CAAC;SAC3D,QAAQ,CAAC,6BAA6B,CAAC;IAC1C,yEAAyE;IACzE,kEAAkE;IAClE,iBAAiB,EAAE,CAAC;SACjB,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;SACrF,QAAQ,CACP,6FAA6F,CAC9F;IACH,iBAAiB,EAAE,CAAC;SACjB,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;SACrF,QAAQ,CACP,6FAA6F,CAC9F;CACJ,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,MAAM,EAAE,gBAAgB;QACxB,UAAU,EAAE,sBAAsB;QAClC,gBAAgB,EAAE,wBAAwB;QAC1C,iBAAiB,EAAE,sBAAsB;QACzC,iBAAiB,EAAE,sBAAsB;KAC1C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC"}
1
+ {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC;SACN,KAAK,EAAE;SACP,QAAQ,EAAE;SACV,QAAQ,CAAC,4EAA4E,CAAC;IACzF,UAAU,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IACvF,gBAAgB,EAAE,CAAC;SAChB,GAAG,EAAE;SACL,OAAO,CAAC,kDAAkD,CAAC;SAC3D,QAAQ,CAAC,6BAA6B,CAAC;IAC1C,yEAAyE;IACzE,kEAAkE;IAClE,iBAAiB,EAAE,CAAC;SACjB,GAAG,EAAE;SACL,OAAO,CAAC,yBAAyB,CAAC;SAClC,QAAQ,CACP,6FAA6F,CAC9F;IACH,iBAAiB,EAAE,CAAC;SACjB,GAAG,EAAE;SACL,OAAO,CAAC,yBAAyB,CAAC;SAClC,QAAQ,CACP,6FAA6F,CAC9F;CACJ,CAAC,CAAC;AAIH,IAAI,OAAiC,CAAC;AAEtC,MAAM,UAAU,eAAe;IAC7B,OAAO,KAAK,cAAc,CAAC,kBAAkB,EAAE;QAC7C,MAAM,EAAE,gBAAgB;QACxB,UAAU,EAAE,sBAAsB;QAClC,gBAAgB,EAAE,wBAAwB;QAC1C,iBAAiB,EAAE,sBAAsB;QACzC,iBAAiB,EAAE,sBAAsB;KAC1C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @fileoverview biorxiv-mcp-server entry point. Initializes BiorxivApiService
4
- * and EuropePmcService in setup(), then registers all tool definitions with
5
- * createApp().
3
+ * @fileoverview biorxiv-mcp-server entry point. Initializes BiorxivApiService,
4
+ * EuropePmcService, and BiorxivFullTextService in setup(), then registers all
5
+ * tool definitions with createApp().
6
6
  * @module index
7
7
  */
8
8
  export {};
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @fileoverview biorxiv-mcp-server entry point. Initializes BiorxivApiService
4
- * and EuropePmcService in setup(), then registers all tool definitions with
5
- * createApp().
3
+ * @fileoverview biorxiv-mcp-server entry point. Initializes BiorxivApiService,
4
+ * EuropePmcService, and BiorxivFullTextService in setup(), then registers all
5
+ * tool definitions with createApp().
6
6
  * @module index
7
7
  */
8
8
  import { createApp } from '@cyanheads/mcp-ts-core';
@@ -16,10 +16,9 @@ await createApp({
16
16
  tools: [...allToolDefinitions],
17
17
  resources: [],
18
18
  prompts: [],
19
- instructions: 'bioRxiv/medRxiv preprint server. Start with biorxiv_list_categories to see valid category strings for filtering. ' +
20
- 'Use biorxiv_list_recent for date-range browsing, biorxiv_get_preprint for DOI lookup, ' +
21
- 'biorxiv_search_preprints for keyword search (powered by EuropePMC), and ' +
22
- 'biorxiv_get_published_version for full crosswalk metadata when a preprint has been accepted to a journal.',
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.',
20
+ // Stateless HTTP: no tool gates on ctx.requestInput, so no session store is needed.
21
+ sessionMode: 'stateless',
23
22
  // Public hosted catalog — serve full landing inventory even when MCP_AUTH_MODE=jwt/oauth.
24
23
  landing: { requireAuth: false },
25
24
  setup(core) {
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,mHAAmH;QACnH,wFAAwF;QACxF,0EAA0E;QAC1E,2GAA2G;IAC7G,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,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,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"}