@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,99 @@
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 { tool, z } from '@cyanheads/mcp-ts-core';
9
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
10
+ import { getBiorxivApiService } from '../../../services/biorxiv/biorxiv-service.js';
11
+ const DOI_REGEX = /^10\.\d{4,}\//;
12
+ export const biorxivGetPublishedVersionTool = tool('biorxiv_get_published_version', {
13
+ title: 'Get Published Journal Version',
14
+ description: "Resolve a preprint DOI to its full journal publication record — journal DOI, journal name, published date, and corresponding author details. Use when the preprint's `published` field from biorxiv_get_preprint is non-null and you need the full crosswalk metadata. Returns a not-found error when the preprint is not yet published. Check biorxiv_get_preprint first to confirm the published field is populated.",
15
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
16
+ input: z.object({
17
+ doi: z
18
+ .string()
19
+ .describe('Preprint DOI to resolve (e.g. 10.1101/2024.01.15.575123 or 10.64898/2026.05.07.723463).'),
20
+ server: z
21
+ .enum(['biorxiv', 'medrxiv'])
22
+ .default('biorxiv')
23
+ .describe('Server the preprint was posted on. Defaults to biorxiv.'),
24
+ }),
25
+ output: z.object({
26
+ preprintDoi: z.string().describe('The preprint DOI that was resolved.'),
27
+ publishedDoi: z.string().optional().describe('The journal publication DOI.'),
28
+ publishedJournal: z.string().optional().describe('Name of the publishing journal.'),
29
+ publishedDate: z.string().optional().describe('Journal publication date (YYYY-MM-DD).'),
30
+ preprintTitle: z.string().optional().describe('Title of the preprint.'),
31
+ preprintAuthors: z.string().optional().describe('Preprint author list.'),
32
+ preprintCategory: z.string().optional().describe('Subject category.'),
33
+ preprintDate: z.string().optional().describe('Date the preprint was first posted.'),
34
+ preprintAbstract: z.string().optional().describe('Preprint abstract.'),
35
+ preprintAuthorCorresponding: z.string().optional().describe('Corresponding author name.'),
36
+ preprintAuthorCorrespondingInstitution: z
37
+ .string()
38
+ .optional()
39
+ .describe('Corresponding author institution.'),
40
+ }),
41
+ errors: [
42
+ {
43
+ reason: 'doi_not_found',
44
+ code: JsonRpcErrorCode.NotFound,
45
+ when: 'Crosswalk endpoint returns empty collection — preprint may not be published yet.',
46
+ recovery: 'Use biorxiv_get_preprint to check the published field. If it shows NA, the preprint is not yet published.',
47
+ },
48
+ {
49
+ reason: 'invalid_doi_format',
50
+ code: JsonRpcErrorCode.ValidationError,
51
+ when: 'The input DOI does not match the 10.NNNN/ pattern.',
52
+ recovery: 'Correct the DOI format — bioRxiv DOIs start with 10.1101/ followed by the manuscript ID.',
53
+ },
54
+ ],
55
+ async handler(input, ctx) {
56
+ ctx.log.info('Executing biorxiv_get_published_version', {
57
+ doi: input.doi,
58
+ server: input.server,
59
+ });
60
+ if (!DOI_REGEX.test(input.doi)) {
61
+ throw ctx.fail('invalid_doi_format', `Invalid DOI format: ${input.doi}`, {
62
+ ...ctx.recoveryFor('invalid_doi_format'),
63
+ });
64
+ }
65
+ const service = getBiorxivApiService();
66
+ const result = await service.getPublishedVersion(input.doi, input.server, ctx);
67
+ if (!result) {
68
+ throw ctx.fail('doi_not_found', `No published version found for ${input.doi} on ${input.server}.`, { doi: input.doi, server: input.server, ...ctx.recoveryFor('doi_not_found') });
69
+ }
70
+ return result;
71
+ },
72
+ format: (result) => {
73
+ const lines = [];
74
+ lines.push(`## Published Version`);
75
+ lines.push(`**Preprint DOI:** ${result.preprintDoi}`);
76
+ if (result.publishedDoi)
77
+ lines.push(`**Published DOI:** ${result.publishedDoi}`);
78
+ if (result.publishedJournal)
79
+ lines.push(`**Journal:** ${result.publishedJournal}`);
80
+ if (result.publishedDate)
81
+ lines.push(`**Published Date:** ${result.publishedDate}`);
82
+ if (result.preprintTitle)
83
+ lines.push(`\n**Title:** ${result.preprintTitle}`);
84
+ if (result.preprintAuthors)
85
+ lines.push(`**Authors:** ${result.preprintAuthors}`);
86
+ if (result.preprintCategory)
87
+ lines.push(`**Category:** ${result.preprintCategory}`);
88
+ if (result.preprintDate)
89
+ lines.push(`**Preprint Date:** ${result.preprintDate}`);
90
+ if (result.preprintAuthorCorresponding)
91
+ lines.push(`**Corresponding Author:** ${result.preprintAuthorCorresponding}`);
92
+ if (result.preprintAuthorCorrespondingInstitution)
93
+ lines.push(`**Institution:** ${result.preprintAuthorCorrespondingInstitution}`);
94
+ if (result.preprintAbstract)
95
+ lines.push(`\n**Abstract:**\n${result.preprintAbstract}`);
96
+ return [{ type: 'text', text: lines.join('\n') }];
97
+ },
98
+ });
99
+ //# sourceMappingURL=biorxiv-get-published-version.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-get-published-version.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-get-published-version.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,SAAS,GAAG,eAAe,CAAC;AAElC,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,CAAC,+BAA+B,EAAE;IAClF,KAAK,EAAE,+BAA+B;IACtC,WAAW,EACT,wZAAwZ;IAC1Z,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE;IAE9E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,GAAG,EAAE,CAAC;aACH,MAAM,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gBAAgB;YAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC;QACvF,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @fileoverview biorxiv_list_categories tool — returns the static subject
3
+ * category taxonomy for bioRxiv and medRxiv. These strings are the valid values
4
+ * for the `category` filter parameter in biorxiv_list_recent. No API call is
5
+ * made; the taxonomy is maintained as a hardcoded list in BiorxivApiService.
6
+ * @module mcp-server/tools/definitions/biorxiv-list-categories.tool
7
+ */
8
+ import { z } from '@cyanheads/mcp-ts-core';
9
+ export declare const biorxivListCategoriesTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
10
+ biorxiv: z.ZodArray<z.ZodString>;
11
+ medrxiv: z.ZodArray<z.ZodString>;
12
+ }, z.core.$strip>, undefined>;
13
+ //# sourceMappingURL=biorxiv-list-categories.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-list-categories.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-list-categories.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAGjD,eAAO,MAAM,yBAAyB;;;6BAkCpC,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @fileoverview biorxiv_list_categories tool — returns the static subject
3
+ * category taxonomy for bioRxiv and medRxiv. These strings are the valid values
4
+ * for the `category` filter parameter in biorxiv_list_recent. No API call is
5
+ * made; the taxonomy is maintained as a hardcoded list in BiorxivApiService.
6
+ * @module mcp-server/tools/definitions/biorxiv-list-categories.tool
7
+ */
8
+ import { tool, z } from '@cyanheads/mcp-ts-core';
9
+ import { getBiorxivApiService } from '../../../services/biorxiv/biorxiv-service.js';
10
+ export const biorxivListCategoriesTool = tool('biorxiv_list_categories', {
11
+ title: 'List bioRxiv/medRxiv Categories',
12
+ description: 'List valid subject category strings for bioRxiv and medRxiv. Use these strings as the `category` filter in biorxiv_list_recent to narrow results to a specific field. The taxonomy is static and maintained in-server; run this tool before filtering to get the current valid values.',
13
+ annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: false },
14
+ input: z.object({}),
15
+ output: z.object({
16
+ biorxiv: z
17
+ .array(z.string().describe('Subject category name'))
18
+ .describe('bioRxiv subject categories'),
19
+ medrxiv: z
20
+ .array(z.string().describe('Subject category name'))
21
+ .describe('medRxiv subject categories'),
22
+ }),
23
+ handler(_input, ctx) {
24
+ ctx.log.info('Executing biorxiv_list_categories');
25
+ return getBiorxivApiService().getCategories();
26
+ },
27
+ format: (result) => [
28
+ {
29
+ type: 'text',
30
+ text: [
31
+ `## bioRxiv Categories (${result.biorxiv.length})`,
32
+ result.biorxiv.map((c) => `- ${c}`).join('\n'),
33
+ '',
34
+ `## medRxiv Categories (${result.medrxiv.length})`,
35
+ result.medrxiv.map((c) => `- ${c}`).join('\n'),
36
+ ].join('\n'),
37
+ },
38
+ ],
39
+ });
40
+ //# sourceMappingURL=biorxiv-list-categories.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-list-categories.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-list-categories.tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC,yBAAyB,EAAE;IACvE,KAAK,EAAE,iCAAiC;IACxC,WAAW,EACT,wRAAwR;IAC1R,WAAW,EAAE,EAAE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date interval. Fans out to both bioRxiv and medRxiv when
4
+ * server="both". Category filtering is applied server-side via the ?category=
5
+ * query param. Returns 30 results per page (API-fixed); use cursor to paginate.
6
+ * When server="both", per-server pagination state is surfaced independently.
7
+ * Large result sets spill to DataCanvas when CANVAS_PROVIDER_TYPE=duckdb.
8
+ * @module mcp-server/tools/definitions/biorxiv-list-recent.tool
9
+ */
10
+ import { z } from '@cyanheads/mcp-ts-core';
11
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
12
+ export declare const biorxivListRecentTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
13
+ start_date: z.ZodString;
14
+ end_date: z.ZodString;
15
+ server: z.ZodDefault<z.ZodEnum<{
16
+ biorxiv: "biorxiv";
17
+ medrxiv: "medrxiv";
18
+ both: "both";
19
+ }>>;
20
+ category: z.ZodOptional<z.ZodString>;
21
+ cursor: z.ZodDefault<z.ZodNumber>;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ preprints: z.ZodArray<z.ZodObject<{
24
+ doi: z.ZodString;
25
+ title: z.ZodOptional<z.ZodString>;
26
+ authors: z.ZodOptional<z.ZodString>;
27
+ authorCorresponding: z.ZodOptional<z.ZodString>;
28
+ authorCorrespondingInstitution: z.ZodOptional<z.ZodString>;
29
+ date: z.ZodOptional<z.ZodString>;
30
+ version: z.ZodOptional<z.ZodString>;
31
+ type: z.ZodOptional<z.ZodString>;
32
+ license: z.ZodOptional<z.ZodString>;
33
+ category: z.ZodOptional<z.ZodString>;
34
+ jatsxmlUrl: z.ZodOptional<z.ZodString>;
35
+ abstract: z.ZodOptional<z.ZodString>;
36
+ funder: z.ZodOptional<z.ZodString>;
37
+ publishedJournalDoi: z.ZodOptional<z.ZodString>;
38
+ server: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>>;
40
+ pagination: z.ZodObject<{
41
+ biorxiv: z.ZodOptional<z.ZodObject<{
42
+ cursor: z.ZodNumber;
43
+ total: z.ZodNumber;
44
+ nextCursor: z.ZodOptional<z.ZodNumber>;
45
+ }, z.core.$strip>>;
46
+ medrxiv: z.ZodOptional<z.ZodObject<{
47
+ cursor: z.ZodNumber;
48
+ total: z.ZodNumber;
49
+ nextCursor: z.ZodOptional<z.ZodNumber>;
50
+ }, z.core.$strip>>;
51
+ }, z.core.$strip>;
52
+ canvas_id: z.ZodOptional<z.ZodString>;
53
+ message: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strip>, readonly [{
55
+ readonly reason: "invalid_date_range";
56
+ readonly code: JsonRpcErrorCode.ValidationError;
57
+ readonly when: "end_date is before start_date, or either date is malformed.";
58
+ readonly recovery: "Provide valid YYYY-MM-DD dates where start_date is on or before end_date.";
59
+ }, {
60
+ readonly reason: "invalid_category";
61
+ readonly code: JsonRpcErrorCode.ValidationError;
62
+ readonly when: "The supplied category string is not in the taxonomy.";
63
+ readonly recovery: "Call biorxiv_list_categories to get valid category strings and retry.";
64
+ }]>;
65
+ //# sourceMappingURL=biorxiv-list-recent.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-list-recent.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-list-recent.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AA+BjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwShC,CAAC"}
@@ -0,0 +1,269 @@
1
+ /**
2
+ * @fileoverview biorxiv_list_recent tool — lists preprints posted or revised
3
+ * within a date interval. Fans out to both bioRxiv and medRxiv when
4
+ * server="both". Category filtering is applied server-side via the ?category=
5
+ * query param. Returns 30 results per page (API-fixed); use cursor to paginate.
6
+ * When server="both", per-server pagination state is surfaced independently.
7
+ * Large result sets spill to DataCanvas when CANVAS_PROVIDER_TYPE=duckdb.
8
+ * @module mcp-server/tools/definitions/biorxiv-list-recent.tool
9
+ */
10
+ import { tool, z } from '@cyanheads/mcp-ts-core';
11
+ import { spillover } from '@cyanheads/mcp-ts-core/canvas';
12
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
13
+ import { getBiorxivApiService } from '../../../services/biorxiv/biorxiv-service.js';
14
+ const DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
15
+ function formatPreprint(p) {
16
+ const lines = [];
17
+ lines.push(`### ${p.title ?? p.doi}`);
18
+ lines.push(`**DOI:** ${p.doi}`);
19
+ if (p.date)
20
+ lines.push(`**Date:** ${p.date}`);
21
+ if (p.version)
22
+ lines.push(`**Version:** ${p.version}`);
23
+ if (p.type)
24
+ lines.push(`**Type:** ${p.type}`);
25
+ if (p.server)
26
+ lines.push(`**Server:** ${p.server}`);
27
+ if (p.category)
28
+ lines.push(`**Category:** ${p.category}`);
29
+ if (p.license)
30
+ lines.push(`**License:** ${p.license}`);
31
+ if (p.authors)
32
+ lines.push(`**Authors:** ${p.authors}`);
33
+ if (p.authorCorresponding)
34
+ lines.push(`**Corresponding:** ${p.authorCorresponding}`);
35
+ if (p.authorCorrespondingInstitution)
36
+ lines.push(`**Institution:** ${p.authorCorrespondingInstitution}`);
37
+ if (p.funder)
38
+ lines.push(`**Funder:** ${p.funder}`);
39
+ if (p.jatsxmlUrl)
40
+ lines.push(`**JATS XML:** ${p.jatsxmlUrl}`);
41
+ if (p.publishedJournalDoi)
42
+ lines.push(`**Published DOI:** ${p.publishedJournalDoi}`);
43
+ if (p.abstract)
44
+ lines.push(`\n${p.abstract}`);
45
+ return lines.join('\n');
46
+ }
47
+ export const biorxivListRecentTool = tool('biorxiv_list_recent', {
48
+ title: 'List Recent Preprints',
49
+ description: 'List preprints posted or revised within a date interval, optionally scoped to one server or a subject category. Returns 30 preprints per page (fixed by the API); pass `cursor` as an integer offset (0, 30, 60, …) to step through additional pages. When server="both" (default), per-server pagination state is returned separately — use each server\'s `cursor` field for independent advancement. Category filtering is applied server-side; call biorxiv_list_categories for valid category strings.',
50
+ annotations: { readOnlyHint: true, openWorldHint: true },
51
+ input: z.object({
52
+ start_date: z.string().describe('Start of the date interval (YYYY-MM-DD).'),
53
+ end_date: z.string().describe('End of the date interval (YYYY-MM-DD).'),
54
+ server: z
55
+ .enum(['biorxiv', 'medrxiv', 'both'])
56
+ .default('both')
57
+ .describe('Server to query. "both" fans out to bioRxiv and medRxiv in parallel.'),
58
+ category: z
59
+ .string()
60
+ .optional()
61
+ .describe('Subject category filter applied server-side. Use biorxiv_list_categories for valid values.'),
62
+ cursor: z
63
+ .number()
64
+ .int()
65
+ .min(0)
66
+ .default(0)
67
+ .describe('Integer page offset (0, 30, 60, …). Defaults to 0 (first page).'),
68
+ }),
69
+ output: z.object({
70
+ preprints: z
71
+ .array(z
72
+ .object({
73
+ doi: z.string().describe('Preprint DOI.'),
74
+ title: z.string().optional().describe('Title of the preprint.'),
75
+ authors: z.string().optional().describe('Author list.'),
76
+ authorCorresponding: z.string().optional().describe('Corresponding author name.'),
77
+ authorCorrespondingInstitution: z
78
+ .string()
79
+ .optional()
80
+ .describe('Corresponding author institution.'),
81
+ date: z.string().optional().describe('Posting or revision date (YYYY-MM-DD).'),
82
+ version: z.string().optional().describe('Revision version number.'),
83
+ type: z.string().optional().describe('Preprint type.'),
84
+ license: z.string().optional().describe('License identifier.'),
85
+ category: z.string().optional().describe('Subject category.'),
86
+ jatsxmlUrl: z.string().optional().describe('URL to the JATS XML full-text.'),
87
+ abstract: z.string().optional().describe('Abstract text.'),
88
+ funder: z.string().optional().describe('Funder information.'),
89
+ publishedJournalDoi: z
90
+ .string()
91
+ .optional()
92
+ .describe('Published journal DOI when this preprint has been accepted.'),
93
+ server: z.string().optional().describe('Source server (biorxiv or medrxiv).'),
94
+ })
95
+ .describe('A single preprint entry.'))
96
+ .describe('Preprints in the requested date interval.'),
97
+ pagination: z
98
+ .object({
99
+ biorxiv: z
100
+ .object({
101
+ cursor: z.number().describe('Current cursor (offset used for this page).'),
102
+ total: z.number().describe('Total preprints available on bioRxiv for these filters.'),
103
+ nextCursor: z.number().optional().describe('Cursor value for the next page, if any.'),
104
+ })
105
+ .optional()
106
+ .describe('bioRxiv pagination state. Present when server is "biorxiv" or "both".'),
107
+ medrxiv: z
108
+ .object({
109
+ cursor: z.number().describe('Current cursor (offset used for this page).'),
110
+ total: z.number().describe('Total preprints available on medRxiv for these filters.'),
111
+ nextCursor: z.number().optional().describe('Cursor value for the next page, if any.'),
112
+ })
113
+ .optional()
114
+ .describe('medRxiv pagination state. Present when server is "medrxiv" or "both".'),
115
+ })
116
+ .describe('Per-server pagination state. Advance each server independently.'),
117
+ canvas_id: z
118
+ .string()
119
+ .optional()
120
+ .describe('DataCanvas ID when result overflowed the inline preview budget. Requires CANVAS_PROVIDER_TYPE=duckdb; run SQL against the full result set using the canvas ID.'),
121
+ message: z
122
+ .string()
123
+ .optional()
124
+ .describe('Recovery hint when zero results are returned — echoes applied filters.'),
125
+ }),
126
+ errors: [
127
+ {
128
+ reason: 'invalid_date_range',
129
+ code: JsonRpcErrorCode.ValidationError,
130
+ when: 'end_date is before start_date, or either date is malformed.',
131
+ recovery: 'Provide valid YYYY-MM-DD dates where start_date is on or before end_date.',
132
+ },
133
+ {
134
+ reason: 'invalid_category',
135
+ code: JsonRpcErrorCode.ValidationError,
136
+ when: 'The supplied category string is not in the taxonomy.',
137
+ recovery: 'Call biorxiv_list_categories to get valid category strings and retry.',
138
+ },
139
+ ],
140
+ async handler(input, ctx) {
141
+ ctx.log.info('Executing biorxiv_list_recent', {
142
+ start_date: input.start_date,
143
+ end_date: input.end_date,
144
+ server: input.server,
145
+ cursor: input.cursor,
146
+ category: input.category,
147
+ });
148
+ // Validate dates
149
+ if (!DATE_REGEX.test(input.start_date) || !DATE_REGEX.test(input.end_date)) {
150
+ throw ctx.fail('invalid_date_range', 'Date must be in YYYY-MM-DD format.', {
151
+ ...ctx.recoveryFor('invalid_date_range'),
152
+ });
153
+ }
154
+ if (input.start_date > input.end_date) {
155
+ throw ctx.fail('invalid_date_range', `start_date (${input.start_date}) must be on or before end_date (${input.end_date}).`, { ...ctx.recoveryFor('invalid_date_range') });
156
+ }
157
+ // Validate category
158
+ if (input.category?.trim()) {
159
+ const service = getBiorxivApiService();
160
+ if (!service.isValidCategory(input.category)) {
161
+ throw ctx.fail('invalid_category', `Category "${input.category}" is not in the taxonomy.`, {
162
+ ...ctx.recoveryFor('invalid_category'),
163
+ });
164
+ }
165
+ }
166
+ const service = getBiorxivApiService();
167
+ const category = input.category?.trim() || undefined;
168
+ const pagination = {};
169
+ function toPaginationEntry(r) {
170
+ const nextCursor = r.pagination.cursor + r.preprints.length < r.pagination.total
171
+ ? r.pagination.cursor + 30
172
+ : undefined;
173
+ return { ...r.pagination, ...(nextCursor !== undefined && { nextCursor }) };
174
+ }
175
+ let allPreprints = [];
176
+ if (input.server === 'both') {
177
+ const [bxResult, mxResult] = await Promise.allSettled([
178
+ service.getListing('biorxiv', input.start_date, input.end_date, input.cursor, category, ctx),
179
+ service.getListing('medrxiv', input.start_date, input.end_date, input.cursor, category, ctx),
180
+ ]);
181
+ if (bxResult.status === 'fulfilled') {
182
+ pagination.biorxiv = toPaginationEntry(bxResult.value);
183
+ allPreprints.push(...bxResult.value.preprints);
184
+ }
185
+ else {
186
+ ctx.log.warning('bioRxiv listing failed', { error: String(bxResult.reason) });
187
+ }
188
+ if (mxResult.status === 'fulfilled') {
189
+ pagination.medrxiv = toPaginationEntry(mxResult.value);
190
+ allPreprints.push(...mxResult.value.preprints);
191
+ }
192
+ else {
193
+ ctx.log.warning('medRxiv listing failed', { error: String(mxResult.reason) });
194
+ }
195
+ }
196
+ else {
197
+ const r = await service.getListing(input.server, input.start_date, input.end_date, input.cursor, category, ctx);
198
+ pagination[input.server] = toPaginationEntry(r);
199
+ allPreprints = r.preprints;
200
+ }
201
+ if (allPreprints.length === 0) {
202
+ const filterDesc = [
203
+ `dates ${input.start_date}–${input.end_date}`,
204
+ category ? `category "${category}"` : null,
205
+ input.server !== 'both' ? `server "${input.server}"` : null,
206
+ ]
207
+ .filter(Boolean)
208
+ .join(', ');
209
+ return {
210
+ preprints: [],
211
+ pagination,
212
+ message: `No preprints found for ${filterDesc}. Try widening the date range or removing the category filter.`,
213
+ };
214
+ }
215
+ // Spillover to DataCanvas if canvas is available and result is large
216
+ const canvas = ctx.core?.canvas;
217
+ if (canvas && allPreprints.length > 50) {
218
+ const instance = await canvas.acquire(undefined, ctx);
219
+ async function* preprintRows() {
220
+ for (const p of allPreprints) {
221
+ yield p;
222
+ }
223
+ }
224
+ const spill = await spillover({
225
+ canvas: instance,
226
+ source: preprintRows(),
227
+ previewChars: 80_000,
228
+ caps: { maxRows: 5_000 },
229
+ signal: ctx.signal,
230
+ });
231
+ if (spill.spilled) {
232
+ return {
233
+ preprints: spill.previewRows,
234
+ pagination,
235
+ canvas_id: instance.canvasId,
236
+ };
237
+ }
238
+ }
239
+ return { preprints: allPreprints, pagination };
240
+ },
241
+ format: (result) => {
242
+ const lines = [];
243
+ // Pagination summary
244
+ if (result.pagination.biorxiv) {
245
+ const p = result.pagination.biorxiv;
246
+ lines.push(`**bioRxiv:** page offset ${p.cursor}, total ${p.total}${p.nextCursor !== undefined ? ` — next cursor: ${p.nextCursor}` : ' (last page)'}`);
247
+ }
248
+ if (result.pagination.medrxiv) {
249
+ const p = result.pagination.medrxiv;
250
+ lines.push(`**medRxiv:** page offset ${p.cursor}, total ${p.total}${p.nextCursor !== undefined ? ` — next cursor: ${p.nextCursor}` : ' (last page)'}`);
251
+ }
252
+ if (result.canvas_id) {
253
+ lines.push(`\n**DataCanvas ID:** \`${result.canvas_id}\` — run SQL queries on the full result set.`);
254
+ }
255
+ if (result.message) {
256
+ lines.push(`\n> ${result.message}`);
257
+ }
258
+ if (result.preprints.length === 0) {
259
+ return [{ type: 'text', text: lines.join('\n') }];
260
+ }
261
+ lines.push(`\n## Preprints (${result.preprints.length} shown)`);
262
+ for (const p of result.preprints) {
263
+ lines.push('');
264
+ lines.push(formatPreprint(p));
265
+ }
266
+ return [{ type: 'text', text: lines.join('\n') }];
267
+ },
268
+ });
269
+ //# sourceMappingURL=biorxiv-list-recent.tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-list-recent.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-list-recent.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAG7E,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAMzC,SAAS,cAAc,CAAC,CAAoB;IAC1C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IACtC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAChC,IAAI,CAAC,CAAC,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,CAAC,OAAO;QAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACvD,IAAI,CAAC,CAAC,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,CAAC,MAAM;QAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACpD,IAA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@fileoverview biorxiv_search_preprints tool — keyword search for preprints
3
+ * using EuropePMC for relevance ranking, then enriching matching DOIs with
4
+ * full bioRxiv/medRxiv metadata from the details endpoint. The 10.1101/ prefix
5
+ * identifies bioRxiv DOIs; DOIs without that prefix may be medRxiv or other
6
+ * preprint sources and are enriched via both servers when server="both".
7
+ * @module mcp-server/tools/definitions/biorxiv-search-preprints.tool
8
+ */
9
+ import { z } from '@cyanheads/mcp-ts-core';
10
+ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
11
+ export declare const biorxivSearchPreprintsTool: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
12
+ query: z.ZodString;
13
+ server: z.ZodDefault<z.ZodEnum<{
14
+ biorxiv: "biorxiv";
15
+ medrxiv: "medrxiv";
16
+ both: "both";
17
+ }>>;
18
+ date_from: z.ZodOptional<z.ZodString>;
19
+ date_to: z.ZodOptional<z.ZodString>;
20
+ limit: z.ZodDefault<z.ZodNumber>;
21
+ }, z.core.$strip>, z.ZodObject<{
22
+ preprints: z.ZodArray<z.ZodObject<{
23
+ doi: z.ZodString;
24
+ title: z.ZodOptional<z.ZodString>;
25
+ authors: z.ZodOptional<z.ZodString>;
26
+ authorCorresponding: z.ZodOptional<z.ZodString>;
27
+ date: z.ZodOptional<z.ZodString>;
28
+ version: z.ZodOptional<z.ZodString>;
29
+ category: z.ZodOptional<z.ZodString>;
30
+ server: z.ZodOptional<z.ZodString>;
31
+ jatsxmlUrl: z.ZodOptional<z.ZodString>;
32
+ publishedJournalDoi: z.ZodOptional<z.ZodString>;
33
+ abstract: z.ZodOptional<z.ZodString>;
34
+ enriched: z.ZodBoolean;
35
+ revisionCount: z.ZodOptional<z.ZodNumber>;
36
+ }, z.core.$strip>>;
37
+ total_from_search: z.ZodNumber;
38
+ partial_results: z.ZodBoolean;
39
+ message: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>, readonly [{
41
+ readonly reason: "search_unavailable";
42
+ readonly code: JsonRpcErrorCode.ServiceUnavailable;
43
+ readonly when: "EuropePMC search endpoint is unreachable or returns a server error.";
44
+ readonly recovery: "EuropePMC may be temporarily unavailable. Retry after a short delay or use biorxiv_list_recent with a date range instead.";
45
+ }]>;
46
+ //# sourceMappingURL=biorxiv-search-preprints.tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"biorxiv-search-preprints.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/biorxiv-search-preprints.tool.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EACL,gBAAgB,EAGjB,MAAM,+BAA+B,CAAC;AA6CvC,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwRrC,CAAC"}