@cyanheads/biorxiv-mcp-server 0.1.5

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 (63) hide show
  1. package/AGENTS.md +309 -0
  2. package/CLAUDE.md +309 -0
  3. package/Dockerfile +99 -0
  4. package/LICENSE +195 -0
  5. package/README.md +279 -0
  6. package/changelog/0.1.x/0.1.0.md +18 -0
  7. package/changelog/0.1.x/0.1.1.md +32 -0
  8. package/changelog/0.1.x/0.1.2.md +23 -0
  9. package/changelog/0.1.x/0.1.3.md +23 -0
  10. package/changelog/0.1.x/0.1.4.md +19 -0
  11. package/changelog/0.1.x/0.1.5.md +18 -0
  12. package/changelog/template.md +93 -0
  13. package/dist/biorxiv-mcp-server.mcpb +0 -0
  14. package/dist/config/server-config.d.ts +17 -0
  15. package/dist/config/server-config.d.ts.map +1 -0
  16. package/dist/config/server-config.js +34 -0
  17. package/dist/config/server-config.js.map +1 -0
  18. package/dist/index.d.ts +9 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +25 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts +54 -0
  23. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.d.ts.map +1 -0
  24. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js +208 -0
  25. package/dist/mcp-server/tools/definitions/biorxiv-get-preprint.tool.js.map +1 -0
  26. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts +39 -0
  27. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.d.ts.map +1 -0
  28. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js +99 -0
  29. package/dist/mcp-server/tools/definitions/biorxiv-get-published-version.tool.js.map +1 -0
  30. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.d.ts +13 -0
  31. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.d.ts.map +1 -0
  32. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.js +40 -0
  33. package/dist/mcp-server/tools/definitions/biorxiv-list-categories.tool.js.map +1 -0
  34. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts +65 -0
  35. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.d.ts.map +1 -0
  36. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js +269 -0
  37. package/dist/mcp-server/tools/definitions/biorxiv-list-recent.tool.js.map +1 -0
  38. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts +46 -0
  39. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.d.ts.map +1 -0
  40. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js +279 -0
  41. package/dist/mcp-server/tools/definitions/biorxiv-search-preprints.tool.js.map +1 -0
  42. package/dist/mcp-server/tools/definitions/index.d.ts +171 -0
  43. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -0
  44. package/dist/mcp-server/tools/definitions/index.js +23 -0
  45. package/dist/mcp-server/tools/definitions/index.js.map +1 -0
  46. package/dist/services/biorxiv/biorxiv-service.d.ts +39 -0
  47. package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -0
  48. package/dist/services/biorxiv/biorxiv-service.js +307 -0
  49. package/dist/services/biorxiv/biorxiv-service.js.map +1 -0
  50. package/dist/services/biorxiv/types.d.ts +127 -0
  51. package/dist/services/biorxiv/types.d.ts.map +1 -0
  52. package/dist/services/biorxiv/types.js +9 -0
  53. package/dist/services/biorxiv/types.js.map +1 -0
  54. package/dist/services/europe-pmc/europe-pmc-service.d.ts +36 -0
  55. package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -0
  56. package/dist/services/europe-pmc/europe-pmc-service.js +100 -0
  57. package/dist/services/europe-pmc/europe-pmc-service.js.map +1 -0
  58. package/dist/services/europe-pmc/types.d.ts +33 -0
  59. package/dist/services/europe-pmc/types.d.ts.map +1 -0
  60. package/dist/services/europe-pmc/types.js +8 -0
  61. package/dist/services/europe-pmc/types.js.map +1 -0
  62. package/package.json +102 -0
  63. package/server.json +111 -0
@@ -0,0 +1,19 @@
1
+ ---
2
+ summary: "Field-test bug fixes: DOI encoding, funder parsing, pagination total, EuropePMC server filter, date validation, User-Agent, new DOI prefix."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.1.4 — 2026-05-23
8
+
9
+ Seven bugs found in field-testing, all affecting core functionality.
10
+
11
+ ## Fixed
12
+
13
+ - **DOI encoding** — `biorxiv-service.ts` now encodes DOI segments individually (`doi.split('/').map(encodeURIComponent).join('/')`) instead of calling `encodeURIComponent` on the full DOI string; the slash separating prefix and suffix was being double-encoded, causing all lookups to 404.
14
+ - **Funder field** — `normalizeRevision` now handles `funder` as either a plain string or an array of `{ name, id, award }` objects; previously, an array payload would surface as `"[object Object]"`.
15
+ - **Pagination total** — `messages[0].total` is a string in real API responses (e.g. `"915"`); `parseInt` now parses it correctly. Was always 0 before this fix.
16
+ - **EuropePMC server filter** — `biorxiv-search-preprints` now uses `PUBLISHER:bioRxiv` / `PUBLISHER:medRxiv` field syntax instead of `PUBLISHER:"Cold Spring Harbor Laboratory"`, which is not a valid EuropePMC field and returned no results.
17
+ - **Date validation** — `biorxiv_search_preprints` now validates `date_from` and `date_to` against `YYYY-MM-DD` format before calling EuropePMC; invalid dates were previously passed through silently and returned 0 results.
18
+ - **User-Agent** — `EuropePmcService` no longer emits `mailto:undefined` in the `User-Agent` header when `BIORXIV_MAILTO` is unset; the mailto segment is now omitted entirely when the env var is absent.
19
+ - **DOI prefix** — `BIORXIV_DOI_PREFIXES` expanded to include `10.64898/` (new bioRxiv prefix introduced in 2025); papers under this prefix were being misidentified as medRxiv and enriched against the wrong server.
@@ -0,0 +1,18 @@
1
+ ---
2
+ summary: "Pre-launch polish: code simplification in list-recent tool and Europe PMC service, Docker docs added, AGENTS.md added, import order and comment cleanup."
3
+ breaking: false
4
+ ---
5
+
6
+ # 0.1.5 — 2026-05-23
7
+
8
+ ## Changed
9
+
10
+ - **`biorxiv-list-recent.tool.ts`** — extracted duplicated `nextCursor` calculation into a `toPaginationEntry` helper, eliminating three copies of the same block; widened `PreprintForFormat` mapped type to drop the unnecessary `doi`-specific branch.
11
+ - **`europe-pmc-service.ts`** — replaced the imperative `for` loop over raw results with a `filter`+`map` chain using a type predicate; removed two inline comments that added no signal; moved `import` statements before the `asRc` helper to match the module's natural declaration order.
12
+ - **`biorxiv-service.ts`** — moved the `asRc` helper below framework imports to align with module declaration order; tightened the comment to remove the cross-file reference.
13
+ - **`biorxiv-list-recent.tool.ts`** — updated `canvas_id` field description to clarify the `CANVAS_PROVIDER_TYPE=duckdb` prerequisite.
14
+ - **`README.md`** — added Docker usage section with build/run example and Dockerfile defaults; reordered badge row to match standard layout (Version, License, Docker, MCP SDK, npm, TypeScript, Bun).
15
+ - **`AGENTS.md`** — added as a copy of `CLAUDE.md` for non-Claude agent runtimes; included in `package.json` `files[]`.
16
+ - **`.env.example`** — added DataCanvas env var comment block.
17
+ - **`bunfig.toml`** — added Bun workspace/test configuration.
18
+ - **`Dockerfile`** — minor update.
@@ -0,0 +1,93 @@
1
+ ---
2
+ # FORMAT REFERENCE — do not edit. Copy this file to
3
+ # `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.8.x/0.8.6.md`)
4
+ # to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
5
+ # with a concrete date.
6
+
7
+ # Required. One-line GitHub Release-style headline. 350 character cap.
8
+ # Default short and scannable. Don't pad, don't stitch unrelated changes with
9
+ # semicolons — pick the headline. Quotes required: unquoted YAML treats `: `
10
+ # inside the value as a key separator and fails GitHub's strict parser.
11
+ summary: ""
12
+
13
+ # Set `true` when consumers must change code to upgrade: API removals,
14
+ # signature changes, config renames, behavior changes that break existing
15
+ # usage. Flagged as `Breaking` in the rollup.
16
+ breaking: false
17
+
18
+ # Set `true` if this release contains any security fix. Pairs with the
19
+ # `## Security` section below. Flagged as `Security` in the rollup so
20
+ # users can triage upgrade urgency at a glance.
21
+ security: false
22
+ ---
23
+
24
+ # <version> — YYYY-MM-DD
25
+
26
+ <!--
27
+ AUTHORING GUIDE — applies to the new per-version file you create from this
28
+ template.
29
+
30
+ Audience: someone scanning release notes to decide what affects them. Lead
31
+ each bullet with the symbol or concept name in **bold** so they can skip
32
+ what's irrelevant and zoom in on what's not.
33
+
34
+ Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
35
+ name the symbol, state what changed, stop. Use a second sentence only when
36
+ it carries weight. If a bullet feels long, it is.
37
+
38
+ Cut: mechanism walkthroughs (those belong in JSDoc, AGENTS.md, or the
39
+ relevant skill), ceremonial framings ("This release introduces…",
40
+ backwards-compat paragraphs), file-by-file test enumerations, internal
41
+ implementation notes. Prefer code/symbol names over English re-explanations.
42
+
43
+ Narrative intro: skip by default. Add one short sentence only when the
44
+ release theme genuinely needs framing the bullets can't carry.
45
+
46
+ Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
47
+ Fixed, Security. Include only sections with entries; delete the rest
48
+ (including the commented-out scaffolding below). Don't ship empty headers.
49
+
50
+ Include: every distinct fact a reader needs to adopt or audit the release —
51
+ new exports, signatures, lint rule IDs, env vars, breaking changes, version
52
+ bumps on shipped skills. Nothing more.
53
+
54
+ Links: link issues, PRs, docs, or skills where they help a reader jump to
55
+ context. Once per item per entry — don't re-link the same issue in summary,
56
+ narrative, and bullet. Skip links for inline symbol names; code spans speak
57
+ for themselves.
58
+
59
+ Issue/PR URLs: use full URLs. GitHub's bare `#NN` auto-link only resolves
60
+ inside its own UI, not in npm reads or local editors.
61
+
62
+ [#38](https://github.com/cyanheads/mcp-ts-core/issues/38) ← issue
63
+ [#42](https://github.com/cyanheads/mcp-ts-core/pull/42) ← PR
64
+
65
+ Verify numbers exist before linking (`gh issue view NN`, `gh pr view NN`).
66
+ Never speculate on a future number — `#42` for an upcoming PR silently
67
+ resolves to whatever real item already owns 42, and timeline previews pull
68
+ in that unrelated item's metadata.
69
+ -->
70
+
71
+ ## Added
72
+
73
+ -
74
+
75
+ ## Changed
76
+
77
+ -
78
+
79
+ <!-- ## Deprecated
80
+
81
+ - -->
82
+
83
+ <!-- ## Removed
84
+
85
+ - -->
86
+
87
+ ## Fixed
88
+
89
+ -
90
+
91
+ <!-- ## Security
92
+
93
+ - -->
Binary file
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @fileoverview Server-specific configuration for biorxiv-mcp-server. Parses
3
+ * domain env vars (BIORXIV_MAILTO, BIORXIV_API_BASE_URL, EUROPEPMC_API_BASE_URL)
4
+ * separately from the framework's core config. Lazy-parsed on first access.
5
+ * @module config/server-config
6
+ */
7
+ import { z } from '@cyanheads/mcp-ts-core';
8
+ declare const ServerConfigSchema: z.ZodObject<{
9
+ mailto: z.ZodOptional<z.ZodString>;
10
+ apiBaseUrl: z.ZodDefault<z.ZodString>;
11
+ europePmcBaseUrl: z.ZodDefault<z.ZodString>;
12
+ }, z.core.$strip>;
13
+ export type ServerConfig = z.infer<typeof ServerConfigSchema>;
14
+ export declare function getServerConfig(): ServerConfig;
15
+ export declare function resetServerConfig(): void;
16
+ export {};
17
+ //# sourceMappingURL=server-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAG3C,QAAA,MAAM,kBAAkB;;;;iBAYtB,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,wBAAgB,eAAe,IAAI,YAAY,CAO9C;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAExC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @fileoverview Server-specific configuration for biorxiv-mcp-server. Parses
3
+ * domain env vars (BIORXIV_MAILTO, BIORXIV_API_BASE_URL, EUROPEPMC_API_BASE_URL)
4
+ * separately from the framework's core config. Lazy-parsed on first access.
5
+ * @module config/server-config
6
+ */
7
+ import { z } from '@cyanheads/mcp-ts-core';
8
+ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
9
+ const ServerConfigSchema = z.object({
10
+ mailto: z
11
+ .string()
12
+ .email()
13
+ .optional()
14
+ .describe('Contact email for User-Agent header — optional, used for polite API access'),
15
+ apiBaseUrl: z.string().url().default('https://api.biorxiv.org').describe('bioRxiv API base URL'),
16
+ europePmcBaseUrl: z
17
+ .string()
18
+ .url()
19
+ .default('https://www.ebi.ac.uk/europepmc/webservices/rest')
20
+ .describe('EuropePMC REST API base URL'),
21
+ });
22
+ let _config;
23
+ export function getServerConfig() {
24
+ _config ??= parseEnvConfig(ServerConfigSchema, {
25
+ mailto: 'BIORXIV_MAILTO',
26
+ apiBaseUrl: 'BIORXIV_API_BASE_URL',
27
+ europePmcBaseUrl: 'EUROPEPMC_API_BASE_URL',
28
+ });
29
+ return _config;
30
+ }
31
+ export function resetServerConfig() {
32
+ _config = undefined;
33
+ }
34
+ //# sourceMappingURL=server-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server-config.js","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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,MAAM,EAAE;SACR,KAAK,EAAE;SACP,QAAQ,EAAE;SACV,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;CAC3C,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;KAC3C,CAAC,CAAC;IACH,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,OAAO,GAAG,SAAS,CAAC;AACtB,CAAC"}
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview biorxiv-mcp-server entry point. Initializes BiorxivApiService
4
+ * and EuropePmcService in setup(), then registers all tool definitions with
5
+ * createApp().
6
+ * @module index
7
+ */
8
+ export {};
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;GAKG"}
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @fileoverview biorxiv-mcp-server entry point. Initializes BiorxivApiService
4
+ * and EuropePmcService in setup(), then registers all tool definitions with
5
+ * createApp().
6
+ * @module index
7
+ */
8
+ import { createApp } from '@cyanheads/mcp-ts-core';
9
+ import { allToolDefinitions } from './mcp-server/tools/definitions/index.js';
10
+ import { initBiorxivApiService } from './services/biorxiv/biorxiv-service.js';
11
+ import { initEuropePmcService } from './services/europe-pmc/europe-pmc-service.js';
12
+ await createApp({
13
+ tools: [...allToolDefinitions],
14
+ resources: [],
15
+ prompts: [],
16
+ instructions: 'bioRxiv/medRxiv preprint server. Start with biorxiv_list_categories to see valid category strings for filtering. ' +
17
+ 'Use biorxiv_list_recent for date-range browsing, biorxiv_get_preprint for DOI lookup, ' +
18
+ 'biorxiv_search_preprints for keyword search (powered by EuropePMC), and ' +
19
+ 'biorxiv_get_published_version for full crosswalk metadata when a preprint has been accepted to a journal.',
20
+ setup(core) {
21
+ initBiorxivApiService(core.config, core.storage);
22
+ initEuropePmcService(core.config, core.storage);
23
+ },
24
+ });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAEnF,MAAM,SAAS,CAAC;IACd,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,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;IAClD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @fileoverview biorxiv_get_preprint tool — fetches full metadata, abstract,
3
+ * all revision history, and published-journal DOI for one or more preprints
4
+ * by DOI. Each DOI call returns all revisions in a single response. When
5
+ * server="both", each DOI fans out across bioRxiv and medRxiv in parallel;
6
+ * per-DOI failures are reported in failed[] rather than aborting the batch.
7
+ * @module mcp-server/tools/definitions/biorxiv-get-preprint.tool
8
+ */
9
+ import { z } from '@cyanheads/mcp-ts-core';
10
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
11
+ export declare const biorxivGetPreprintTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
12
+ dois: z.ZodArray<z.ZodString>;
13
+ server: z.ZodDefault<z.ZodEnum<{
14
+ biorxiv: "biorxiv";
15
+ medrxiv: "medrxiv";
16
+ both: "both";
17
+ }>>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ preprints: z.ZodArray<z.ZodObject<{
20
+ doi: z.ZodString;
21
+ revisions: z.ZodArray<z.ZodObject<{
22
+ doi: z.ZodString;
23
+ title: z.ZodOptional<z.ZodString>;
24
+ authors: z.ZodOptional<z.ZodString>;
25
+ authorCorresponding: z.ZodOptional<z.ZodString>;
26
+ authorCorrespondingInstitution: z.ZodOptional<z.ZodString>;
27
+ date: z.ZodOptional<z.ZodString>;
28
+ version: z.ZodOptional<z.ZodString>;
29
+ type: z.ZodOptional<z.ZodString>;
30
+ license: z.ZodOptional<z.ZodString>;
31
+ category: z.ZodOptional<z.ZodString>;
32
+ jatsxmlUrl: z.ZodOptional<z.ZodString>;
33
+ abstract: z.ZodOptional<z.ZodString>;
34
+ funder: z.ZodOptional<z.ZodString>;
35
+ publishedJournalDoi: z.ZodOptional<z.ZodString>;
36
+ server: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>>;
38
+ }, z.core.$strip>>;
39
+ failed: z.ZodArray<z.ZodObject<{
40
+ doi: z.ZodString;
41
+ error: z.ZodString;
42
+ }, z.core.$strip>>;
43
+ }, z.core.$strip>, readonly [{
44
+ readonly reason: "doi_not_found";
45
+ readonly code: JsonRpcErrorCode.NotFound;
46
+ readonly when: "ALL requested DOIs resolve to empty collections on all requested servers.";
47
+ readonly recovery: "Verify the DOI format (must start with 10.1101/) and check it exists on bioRxiv or medRxiv.";
48
+ }, {
49
+ readonly reason: "invalid_doi_format";
50
+ readonly code: JsonRpcErrorCode.ValidationError;
51
+ readonly when: "One or more input DOIs do not match the 10.NNNN/ pattern.";
52
+ readonly recovery: "Correct the DOI format — bioRxiv DOIs start with 10.1101/ followed by the manuscript ID.";
53
+ }]>;
54
+ //# sourceMappingURL=biorxiv-get-preprint.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-get-preprint.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-preprint.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA8DjE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+JjC,CAAC"}
@@ -0,0 +1,208 @@
1
+ /**
2
+ * @fileoverview biorxiv_get_preprint tool — fetches full metadata, abstract,
3
+ * all revision history, and published-journal DOI for one or more preprints
4
+ * by DOI. Each DOI call returns all revisions in a single response. When
5
+ * server="both", each DOI fans out across bioRxiv and medRxiv in parallel;
6
+ * per-DOI failures are reported in failed[] rather than aborting the batch.
7
+ * @module mcp-server/tools/definitions/biorxiv-get-preprint.tool
8
+ */
9
+ import { tool, z } from '@cyanheads/mcp-ts-core';
10
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
11
+ import { getBiorxivApiService } from '../../../services/biorxiv/biorxiv-service.js';
12
+ const DOI_REGEX = /^10\.\d{4,}\//;
13
+ function formatRevision(r) {
14
+ const lines = [];
15
+ lines.push(`#### v${r.version ?? '?'} — ${r.date ?? 'unknown date'}`);
16
+ lines.push(`**DOI:** ${r.doi}`);
17
+ if (r.type)
18
+ lines.push(`**Type:** ${r.type}`);
19
+ if (r.license)
20
+ lines.push(`**License:** ${r.license}`);
21
+ if (r.jatsxmlUrl)
22
+ lines.push(`**JATS XML:** ${r.jatsxmlUrl}`);
23
+ if (r.publishedJournalDoi)
24
+ lines.push(`**Published Journal DOI:** ${r.publishedJournalDoi}`);
25
+ if (r.abstract)
26
+ lines.push(`\n**Abstract:** ${r.abstract}`);
27
+ return lines.join('\n');
28
+ }
29
+ function formatPreprint(doi, revisions) {
30
+ if (revisions.length === 0)
31
+ return '';
32
+ const latest = revisions[revisions.length - 1];
33
+ const lines = [];
34
+ lines.push(`### ${latest?.title ?? doi}`);
35
+ lines.push(`**DOI:** ${doi}`);
36
+ if (latest?.server)
37
+ lines.push(`**Server:** ${latest.server}`);
38
+ if (latest?.category)
39
+ lines.push(`**Category:** ${latest.category}`);
40
+ if (latest?.authors)
41
+ lines.push(`**Authors:** ${latest.authors}`);
42
+ if (latest?.authorCorresponding)
43
+ lines.push(`**Corresponding:** ${latest.authorCorresponding}`);
44
+ if (latest?.authorCorrespondingInstitution)
45
+ lines.push(`**Institution:** ${latest.authorCorrespondingInstitution}`);
46
+ if (latest?.funder)
47
+ lines.push(`**Funder:** ${latest.funder}`);
48
+ if (latest?.publishedJournalDoi)
49
+ lines.push(`**Published Journal DOI:** ${latest.publishedJournalDoi}`);
50
+ lines.push(`\n#### Revisions (${revisions.length} total)`);
51
+ for (const rev of revisions) {
52
+ lines.push('');
53
+ lines.push(formatRevision(rev));
54
+ }
55
+ return lines.join('\n');
56
+ }
57
+ const RevisionSchema = z.object({
58
+ doi: z.string().describe('Preprint DOI.'),
59
+ title: z.string().optional().describe('Title.'),
60
+ authors: z.string().optional().describe('Author list.'),
61
+ authorCorresponding: z.string().optional().describe('Corresponding author name.'),
62
+ authorCorrespondingInstitution: z
63
+ .string()
64
+ .optional()
65
+ .describe('Corresponding author institution.'),
66
+ date: z.string().optional().describe('Revision date (YYYY-MM-DD).'),
67
+ version: z.string().optional().describe('Revision version number.'),
68
+ type: z.string().optional().describe('Preprint type.'),
69
+ license: z.string().optional().describe('License identifier.'),
70
+ category: z.string().optional().describe('Subject category.'),
71
+ jatsxmlUrl: z.string().optional().describe('URL to the JATS XML full-text.'),
72
+ abstract: z.string().optional().describe('Abstract text.'),
73
+ funder: z.string().optional().describe('Funder information.'),
74
+ publishedJournalDoi: z.string().optional().describe('Published journal DOI when accepted.'),
75
+ server: z.string().optional().describe('Source server (biorxiv or medrxiv).'),
76
+ });
77
+ export const biorxivGetPreprintTool = tool('biorxiv_get_preprint', {
78
+ title: 'Get Preprint by DOI',
79
+ description: 'Fetch full metadata, abstract, all revision history, full-text/PDF links, and published-journal DOI for one or more preprints by DOI. Each DOI returns all revisions in one response. When server="both" (default), each DOI is checked against both bioRxiv and medRxiv; the response includes which server the preprint was found on. Per-DOI failures are surfaced in failed[] rather than aborting the batch. DOIs must match the pattern 10.NNNN/…',
80
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
81
+ input: z.object({
82
+ dois: z
83
+ .array(z
84
+ .string()
85
+ .describe('Preprint DOI (e.g. 10.1101/2024.01.15.575123 or 10.64898/2026.05.07.723463).'))
86
+ .min(1)
87
+ .max(10)
88
+ .describe('One or more preprint DOIs to look up (max 10).'),
89
+ server: z
90
+ .enum(['biorxiv', 'medrxiv', 'both'])
91
+ .default('both')
92
+ .describe('Server to query. "both" checks bioRxiv and medRxiv in parallel for each DOI.'),
93
+ }),
94
+ output: z.object({
95
+ preprints: z
96
+ .array(z
97
+ .object({
98
+ doi: z.string().describe('The requested DOI.'),
99
+ revisions: z
100
+ .array(RevisionSchema.describe('A single preprint revision.'))
101
+ .describe('All revisions for this preprint, earliest first.'),
102
+ })
103
+ .describe('A preprint and all its revisions.'))
104
+ .describe('Successfully resolved preprints with their full revision history.'),
105
+ failed: z
106
+ .array(z
107
+ .object({
108
+ doi: z.string().describe('DOI that failed to resolve.'),
109
+ error: z.string().describe('Error description.'),
110
+ })
111
+ .describe('A DOI that failed to resolve.'))
112
+ .describe('DOIs that could not be resolved, with per-DOI error details.'),
113
+ }),
114
+ errors: [
115
+ {
116
+ reason: 'doi_not_found',
117
+ code: JsonRpcErrorCode.NotFound,
118
+ when: 'ALL requested DOIs resolve to empty collections on all requested servers.',
119
+ recovery: 'Verify the DOI format (must start with 10.1101/) and check it exists on bioRxiv or medRxiv.',
120
+ },
121
+ {
122
+ reason: 'invalid_doi_format',
123
+ code: JsonRpcErrorCode.ValidationError,
124
+ when: 'One or more input DOIs do not match the 10.NNNN/ pattern.',
125
+ recovery: 'Correct the DOI format — bioRxiv DOIs start with 10.1101/ followed by the manuscript ID.',
126
+ },
127
+ ],
128
+ async handler(input, ctx) {
129
+ ctx.log.info('Executing biorxiv_get_preprint', {
130
+ doiCount: input.dois.length,
131
+ server: input.server,
132
+ });
133
+ // Validate all DOIs up front
134
+ const badDois = input.dois.filter((d) => !DOI_REGEX.test(d));
135
+ if (badDois.length > 0) {
136
+ throw ctx.fail('invalid_doi_format', `Invalid DOI format: ${badDois.join(', ')}`, {
137
+ badDois,
138
+ ...ctx.recoveryFor('invalid_doi_format'),
139
+ });
140
+ }
141
+ const service = getBiorxivApiService();
142
+ const preprints = [];
143
+ const failed = [];
144
+ // For each DOI, fan out across servers in parallel
145
+ await Promise.all(input.dois.map(async (doi) => {
146
+ try {
147
+ let revisions = [];
148
+ if (input.server === 'both') {
149
+ const [bxResult, mxResult] = await Promise.allSettled([
150
+ service.getDetails(doi, 'biorxiv', ctx),
151
+ service.getDetails(doi, 'medrxiv', ctx),
152
+ ]);
153
+ if (bxResult.status === 'fulfilled')
154
+ revisions.push(...bxResult.value);
155
+ if (mxResult.status === 'fulfilled')
156
+ revisions.push(...mxResult.value);
157
+ // If both failed, surface the error
158
+ if (bxResult.status === 'rejected' && mxResult.status === 'rejected') {
159
+ throw bxResult.reason instanceof Error
160
+ ? bxResult.reason
161
+ : new Error(String(bxResult.reason));
162
+ }
163
+ }
164
+ else {
165
+ revisions = await service.getDetails(doi, input.server, ctx);
166
+ }
167
+ if (revisions.length > 0) {
168
+ preprints.push({ doi, revisions });
169
+ }
170
+ else if (input.server !== 'both') {
171
+ failed.push({ doi, error: `Not found on ${input.server}.` });
172
+ }
173
+ else {
174
+ failed.push({ doi, error: 'Not found on bioRxiv or medRxiv.' });
175
+ }
176
+ }
177
+ catch (err) {
178
+ failed.push({
179
+ doi,
180
+ error: err instanceof Error ? err.message : String(err),
181
+ });
182
+ }
183
+ }));
184
+ // All DOIs failed → throw declared error
185
+ if (preprints.length === 0 && failed.length === input.dois.length) {
186
+ throw ctx.fail('doi_not_found', `None of the requested DOIs were found: ${input.dois.join(', ')}`, { ...ctx.recoveryFor('doi_not_found') });
187
+ }
188
+ return { preprints, failed };
189
+ },
190
+ format: (result) => {
191
+ const lines = [];
192
+ if (result.preprints.length > 0) {
193
+ lines.push(`## Preprints (${result.preprints.length})`);
194
+ for (const p of result.preprints) {
195
+ lines.push('');
196
+ lines.push(formatPreprint(p.doi, p.revisions));
197
+ }
198
+ }
199
+ if (result.failed.length > 0) {
200
+ lines.push('\n## Failed DOIs');
201
+ for (const f of result.failed) {
202
+ lines.push(`- **${f.doi}**: ${f.error}`);
203
+ }
204
+ }
205
+ return [{ type: 'text', text: lines.join('\n') || 'No results.' }];
206
+ },
207
+ });
208
+ //# sourceMappingURL=biorxiv-get-preprint.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-get-preprint.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-preprint.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,SAAS,cAAc,CAAC,CAAmB;IACzC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,IAAI,GAAG,MAAM,CAAC,CAAC,IAAI,IAAI,cAAc,EAAE,CAAC,CAAC;IACtE,KAAK,CAAC,IAAI,CAAC,YAA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AE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAC/B,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QAED,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;IACrE,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @fileoverview biorxiv_get_published_version tool — resolves a preprint DOI
3
+ * to its full journal publication record using the /pubs endpoint. Use when
4
+ * you need richer crosswalk metadata than biorxiv_get_preprint provides
5
+ * (journal name, published date, full abstract, corresponding author details).
6
+ * @module mcp-server/tools/definitions/biorxiv-get-published-version.tool
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ export declare const biorxivGetPublishedVersionTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
11
+ doi: z.ZodString;
12
+ server: z.ZodDefault<z.ZodEnum<{
13
+ biorxiv: "biorxiv";
14
+ medrxiv: "medrxiv";
15
+ }>>;
16
+ }, z.core.$strip>, z.ZodObject<{
17
+ preprintDoi: z.ZodString;
18
+ publishedDoi: z.ZodOptional<z.ZodString>;
19
+ publishedJournal: z.ZodOptional<z.ZodString>;
20
+ publishedDate: z.ZodOptional<z.ZodString>;
21
+ preprintTitle: z.ZodOptional<z.ZodString>;
22
+ preprintAuthors: z.ZodOptional<z.ZodString>;
23
+ preprintCategory: z.ZodOptional<z.ZodString>;
24
+ preprintDate: z.ZodOptional<z.ZodString>;
25
+ preprintAbstract: z.ZodOptional<z.ZodString>;
26
+ preprintAuthorCorresponding: z.ZodOptional<z.ZodString>;
27
+ preprintAuthorCorrespondingInstitution: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>, readonly [{
29
+ readonly reason: "doi_not_found";
30
+ readonly code: JsonRpcErrorCode.NotFound;
31
+ readonly when: "Crosswalk endpoint returns empty collection — preprint may not be published yet.";
32
+ readonly recovery: "Use biorxiv_get_preprint to check the published field. If it shows NA, the preprint is not yet published.";
33
+ }, {
34
+ readonly reason: "invalid_doi_format";
35
+ readonly code: JsonRpcErrorCode.ValidationError;
36
+ readonly when: "The input DOI does not match the 10.NNNN/ pattern.";
37
+ readonly recovery: "Correct the DOI format — bioRxiv DOIs start with 10.1101/ followed by the manuscript ID.";
38
+ }]>;
39
+ //# sourceMappingURL=biorxiv-get-published-version.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-get-published-version.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-published-version.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKjE,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGzC,CAAC"}