@cyanheads/biorxiv-mcp-server 0.2.4 → 0.2.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.
- package/AGENTS.md +54 -17
- package/CLAUDE.md +54 -17
- package/Dockerfile +9 -4
- package/README.md +2 -2
- package/changelog/0.2.x/0.2.5.md +29 -0
- package/changelog/template.md +55 -16
- package/dist/services/biorxiv/biorxiv-service.d.ts.map +1 -1
- package/dist/services/biorxiv/biorxiv-service.js +7 -10
- package/dist/services/biorxiv/biorxiv-service.js.map +1 -1
- package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.d.ts.map +1 -1
- package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js +3 -4
- package/dist/services/biorxiv-fulltext/biorxiv-fulltext-service.js.map +1 -1
- package/dist/services/europe-pmc/europe-pmc-service.d.ts.map +1 -1
- package/dist/services/europe-pmc/europe-pmc-service.js +3 -4
- package/dist/services/europe-pmc/europe-pmc-service.js.map +1 -1
- package/dist/services/shared.d.ts +4 -11
- package/dist/services/shared.d.ts.map +1 -1
- package/dist/services/shared.js +4 -11
- package/dist/services/shared.js.map +1 -1
- package/package.json +7 -7
- package/server.json +3 -3
package/AGENTS.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** biorxiv-mcp-server
|
|
4
|
-
**Version:** 0.2.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
4
|
+
**Version:** 0.2.5
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -35,7 +35,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
35
35
|
- **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
|
|
36
36
|
- **Use `ctx.log`** for request-scoped logging. No `console` calls.
|
|
37
37
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
38
|
-
- **
|
|
38
|
+
- **Need input the caller didn't supply?** `return ctx.requestInput(...)` and read `ctx.inputs` when the handler is re-entered. Never `await` for user input mid-handler.
|
|
39
39
|
- **Secrets in env vars only** — never hardcoded.
|
|
40
40
|
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed before moving on. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
41
41
|
|
|
@@ -112,12 +112,16 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
112
112
|
|
|
113
113
|
| Property | Description |
|
|
114
114
|
|:---------|:------------|
|
|
115
|
-
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
116
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
115
|
+
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
|
|
116
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
117
|
+
| `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
|
|
118
|
+
| `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
|
|
117
119
|
| `ctx.recoveryFor(reason)` | Typed lookup of the contract `recovery` for a declared reason. Returns `{ recovery: { hint } }` for known reasons, `{}` otherwise. Spread into `ctx.fail` data to mirror the contract hint into `content[]`. |
|
|
120
|
+
| `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
|
|
121
|
+
| `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
|
|
118
122
|
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
119
123
|
| `ctx.requestId` | Unique request ID. |
|
|
120
|
-
| `ctx.tenantId` | Tenant ID from JWT
|
|
124
|
+
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
121
125
|
|
|
122
126
|
---
|
|
123
127
|
|
|
@@ -146,6 +150,8 @@ async handler(input, ctx) {
|
|
|
146
150
|
}
|
|
147
151
|
```
|
|
148
152
|
|
|
153
|
+
**Declare contracts inline on each tool.** The contract is part of the tool's public surface — one file should give the full picture. Don't extract a shared `errors[]` constant; per-tool repetition is the intended cost of locality.
|
|
154
|
+
|
|
149
155
|
**Fallback (no contract entry fits):** error factories or plain `Error`.
|
|
150
156
|
|
|
151
157
|
```ts
|
|
@@ -166,7 +172,7 @@ src/
|
|
|
166
172
|
config/
|
|
167
173
|
server-config.ts # bioRxiv-specific env vars (BIORXIV_MAILTO, API base URLs)
|
|
168
174
|
services/
|
|
169
|
-
shared.ts # Shared utilities (
|
|
175
|
+
shared.ts # Shared utilities (detectHtmlError, normalizeUpstreamText,
|
|
170
176
|
# isValidCalendarDate, parseRetryAfterSeconds, findRateLimit, describeWait,
|
|
171
177
|
# SERVER_VERSION)
|
|
172
178
|
biorxiv/
|
|
@@ -214,9 +220,9 @@ src/
|
|
|
214
220
|
|
|
215
221
|
## Skills
|
|
216
222
|
|
|
217
|
-
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
|
|
223
|
+
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
|
|
218
224
|
|
|
219
|
-
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent).
|
|
225
|
+
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
220
226
|
|
|
221
227
|
Available skills:
|
|
222
228
|
|
|
@@ -243,7 +249,7 @@ Available skills:
|
|
|
243
249
|
| `api-auth` | Auth modes, scopes, JWT/OAuth |
|
|
244
250
|
| `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
|
|
245
251
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
246
|
-
| `api-context` | Context interface, logger, state,
|
|
252
|
+
| `api-context` | Context interface, RequestContext, logger, state, multi-round-trip input |
|
|
247
253
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
248
254
|
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
249
255
|
| `api-mirror` | MirrorService: persistent, self-refreshing local mirror of a bulk upstream dataset (embedded SQLite + FTS5) — Tier 3 opt-in |
|
|
@@ -254,6 +260,7 @@ Available skills:
|
|
|
254
260
|
| `api-workers` | Cloudflare Workers runtime |
|
|
255
261
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
256
262
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
263
|
+
| `techniques` | Catalog of response/data-shaping techniques — overflow handling, payload shaping, retrieval patterns |
|
|
257
264
|
|
|
258
265
|
**Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
|
|
259
266
|
|
|
@@ -263,6 +270,8 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
263
270
|
|
|
264
271
|
## Commands
|
|
265
272
|
|
|
273
|
+
**Runtime:** Scripts use Bun's native TypeScript execution — `bun run <cmd>` is the standard invocation.
|
|
274
|
+
|
|
266
275
|
| Command | Purpose |
|
|
267
276
|
|:--------|:--------|
|
|
268
277
|
| `bun run build` | Compile TypeScript |
|
|
@@ -271,10 +280,11 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
271
280
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
272
281
|
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
|
|
273
282
|
| `bun run tree` | Generate directory structure doc |
|
|
274
|
-
| `bun run format` | Auto-fix formatting |
|
|
275
|
-
| `bun run
|
|
276
|
-
| `bun run
|
|
277
|
-
| `bun run lint:
|
|
283
|
+
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
284
|
+
| `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
285
|
+
| `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
|
|
286
|
+
| `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
|
|
287
|
+
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
|
|
278
288
|
| `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
|
|
279
289
|
| `bun run list-skills` | Surface available local skills for sub-agents |
|
|
280
290
|
| `bun run start:stdio` | Production mode (stdio) |
|
|
@@ -287,12 +297,39 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
287
297
|
|
|
288
298
|
## Bundling
|
|
289
299
|
|
|
290
|
-
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips dependency-shipped agent docs (`
|
|
300
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. MCPB is stdio-only — HTTP deployments are unaffected. Delete `manifest.json` and `.mcpbignore` to opt out; `lint:packaging` skips cleanly.
|
|
291
301
|
|
|
292
302
|
**Adding an env var requires both files:** `server.json` (`environmentVariables[]`) and `manifest.json` (`mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies alignment.
|
|
293
303
|
|
|
294
304
|
---
|
|
295
305
|
|
|
306
|
+
## Changelog
|
|
307
|
+
|
|
308
|
+
Directory-based, grouped by minor series via the `.x` semver-wildcard convention. Source of truth: `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.2.x/0.2.5.md`) — one file per release, shipped in the npm package. At release, author the per-version file with a concrete version and date, then run `bun run changelog:build` to regenerate the rollup. `changelog/template.md` is a **pristine format reference** — never edited or moved; read it for the frontmatter + section layout when scaffolding. `CHANGELOG.md` is a **navigation index** (header + link + summary per version), regenerated by `bun run changelog:build` — devcheck hard-fails on drift; never hand-edit it.
|
|
309
|
+
|
|
310
|
+
Each per-version file opens with YAML frontmatter:
|
|
311
|
+
|
|
312
|
+
```markdown
|
|
313
|
+
---
|
|
314
|
+
summary: "One-line headline, ≤350 chars" # required — powers the rollup index
|
|
315
|
+
breaking: false # optional — true flags breaking changes
|
|
316
|
+
security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
# 0.2.5 — YYYY-MM-DD
|
|
320
|
+
...
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section — set it only for a security fix in this server's *own source code*, never for a routine dependency or transitive CVE bump (record those under `## Dependencies`). When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
324
|
+
|
|
325
|
+
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
326
|
+
|
|
327
|
+
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
|
|
328
|
+
|
|
329
|
+
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `changelog/template.md` for the full format reference.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
296
333
|
## Imports
|
|
297
334
|
|
|
298
335
|
```ts
|
|
@@ -310,7 +347,7 @@ import { getEuropePmcService } from '@/services/europe-pmc/europe-pmc-service.js
|
|
|
310
347
|
## Checklist
|
|
311
348
|
|
|
312
349
|
- [ ] Zod schemas: all fields have `.describe()`, only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`, `z.function()`, `z.nan()`)
|
|
313
|
-
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`)
|
|
350
|
+
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`). When regex/length constraints matter, use `z.union([z.literal(''), z.string().regex(...).describe(...)])` — literal variants are exempt from `describe-on-fields`.
|
|
314
351
|
- [ ] JSDoc `@fileoverview` + `@module` on every file
|
|
315
352
|
- [ ] `ctx.log` for logging, `ctx.state` for storage
|
|
316
353
|
- [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
|
package/CLAUDE.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
3
|
**Server:** biorxiv-mcp-server
|
|
4
|
-
**Version:** 0.2.
|
|
5
|
-
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.
|
|
4
|
+
**Version:** 0.2.5
|
|
5
|
+
**Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.3`
|
|
6
6
|
**Engines:** Bun ≥1.3.0, Node ≥24.0.0
|
|
7
|
-
**MCP SDK:** `@modelcontextprotocol/
|
|
7
|
+
**MCP SDK:** `@modelcontextprotocol/server` ^2.0.0
|
|
8
8
|
**Zod:** ^4.4.3
|
|
9
9
|
|
|
10
10
|
> **Read the framework docs first:** `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` contains the full API reference — builders, Context, error codes, exports, patterns. This file covers server-specific conventions only.
|
|
@@ -35,7 +35,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
|
|
|
35
35
|
- **Logic throws, framework catches.** Tool/resource handlers are pure — throw on failure, no `try/catch`. Plain `Error` is fine; the framework catches, classifies, and formats. Use error factories (`notFound()`, `validationError()`, etc.) when the error code matters.
|
|
36
36
|
- **Use `ctx.log`** for request-scoped logging. No `console` calls.
|
|
37
37
|
- **Use `ctx.state`** for tenant-scoped storage. Never access persistence directly.
|
|
38
|
-
- **
|
|
38
|
+
- **Need input the caller didn't supply?** `return ctx.requestInput(...)` and read `ctx.inputs` when the handler is re-entered. Never `await` for user input mid-handler.
|
|
39
39
|
- **Secrets in env vars only** — never hardcoded.
|
|
40
40
|
- **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed before moving on. The comment is for future readers — state the concrete changes, not the conversation that produced them.
|
|
41
41
|
|
|
@@ -112,12 +112,16 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
112
112
|
|
|
113
113
|
| Property | Description |
|
|
114
114
|
|:---------|:------------|
|
|
115
|
-
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
|
|
116
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
115
|
+
| `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. Dual-sink: Pino **and** `notifications/message` to the client, so treat it as client-visible. |
|
|
116
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
117
|
+
| `ctx.requestInput` | Suspend and ask the caller for more input — `return ctx.requestInput({ inputRequests: { key: inputRequired.elicit({ message, requestedSchema }) } })`. Never returns; the handler is re-entered with the answers. Always present. |
|
|
118
|
+
| `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
|
|
117
119
|
| `ctx.recoveryFor(reason)` | Typed lookup of the contract `recovery` for a declared reason. Returns `{ recovery: { hint } }` for known reasons, `{}` otherwise. Spread into `ctx.fail` data to mirror the contract hint into `content[]`. |
|
|
120
|
+
| `ctx.enrich` | Success-path agent context (empty-result notices, query echo, pagination totals) — `ctx.enrich(...)` or `.notice()` / `.total()` / `.echo()` / `.truncated()`. Reaches `structuredContent` and `content[]`; lands only when the definition declares an `enrichment` block (no-op otherwise). |
|
|
121
|
+
| `ctx.content` | Non-text content blocks — `.image(data, mimeType)`, `.audio(data, mimeType)`, or `ctx.content(block)` for a raw block. Prepended to `content[]` after `format()`; never enters `structuredContent`. |
|
|
118
122
|
| `ctx.signal` | `AbortSignal` for cancellation. |
|
|
119
123
|
| `ctx.requestId` | Unique request ID. |
|
|
120
|
-
| `ctx.tenantId` | Tenant ID from JWT
|
|
124
|
+
| `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
|
|
121
125
|
|
|
122
126
|
---
|
|
123
127
|
|
|
@@ -146,6 +150,8 @@ async handler(input, ctx) {
|
|
|
146
150
|
}
|
|
147
151
|
```
|
|
148
152
|
|
|
153
|
+
**Declare contracts inline on each tool.** The contract is part of the tool's public surface — one file should give the full picture. Don't extract a shared `errors[]` constant; per-tool repetition is the intended cost of locality.
|
|
154
|
+
|
|
149
155
|
**Fallback (no contract entry fits):** error factories or plain `Error`.
|
|
150
156
|
|
|
151
157
|
```ts
|
|
@@ -166,7 +172,7 @@ src/
|
|
|
166
172
|
config/
|
|
167
173
|
server-config.ts # bioRxiv-specific env vars (BIORXIV_MAILTO, API base URLs)
|
|
168
174
|
services/
|
|
169
|
-
shared.ts # Shared utilities (
|
|
175
|
+
shared.ts # Shared utilities (detectHtmlError, normalizeUpstreamText,
|
|
170
176
|
# isValidCalendarDate, parseRetryAfterSeconds, findRateLimit, describeWait,
|
|
171
177
|
# SERVER_VERSION)
|
|
172
178
|
biorxiv/
|
|
@@ -214,9 +220,9 @@ src/
|
|
|
214
220
|
|
|
215
221
|
## Skills
|
|
216
222
|
|
|
217
|
-
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool.
|
|
223
|
+
Skills are modular instructions in `skills/` at the project root. Read them directly when a task matches — e.g., `skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry.
|
|
218
224
|
|
|
219
|
-
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent).
|
|
225
|
+
**Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
|
|
220
226
|
|
|
221
227
|
Available skills:
|
|
222
228
|
|
|
@@ -243,7 +249,7 @@ Available skills:
|
|
|
243
249
|
| `api-auth` | Auth modes, scopes, JWT/OAuth |
|
|
244
250
|
| `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
|
|
245
251
|
| `api-config` | AppConfig, parseConfig, env vars |
|
|
246
|
-
| `api-context` | Context interface, logger, state,
|
|
252
|
+
| `api-context` | Context interface, RequestContext, logger, state, multi-round-trip input |
|
|
247
253
|
| `api-errors` | McpError, JsonRpcErrorCode, error patterns |
|
|
248
254
|
| `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
|
|
249
255
|
| `api-mirror` | MirrorService: persistent, self-refreshing local mirror of a bulk upstream dataset (embedded SQLite + FTS5) — Tier 3 opt-in |
|
|
@@ -254,6 +260,7 @@ Available skills:
|
|
|
254
260
|
| `api-workers` | Cloudflare Workers runtime |
|
|
255
261
|
| `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
|
|
256
262
|
| `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
|
|
263
|
+
| `techniques` | Catalog of response/data-shaping techniques — overflow handling, payload shaping, retrieval patterns |
|
|
257
264
|
|
|
258
265
|
**Chaining skills into pipelines.** When the user wants a multi-phase effort — build this server out, QA-and-fix the surface, update-and-ship — *and you can spawn sub-agents*, `skills/orchestrations/SKILL.md` sequences the task skills above into a gated pipeline with verification at each step. Read it to drive the run. Optional: skip it if you can't orchestrate sub-agents, and ignore it entirely if you were *spawned* as one — you've already been scoped to a single phase.
|
|
259
266
|
|
|
@@ -263,6 +270,8 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
263
270
|
|
|
264
271
|
## Commands
|
|
265
272
|
|
|
273
|
+
**Runtime:** Scripts use Bun's native TypeScript execution — `bun run <cmd>` is the standard invocation.
|
|
274
|
+
|
|
266
275
|
| Command | Purpose |
|
|
267
276
|
|:--------|:--------|
|
|
268
277
|
| `bun run build` | Compile TypeScript |
|
|
@@ -271,10 +280,11 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
271
280
|
| `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
|
|
272
281
|
| `bun run audit:refresh` | Delete `bun.lock`, reinstall, and re-run `bun audit`. Use when `devcheck` flags a transitive advisory — Bun's `update` is sticky on transitive resolutions, so the advisory may be a stale-lockfile false positive. If it survives the refresh, it's real. |
|
|
273
282
|
| `bun run tree` | Generate directory structure doc |
|
|
274
|
-
| `bun run format` | Auto-fix formatting |
|
|
275
|
-
| `bun run
|
|
276
|
-
| `bun run
|
|
277
|
-
| `bun run lint:
|
|
283
|
+
| `bun run format` | Auto-fix formatting (safe fixes only) |
|
|
284
|
+
| `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
|
|
285
|
+
| `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
|
|
286
|
+
| `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
|
|
287
|
+
| `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
|
|
278
288
|
| `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
|
|
279
289
|
| `bun run list-skills` | Surface available local skills for sub-agents |
|
|
280
290
|
| `bun run start:stdio` | Production mode (stdio) |
|
|
@@ -287,12 +297,39 @@ When you complete a skill's checklist, check the boxes and add a completion time
|
|
|
287
297
|
|
|
288
298
|
## Bundling
|
|
289
299
|
|
|
290
|
-
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips dependency-shipped agent docs (`
|
|
300
|
+
`bun run bundle` produces a `.mcpb` extension bundle for one-click install in Claude Desktop. The pack step is followed by `scripts/clean-mcpb.ts`, which prunes dev dependencies (`mcpb clean`) and strips two classes of `node_modules/**` content that root-anchored `.mcpbignore` patterns cannot reach: dependency-shipped agent docs (`skills/`, `.claude/`, `.agents/`, `SKILL.md`) and platform-specific native bindings, which would otherwise lock the bundle to the platform it was packed on. MCPB is stdio-only — HTTP deployments are unaffected. Delete `manifest.json` and `.mcpbignore` to opt out; `lint:packaging` skips cleanly.
|
|
291
301
|
|
|
292
302
|
**Adding an env var requires both files:** `server.json` (`environmentVariables[]`) and `manifest.json` (`mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies alignment.
|
|
293
303
|
|
|
294
304
|
---
|
|
295
305
|
|
|
306
|
+
## Changelog
|
|
307
|
+
|
|
308
|
+
Directory-based, grouped by minor series via the `.x` semver-wildcard convention. Source of truth: `changelog/<major.minor>.x/<version>.md` (e.g. `changelog/0.2.x/0.2.5.md`) — one file per release, shipped in the npm package. At release, author the per-version file with a concrete version and date, then run `bun run changelog:build` to regenerate the rollup. `changelog/template.md` is a **pristine format reference** — never edited or moved; read it for the frontmatter + section layout when scaffolding. `CHANGELOG.md` is a **navigation index** (header + link + summary per version), regenerated by `bun run changelog:build` — devcheck hard-fails on drift; never hand-edit it.
|
|
309
|
+
|
|
310
|
+
Each per-version file opens with YAML frontmatter:
|
|
311
|
+
|
|
312
|
+
```markdown
|
|
313
|
+
---
|
|
314
|
+
summary: "One-line headline, ≤350 chars" # required — powers the rollup index
|
|
315
|
+
breaking: false # optional — true flags breaking changes
|
|
316
|
+
security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
# 0.2.5 — YYYY-MM-DD
|
|
320
|
+
...
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
`breaking: true` renders a `· ⚠️ Breaking` badge — use it when consumers must update code on upgrade (signature changes, removed APIs, config renames). `security: true` renders a `· 🛡️ Security` badge and pairs with a `## Security` body section — set it only for a security fix in this server's *own source code*, never for a routine dependency or transitive CVE bump (record those under `## Dependencies`). When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
|
|
324
|
+
|
|
325
|
+
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
326
|
+
|
|
327
|
+
**Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
|
|
328
|
+
|
|
329
|
+
**Tag annotations** render as GitHub Release bodies via `--notes-from-tag`. They must be structured markdown — never a flat comma-separated string. Subject omits the version number (GitHub prepends it). See `changelog/template.md` for the full format reference.
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
296
333
|
## Imports
|
|
297
334
|
|
|
298
335
|
```ts
|
|
@@ -310,7 +347,7 @@ import { getEuropePmcService } from '@/services/europe-pmc/europe-pmc-service.js
|
|
|
310
347
|
## Checklist
|
|
311
348
|
|
|
312
349
|
- [ ] Zod schemas: all fields have `.describe()`, only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`, `z.function()`, `z.nan()`)
|
|
313
|
-
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`)
|
|
350
|
+
- [ ] Optional nested objects: handler guards for empty inner values from form-based clients (`if (input.obj?.field && ...)`, not just `if (input.obj)`). When regex/length constraints matter, use `z.union([z.literal(''), z.string().regex(...).describe(...)])` — literal variants are exempt from `describe-on-fields`.
|
|
314
351
|
- [ ] JSDoc `@fileoverview` + `@module` on every file
|
|
315
352
|
- [ ] `ctx.log` for logging, `ctx.state` for storage
|
|
316
353
|
- [ ] Handlers throw on failure — error factories or plain `Error`, no try/catch
|
package/Dockerfile
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# This stage installs all dependencies (including dev), builds the TypeScript
|
|
5
5
|
# source code into JavaScript, and prepares the production assets.
|
|
6
6
|
# ==============================================================================
|
|
7
|
-
FROM oven/bun:1.
|
|
7
|
+
FROM oven/bun:1.4.0 AS build
|
|
8
8
|
|
|
9
9
|
WORKDIR /usr/src/app
|
|
10
10
|
|
|
@@ -30,7 +30,7 @@ RUN bun run build
|
|
|
30
30
|
# application. It uses a slim base image and only includes production
|
|
31
31
|
# dependencies and build artifacts.
|
|
32
32
|
# ==============================================================================
|
|
33
|
-
FROM oven/bun:1.
|
|
33
|
+
FROM oven/bun:1.4.0-slim AS production
|
|
34
34
|
|
|
35
35
|
WORKDIR /usr/src/app
|
|
36
36
|
|
|
@@ -51,8 +51,13 @@ COPY package.json bun.lock ./
|
|
|
51
51
|
|
|
52
52
|
# Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
|
|
53
53
|
# that are not needed in the final production image.
|
|
54
|
+
# `--omit=peer` drops the framework's optional peer tiers (test runner, service
|
|
55
|
+
# SDKs, parsers) that Bun would otherwise auto-install. Anything this server
|
|
56
|
+
# actually imports belongs in its own `dependencies`, so nothing needed at
|
|
57
|
+
# runtime is lost. The OTEL step below carries the same flag — without it, that
|
|
58
|
+
# install re-resolves the graph and pulls every optional peer back in.
|
|
54
59
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
55
|
-
bun install --production --frozen-lockfile --ignore-scripts
|
|
60
|
+
bun install --production --omit=peer --frozen-lockfile --ignore-scripts
|
|
56
61
|
|
|
57
62
|
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
58
63
|
# These are not bundled by default to keep the base image lean. Enable at build time
|
|
@@ -60,7 +65,7 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
|
60
65
|
ARG OTEL_ENABLED=true
|
|
61
66
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
62
67
|
if [ "$OTEL_ENABLED" = "true" ]; then \
|
|
63
|
-
bun add --omit=dev --ignore-scripts @hono/otel \
|
|
68
|
+
bun add --omit=dev --omit=peer --ignore-scripts @hono/otel \
|
|
64
69
|
@opentelemetry/instrumentation-http \
|
|
65
70
|
@opentelemetry/exporter-metrics-otlp-http \
|
|
66
71
|
@opentelemetry/exporter-trace-otlp-http \
|
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<div align="center">
|
|
9
9
|
|
|
10
|
-
[](./CHANGELOG.md) [](./LICENSE) [](https://github.com/users/cyanheads/packages/container/package/biorxiv-mcp-server) [](https://modelcontextprotocol.io/) [](https://www.npmjs.com/package/@cyanheads/biorxiv-mcp-server) [](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -190,7 +190,7 @@ MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 BIORXIV_MAILTO=your@email.com bun run
|
|
|
190
190
|
|
|
191
191
|
### Prerequisites
|
|
192
192
|
|
|
193
|
-
- [Bun v1.3.
|
|
193
|
+
- [Bun v1.3.0](https://bun.sh/) or higher (or Node.js v24+).
|
|
194
194
|
|
|
195
195
|
### Installation
|
|
196
196
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Adopts @cyanheads/mcp-ts-core 0.12.3 (MCP SDK v2): HTTP now serves protocol revision 2026-07-28, tool inputs reject undeclared keys, and a source run defaults MCP_SESSION_MODE to stateless"
|
|
3
|
+
breaking: false
|
|
4
|
+
security: false
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 0.2.5 — 2026-08-25
|
|
8
|
+
|
|
9
|
+
## Added
|
|
10
|
+
|
|
11
|
+
- **`.github/CONTRIBUTING.md`, `CODE_OF_CONDUCT.md`** — community-health files, alongside the existing `SECURITY.md` and issue forms.
|
|
12
|
+
|
|
13
|
+
## Changed
|
|
14
|
+
|
|
15
|
+
- **`@cyanheads/mcp-ts-core`** `^0.11.1` → `^0.12.3` — adopts the SDK v2 migration (`@modelcontextprotocol/server` `^2.0.0`, was `@modelcontextprotocol/sdk` `^1.30.0`). The HTTP endpoint now serves protocol revision 2026-07-28 alongside the 2025-era revisions it already served.
|
|
16
|
+
- **Tool inputs are strict** — a key not declared on a tool's input schema is now rejected by name instead of silently ignored, and every `inputSchema` advertises `additionalProperties: false`. None of this server's 6 tools declare `.passthrough()`/`.catchall()`, so the change applies unmodified across the surface.
|
|
17
|
+
- **`.env.example`** — `MCP_SESSION_MODE` is now set to `stateless` rather than left commented at the old `stateful` default, so copying the example into `.env` for a source run now serves stateless sessions unless overridden. New commented options documented for HTTP resumability, GC-pressure relief, and log rate limiting.
|
|
18
|
+
- **`.github/SECURITY.md`** — vulnerability-report contact moved to `security@caseyjhand.com`.
|
|
19
|
+
- **`Dockerfile`** — the production `bun install` and the OTEL `bun add` now pass `--omit=peer`, dropping the framework's optional peer tiers (test runner, service SDKs, parsers) from the runtime image.
|
|
20
|
+
|
|
21
|
+
## Dependencies
|
|
22
|
+
|
|
23
|
+
- **`@cyanheads/mcp-ts-core`** `^0.11.1` → `^0.12.3`
|
|
24
|
+
- **`bun`** (`packageManager`, `Dockerfile` pins) `1.3.14` → `1.4.0`
|
|
25
|
+
- **`@biomejs/biome`** `2.5.7` → `2.5.10`
|
|
26
|
+
- **`@types/node`** `26.1.2` → `26.2.0`
|
|
27
|
+
- **`tsc-alias`** `^1.9.1` → `^1.9.2`
|
|
28
|
+
- **`vitest`** `^4.1.10` → `^4.1.11`
|
|
29
|
+
- **`nanoid`** (transitive, via `postcss`) `3.3.17` → `3.3.18` — clears [GHSA-2v37-7h3g-55p8](https://github.com/advisories/GHSA-2v37-7h3g-55p8) (high: indefinite loop on a zero `size`), reached through `depcheck` and `vitest`'s dev-only dependency graph.
|
package/changelog/template.md
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
# to author a new release. Set that file's H1 to `# <version> — YYYY-MM-DD`
|
|
5
5
|
# with a concrete date.
|
|
6
6
|
|
|
7
|
-
# Required. One-line GitHub Release-style headline. 350 character cap
|
|
8
|
-
# Default short and scannable. Don't pad, don't stitch
|
|
9
|
-
#
|
|
10
|
-
#
|
|
7
|
+
# Required. One-line GitHub Release-style headline. 350 character cap — a
|
|
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
|
|
11
|
+
# `: ` inside the value as a key separator and fails GitHub's strict parser.
|
|
11
12
|
summary: ""
|
|
12
13
|
|
|
13
14
|
# Set `true` when consumers must change code to upgrade: API removals,
|
|
@@ -24,9 +25,10 @@ security: false
|
|
|
24
25
|
|
|
25
26
|
# Optional free-form notes for maintenance agents processing this release.
|
|
26
27
|
# Not rendered in CHANGELOG — consumed by agents running `maintenance` on
|
|
27
|
-
# downstream servers.
|
|
28
|
-
#
|
|
29
|
-
#
|
|
28
|
+
# downstream servers. ADOPTION STEPS ONLY — new files to create, fields to
|
|
29
|
+
# populate, one-time migration steps. Never a second rendering of the body:
|
|
30
|
+
# if a body bullet already says it, name the bullet's symbol instead of
|
|
31
|
+
# re-explaining. Omit the field entirely when there's nothing to say.
|
|
30
32
|
# agent-notes: |
|
|
31
33
|
# <instructions for downstream maintenance agents>
|
|
32
34
|
---
|
|
@@ -41,17 +43,54 @@ security: false
|
|
|
41
43
|
each bullet with the symbol or concept name in **bold** so they can skip
|
|
42
44
|
what's irrelevant and zoom in on what's not.
|
|
43
45
|
|
|
44
|
-
Tone: terse, fact-dense, not verbose.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
Tone: terse, fact-dense, not verbose. Bullet shape: **symbol** + what
|
|
47
|
+
changed + at most one consumer-facing caveat. One sentence by default, two
|
|
48
|
+
when the second carries weight — a bullet past ~40 words or three sentences
|
|
49
|
+
is wrong. The depth lives one hop away: the linked issue carries the why,
|
|
50
|
+
the commit diff carries the how. The changelog names what changed and what
|
|
51
|
+
a consumer does about it; a reader who wants mechanism opens the link.
|
|
52
|
+
|
|
53
|
+
Model length on THIS guide, never on the previous entry — entries modeled
|
|
54
|
+
on entries compound.
|
|
55
|
+
|
|
56
|
+
Cut (each has shipped as a wall of text; these are the cruft):
|
|
57
|
+
- History/justification narration — how the bug worked, why the old
|
|
58
|
+
behavior was wrong. One short clause at most; the issue carries the story.
|
|
59
|
+
- Design-rationale defense — "chosen over Y because…", "guarding the
|
|
60
|
+
getter is not enough…". That is the author arguing with a reviewer;
|
|
61
|
+
reviewers read the PR, not the changelog.
|
|
62
|
+
- Defensive unchanged-clauses — "X is unchanged", "byte-identical to
|
|
63
|
+
<prev>". Keep one only where its absence would cause a real misread,
|
|
64
|
+
as a short parenthetical.
|
|
65
|
+
- Edge-case inventories — marker lists, not-flagged lists, escape tables.
|
|
66
|
+
Tests and the issue carry those.
|
|
67
|
+
- Mechanism walkthroughs (JSDoc, CLAUDE.md/AGENTS.md, or the relevant
|
|
68
|
+
skill own those), ceremonial framings ("This release introduces…"),
|
|
69
|
+
backwards-compat paragraphs, file-by-file test enumerations. Prefer
|
|
70
|
+
code/symbol names over English re-explanations.
|
|
71
|
+
|
|
72
|
+
Verified ≠ included: the every-claim-verified-from-the-diff rule bounds
|
|
73
|
+
the TRUTH of what you write, never the AMOUNT.
|
|
74
|
+
|
|
75
|
+
Example — same fact, right size:
|
|
76
|
+
|
|
77
|
+
TOO LONG: **`fetchWithTimeout`'s `timeoutMs` bounds the whole exchange**
|
|
78
|
+
(#341). `fetch` resolves once headers arrive and the deadline was
|
|
79
|
+
cleared as the helper returned, so a peer that answered promptly and
|
|
80
|
+
then stalled the stream held the request open indefinitely. A 2xx
|
|
81
|
+
carrying a body now comes back as a passthrough wrapper that disarms
|
|
82
|
+
the deadline when the body closes, errors, or is cancelled; …
|
|
83
|
+
[+90 more words of mechanism and edge cases]
|
|
84
|
+
|
|
85
|
+
RIGHT: **`fetchWithTimeout`'s `timeoutMs` now bounds the whole
|
|
86
|
+
exchange, not just the headers** (#341). A stalled body aborts with
|
|
87
|
+
the same `Timeout` error; the returned `Response` is a wrapper, so
|
|
88
|
+
identity assertions (`toBe(response)`) no longer hold.
|
|
52
89
|
|
|
53
90
|
Narrative intro: skip by default. Add one short sentence only when the
|
|
54
|
-
release theme genuinely needs framing the bullets can't carry.
|
|
91
|
+
release theme genuinely needs framing the bullets can't carry. When many
|
|
92
|
+
bullets share one upgrade consequence, state it ONCE — intro line or
|
|
93
|
+
agent-notes — never per bullet.
|
|
55
94
|
|
|
56
95
|
Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
|
|
57
96
|
Fixed, Security. Include only sections with entries; delete the rest
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-service.d.ts","sourceRoot":"","sources":["../../../src/services/biorxiv/biorxiv-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO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G,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAiDvC;CACF;AAMD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAEtF;AAED,wBAAgB,oBAAoB,IAAI,iBAAiB,CAIxD"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { McpError, rateLimited, serviceUnavailable } from '@cyanheads/mcp-ts-core/errors';
|
|
12
12
|
import { fetchWithTimeout, withRetry } from '@cyanheads/mcp-ts-core/utils';
|
|
13
13
|
import { getServerConfig } from '../../config/server-config.js';
|
|
14
|
-
import {
|
|
14
|
+
import { describeWait, detectHtmlError, normalizeUpstreamText, parseRetryAfterSeconds, SERVER_VERSION, } from '../../services/shared.js';
|
|
15
15
|
// ─── Hardcoded category taxonomy ─────────────────────────────────────────────
|
|
16
16
|
// No API endpoint provides this; it changes infrequently. Maintained here.
|
|
17
17
|
const CATEGORIES = {
|
|
@@ -221,10 +221,9 @@ export class BiorxivApiService {
|
|
|
221
221
|
async getDetails(doi, server, ctx) {
|
|
222
222
|
const encodedDoi = doi.split('/').map(encodeURIComponent).join('/');
|
|
223
223
|
const url = `${this.baseUrl}/details/${server}/${encodedDoi}/0/json`;
|
|
224
|
-
const rc = asRc(ctx);
|
|
225
224
|
try {
|
|
226
225
|
return await withRetry(async () => {
|
|
227
|
-
const response = await fetchWithTimeout(url, 15_000,
|
|
226
|
+
const response = await fetchWithTimeout(url, 15_000, ctx, {
|
|
228
227
|
signal: ctx.signal,
|
|
229
228
|
headers: { 'User-Agent': this.userAgent },
|
|
230
229
|
expectedStatuses: EXPECTED_STATUSES,
|
|
@@ -237,7 +236,7 @@ export class BiorxivApiService {
|
|
|
237
236
|
return (data.collection ?? []).map(normalizeRevision);
|
|
238
237
|
}, {
|
|
239
238
|
operation: 'BiorxivApiService.getDetails',
|
|
240
|
-
context:
|
|
239
|
+
context: ctx,
|
|
241
240
|
baseDelayMs: 500,
|
|
242
241
|
signal: ctx.signal,
|
|
243
242
|
});
|
|
@@ -257,10 +256,9 @@ export class BiorxivApiService {
|
|
|
257
256
|
if (category) {
|
|
258
257
|
url += `?category=${encodeURIComponent(category)}`;
|
|
259
258
|
}
|
|
260
|
-
const rc = asRc(ctx);
|
|
261
259
|
try {
|
|
262
260
|
return await withRetry(async () => {
|
|
263
|
-
const response = await fetchWithTimeout(url, 20_000,
|
|
261
|
+
const response = await fetchWithTimeout(url, 20_000, ctx, {
|
|
264
262
|
signal: ctx.signal,
|
|
265
263
|
headers: { 'User-Agent': this.userAgent },
|
|
266
264
|
expectedStatuses: EXPECTED_STATUSES,
|
|
@@ -284,7 +282,7 @@ export class BiorxivApiService {
|
|
|
284
282
|
};
|
|
285
283
|
}, {
|
|
286
284
|
operation: 'BiorxivApiService.getListing',
|
|
287
|
-
context:
|
|
285
|
+
context: ctx,
|
|
288
286
|
baseDelayMs: 500,
|
|
289
287
|
signal: ctx.signal,
|
|
290
288
|
});
|
|
@@ -301,10 +299,9 @@ export class BiorxivApiService {
|
|
|
301
299
|
async getPublishedVersion(doi, server, ctx) {
|
|
302
300
|
const encodedDoi = doi.split('/').map(encodeURIComponent).join('/');
|
|
303
301
|
const url = `${this.baseUrl}/pubs/${server}/${encodedDoi}/json`;
|
|
304
|
-
const rc = asRc(ctx);
|
|
305
302
|
try {
|
|
306
303
|
return await withRetry(async () => {
|
|
307
|
-
const response = await fetchWithTimeout(url, 15_000,
|
|
304
|
+
const response = await fetchWithTimeout(url, 15_000, ctx, {
|
|
308
305
|
signal: ctx.signal,
|
|
309
306
|
headers: { 'User-Agent': this.userAgent },
|
|
310
307
|
expectedStatuses: EXPECTED_STATUSES,
|
|
@@ -344,7 +341,7 @@ export class BiorxivApiService {
|
|
|
344
341
|
return pv;
|
|
345
342
|
}, {
|
|
346
343
|
operation: 'BiorxivApiService.getPublishedVersion',
|
|
347
|
-
context:
|
|
344
|
+
context: ctx,
|
|
348
345
|
baseDelayMs: 500,
|
|
349
346
|
signal: ctx.signal,
|
|
350
347
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-service.js","sourceRoot":"","sources":["../../../src/services/biorxiv/biorxiv-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"biorxiv-service.js","sourceRoot":"","sources":["../../../src/services/biorxiv/biorxiv-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAY9B,gFAAgF;AAChF,2EAA2E;AAC3E,MAAM,UAAU,GAAqB;IACnC,OAAO,EAAE;QACP,+BAA+B;QAC/B,cAAc;QACd,gBAAgB;QAChB,gBAAgB;QAChB,YAAY;QACZ,gBAAgB;QAChB,cAAc;QACd,iBAAiB;QACjB,uBAAuB;QACvB,SAAS;QACT,cAAc;QACd,sBAAsB;QACtB,UAAU;QACV,UAAU;QACV,YAAY;QACZ,cAAc;QACd,mBAAmB;QACnB,cAAc;QACd,cAAc;QACd,WAAW;QACX,6BAA6B;QAC7B,YAAY;QACZ,eAAe;QACf,wCAAwC;QAC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AAO,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,IAAI,CAAC,QAAQ;QACX,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;IACjG,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-fulltext-service.d.ts","sourceRoot":"","sources":["../../../src/services/biorxiv-fulltext/biorxiv-fulltext-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAsGjE;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAKN,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgC;IAC5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EASvD;IAED;;;;;;;;;;;;OAYG;IACG,aAAa,CACjB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"biorxiv-fulltext-service.d.ts","sourceRoot":"","sources":["../../../src/services/biorxiv-fulltext/biorxiv-fulltext-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAsGjE;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAKN,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgC;IAC5D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EASvD;IAED;;;;;;;;;;;;OAYG;IACG,aAAa,CACjB,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,OAAO,GACX,OAAO,CAAC,mBAAmB,CAAC,CAsH9B;CACF;AAMD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAE3F;AAED,wBAAgB,yBAAyB,IAAI,sBAAsB,CAMlE"}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
import { McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
25
25
|
import { fetchWithTimeout, htmlExtractor, withRetry } from '@cyanheads/mcp-ts-core/utils';
|
|
26
26
|
import { getServerConfig } from '../../config/server-config.js';
|
|
27
|
-
import {
|
|
27
|
+
import { parseRetryAfterSeconds, SERVER_VERSION } from '../../services/shared.js';
|
|
28
28
|
/**
|
|
29
29
|
* bioRxiv/medRxiv render their article pages on the Highwire platform, whose
|
|
30
30
|
* main full-text container is `<div class="article fulltext-view">`. Defuddle's
|
|
@@ -141,7 +141,6 @@ export class BiorxivFullTextService {
|
|
|
141
141
|
async fetchFullText(server, doi, version, ctx) {
|
|
142
142
|
const encodedDoi = doi.split('/').map(encodeURIComponent).join('/');
|
|
143
143
|
const sourceUrl = `${this.webBaseUrls[server]}/content/${encodedDoi}v${version}.full`;
|
|
144
|
-
const rc = asRc(ctx);
|
|
145
144
|
// ctx.state is tenant-scoped and throws without a tenant (HTTP + JWT whose
|
|
146
145
|
// token carries no `tid` claim), so a tenant-less caller runs uncached rather
|
|
147
146
|
// than losing full-text retrieval entirely.
|
|
@@ -156,7 +155,7 @@ export class BiorxivFullTextService {
|
|
|
156
155
|
let html;
|
|
157
156
|
try {
|
|
158
157
|
html = await withRetry(async () => {
|
|
159
|
-
const response = await fetchWithTimeout(sourceUrl, 30_000,
|
|
158
|
+
const response = await fetchWithTimeout(sourceUrl, 30_000, ctx, {
|
|
160
159
|
signal: ctx.signal,
|
|
161
160
|
headers: { 'User-Agent': this.userAgent, Accept: 'text/html' },
|
|
162
161
|
expectedStatuses: EXPECTED_STATUSES,
|
|
@@ -164,7 +163,7 @@ export class BiorxivFullTextService {
|
|
|
164
163
|
return await response.text();
|
|
165
164
|
}, {
|
|
166
165
|
operation: 'BiorxivFullTextService.fetchFullText',
|
|
167
|
-
context:
|
|
166
|
+
context: ctx,
|
|
168
167
|
baseDelayMs: 500,
|
|
169
168
|
signal: ctx.signal,
|
|
170
169
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-fulltext-service.js","sourceRoot":"","sources":["../../../src/services/biorxiv-fulltext/biorxiv-fulltext-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"biorxiv-fulltext-service.js","sourceRoot":"","sources":["../../../src/services/biorxiv-fulltext/biorxiv-fulltext-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,yBAAyB,GAAG,gBAAgB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,kCAAkC,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAE9E;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,GAAG,kCAAkC,EA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/europe-pmc-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"europe-pmc-service.d.ts","sourceRoot":"","sources":["../../../src/services/europe-pmc/europe-pmc-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAUrE,OAAO,KAAK,EAEV,qBAAqB,EAEtB,MAAM,YAAY,CAAC;AA+CpB,MAAM,WAAW,aAAa;IAC5B,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAEnC,YAAY,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,EAMvD;IAED;;;;;;OAMG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4FjF;CACF;AAMD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAErF;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,CAItD"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { McpError, rateLimited, serviceUnavailable } from '@cyanheads/mcp-ts-core/errors';
|
|
12
12
|
import { fetchWithTimeout, withRetry } from '@cyanheads/mcp-ts-core/utils';
|
|
13
13
|
import { getServerConfig } from '../../config/server-config.js';
|
|
14
|
-
import {
|
|
14
|
+
import { describeWait, detectHtmlError, normalizeUpstreamText, parseRetryAfterSeconds, SERVER_VERSION, } from '../../services/shared.js';
|
|
15
15
|
/**
|
|
16
16
|
* The one status this service classifies itself rather than treating as a bug.
|
|
17
17
|
* Passing it to `fetchWithTimeout` only lowers the log severity from `error` to
|
|
@@ -109,10 +109,9 @@ export class EuropePmcService {
|
|
|
109
109
|
fields,
|
|
110
110
|
});
|
|
111
111
|
const url = `${this.baseUrl}/search?${params.toString()}&filter=${filterParam}`;
|
|
112
|
-
const rc = asRc(ctx);
|
|
113
112
|
try {
|
|
114
113
|
return await withRetry(async () => {
|
|
115
|
-
const response = await fetchWithTimeout(url, 20_000,
|
|
114
|
+
const response = await fetchWithTimeout(url, 20_000, ctx, {
|
|
116
115
|
signal: ctx.signal,
|
|
117
116
|
headers: { 'User-Agent': this.userAgent },
|
|
118
117
|
expectedStatuses: EXPECTED_STATUSES,
|
|
@@ -144,7 +143,7 @@ export class EuropePmcService {
|
|
|
144
143
|
};
|
|
145
144
|
}, {
|
|
146
145
|
operation: 'EuropePmcService.search',
|
|
147
|
-
context:
|
|
146
|
+
context: ctx,
|
|
148
147
|
baseDelayMs: 300,
|
|
149
148
|
signal: ctx.signal,
|
|
150
149
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"europe-pmc-service.js","sourceRoot":"","sources":["../../../src/services/europe-pmc/europe-pmc-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"europe-pmc-service.js","sourceRoot":"","sources":["../../../src/services/europe-pmc/europe-pmc-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAO9B;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,CAAC;AAEhC;;;;;;;;;;;;GAYG;AACH,SAAS,iBAAiB,CAAC,GAAY;IACrC,MAAM,IAAI,GACR,GAAG,YAAY,QAAQ;QACrB,CAAC,CAAE,GAAG,CAAC,IAA+D;QACtE,CAAC,CAAC,SAAS,CAAC;IAChB,IAAI,IAAI,EAAE,MAAM,KAAK,GAAG;QAAE,MAAM,GAAG,CAAC;IAEpC,MAAM,UAAU,GAAG,sBAAsB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,WAAW,CACf,UAAU,KAAK,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C,MAAM;oBACzC,OAAO;oBACP,kEAAkE;oBAClE,8CAA8C;oBAC9C,GAAG,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;iBACpE,CAAC;YACJ,CAAC,EACD;gBACE,SAAS,EAAE,yBAAyB;gBACpC,OAAO,EAAE,GAAG;gBACZ,WAAW,EAAE,GAAG;gBAChB,MAAM,EAAE,GAAG,CAAC,MAAM;aACnB,CACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;CACF;AAED,gFAAgF;AAEhF,IAAI,QAAsC,CAAC;AAE3C,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,OAAuB;IAC7E,QAAQ,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,IAAI,CAAC,QAAQ;QACX,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;IAC/F,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Shared utilities for biorxiv-mcp-server service layer. Provides
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* HTML error detection, calendar-date and upstream-text normalization,
|
|
4
|
+
* `Retry-After` parsing and rate-limit rejection lookup shared by every fetch
|
|
5
|
+
* path, and the server version string used in User-Agent headers across all
|
|
6
|
+
* services.
|
|
7
7
|
* @module services/shared
|
|
8
8
|
*/
|
|
9
|
-
import type { Context } from '@cyanheads/mcp-ts-core';
|
|
10
|
-
import type { RequestContext } from '@cyanheads/mcp-ts-core/utils';
|
|
11
|
-
/**
|
|
12
|
-
* Cast Context to RequestContext for fetchWithTimeout / withRetry.
|
|
13
|
-
* Context is structurally assignable but lacks the index signature — cast once per call site.
|
|
14
|
-
*/
|
|
15
|
-
export declare function asRc(ctx: Context): RequestContext;
|
|
16
9
|
/** Detect HTML error pages returned instead of JSON by upstream APIs. */
|
|
17
10
|
export declare function detectHtmlError(text: string): boolean;
|
|
18
11
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/services/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/services/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,yEAAyE;AACzE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAU5D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAuBlF;AAED;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAiB7F;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEhE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,MAA4B,CAAC"}
|
package/dist/services/shared.js
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Shared utilities for biorxiv-mcp-server service layer. Provides
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* HTML error detection, calendar-date and upstream-text normalization,
|
|
4
|
+
* `Retry-After` parsing and rate-limit rejection lookup shared by every fetch
|
|
5
|
+
* path, and the server version string used in User-Agent headers across all
|
|
6
|
+
* services.
|
|
7
7
|
* @module services/shared
|
|
8
8
|
*/
|
|
9
9
|
import { McpError } from '@cyanheads/mcp-ts-core/errors';
|
|
10
10
|
import packageJson from '../../package.json' with { type: 'json' };
|
|
11
|
-
/**
|
|
12
|
-
* Cast Context to RequestContext for fetchWithTimeout / withRetry.
|
|
13
|
-
* Context is structurally assignable but lacks the index signature — cast once per call site.
|
|
14
|
-
*/
|
|
15
|
-
export function asRc(ctx) {
|
|
16
|
-
return ctx;
|
|
17
|
-
}
|
|
18
11
|
/** Detect HTML error pages returned instead of JSON by upstream APIs. */
|
|
19
12
|
export function detectHtmlError(text) {
|
|
20
13
|
return /^\s*<(!DOCTYPE\s+html|html[\s>])/i.test(text);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/services/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/services/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,WAAW,MAAM,oBAAoB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEnE,yEAAyE;AACzE,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,mCAAmC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,MAAM,KAAK,GAAG,2BAA2B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxD,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;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C,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAA2B;IACtD,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAAG,OAAO,UAAU,CAAC;AAC1E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAW,WAAW,CAAC,OAAO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/biorxiv-mcp-server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
4
4
|
"mcpName": "io.github.cyanheads/biorxiv-mcp-server",
|
|
5
5
|
"description": "Search and retrieve bioRxiv and medRxiv preprints — by DOI, date interval, or keyword — via MCP. STDIO or Streamable HTTP.",
|
|
6
6
|
"type": "module",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
}
|
|
79
79
|
],
|
|
80
80
|
"license": "Apache-2.0",
|
|
81
|
-
"packageManager": "bun@1.
|
|
81
|
+
"packageManager": "bun@1.4.0",
|
|
82
82
|
"engines": {
|
|
83
83
|
"bun": ">=1.3.0",
|
|
84
84
|
"node": ">=24.0.0"
|
|
@@ -93,20 +93,20 @@
|
|
|
93
93
|
"postcss": "^8.5.23"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
|
-
"@cyanheads/mcp-ts-core": "^0.
|
|
96
|
+
"@cyanheads/mcp-ts-core": "^0.12.3",
|
|
97
97
|
"defuddle": "^0.19.2",
|
|
98
98
|
"linkedom": "^0.18.13",
|
|
99
99
|
"pino-pretty": "^13.1.3",
|
|
100
100
|
"zod": "^4.4.3"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
|
-
"@biomejs/biome": "2.5.
|
|
103
|
+
"@biomejs/biome": "2.5.10",
|
|
104
104
|
"@socketsecurity/bun-security-scanner": "^1.1.2",
|
|
105
|
-
"@types/node": "26.
|
|
105
|
+
"@types/node": "26.2.0",
|
|
106
106
|
"depcheck": "^1.4.7",
|
|
107
107
|
"ignore": "^7.0.6",
|
|
108
|
-
"tsc-alias": "^1.9.
|
|
108
|
+
"tsc-alias": "^1.9.2",
|
|
109
109
|
"typescript": "^7.0.2",
|
|
110
|
-
"vitest": "^4.1.
|
|
110
|
+
"vitest": "^4.1.11"
|
|
111
111
|
}
|
|
112
112
|
}
|
package/server.json
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
"url": "https://github.com/cyanheads/biorxiv-mcp-server",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.5",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
14
14
|
"identifier": "@cyanheads/biorxiv-mcp-server",
|
|
15
15
|
"runtimeHint": "bun",
|
|
16
|
-
"version": "0.2.
|
|
16
|
+
"version": "0.2.5",
|
|
17
17
|
"packageArguments": [
|
|
18
18
|
{
|
|
19
19
|
"type": "positional",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
63
63
|
"identifier": "@cyanheads/biorxiv-mcp-server",
|
|
64
64
|
"runtimeHint": "bun",
|
|
65
|
-
"version": "0.2.
|
|
65
|
+
"version": "0.2.5",
|
|
66
66
|
"packageArguments": [
|
|
67
67
|
{
|
|
68
68
|
"type": "positional",
|