@cyanheads/protein-mcp-server 0.4.0 → 0.4.1

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 (53) hide show
  1. package/AGENTS.md +32 -25
  2. package/CLAUDE.md +32 -25
  3. package/Dockerfile +16 -7
  4. package/LICENSE +1 -1
  5. package/README.md +7 -5
  6. package/changelog/0.4.x/0.4.1.md +32 -0
  7. package/changelog/template.md +60 -19
  8. package/dist/mcp-server/tools/definitions/_schemas.d.ts +34 -6
  9. package/dist/mcp-server/tools/definitions/_schemas.d.ts.map +1 -1
  10. package/dist/mcp-server/tools/definitions/_schemas.js +149 -9
  11. package/dist/mcp-server/tools/definitions/_schemas.js.map +1 -1
  12. package/dist/mcp-server/tools/definitions/analyze-collection.tool.d.ts +9 -4
  13. package/dist/mcp-server/tools/definitions/analyze-collection.tool.d.ts.map +1 -1
  14. package/dist/mcp-server/tools/definitions/analyze-collection.tool.js +42 -13
  15. package/dist/mcp-server/tools/definitions/analyze-collection.tool.js.map +1 -1
  16. package/dist/mcp-server/tools/definitions/compare-structures.tool.d.ts +4 -4
  17. package/dist/mcp-server/tools/definitions/get-annotations.tool.d.ts +1 -1
  18. package/dist/mcp-server/tools/definitions/get-structure.tool.d.ts +2 -2
  19. package/dist/mcp-server/tools/definitions/get-structure.tool.d.ts.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-structure.tool.js +12 -4
  21. package/dist/mcp-server/tools/definitions/get-structure.tool.js.map +1 -1
  22. package/dist/mcp-server/tools/definitions/search-structures.tool.d.ts +5 -3
  23. package/dist/mcp-server/tools/definitions/search-structures.tool.d.ts.map +1 -1
  24. package/dist/mcp-server/tools/definitions/search-structures.tool.js +22 -15
  25. package/dist/mcp-server/tools/definitions/search-structures.tool.js.map +1 -1
  26. package/dist/mcp-server/tools/definitions/track-ligands.tool.d.ts +2 -2
  27. package/dist/services/alignment/alignment-service.d.ts.map +1 -1
  28. package/dist/services/alphafold/alphafold-service.d.ts.map +1 -1
  29. package/dist/services/alphafold/alphafold-service.js +1 -0
  30. package/dist/services/alphafold/alphafold-service.js.map +1 -1
  31. package/dist/services/beacons/beacons-service.d.ts.map +1 -1
  32. package/dist/services/foldseek/foldseek-service.d.ts.map +1 -1
  33. package/dist/services/rcsb/facets.d.ts +19 -19
  34. package/dist/services/rcsb/facets.d.ts.map +1 -1
  35. package/dist/services/rcsb/rcsb-service.d.ts +2 -2
  36. package/dist/services/rcsb/rcsb-service.d.ts.map +1 -1
  37. package/dist/services/rcsb/rcsb-service.js +24 -4
  38. package/dist/services/rcsb/rcsb-service.js.map +1 -1
  39. package/dist/services/rcsb/types.d.ts +14 -3
  40. package/dist/services/rcsb/types.d.ts.map +1 -1
  41. package/dist/services/shared/attribution.d.ts +6 -3
  42. package/dist/services/shared/attribution.d.ts.map +1 -1
  43. package/dist/services/shared/attribution.js +12 -2
  44. package/dist/services/shared/attribution.js.map +1 -1
  45. package/dist/services/shared/http.d.ts +7 -2
  46. package/dist/services/shared/http.d.ts.map +1 -1
  47. package/dist/services/shared/http.js +8 -18
  48. package/dist/services/shared/http.js.map +1 -1
  49. package/dist/services/uniprot/uniprot-service.d.ts.map +1 -1
  50. package/dist/services/uniprot/uniprot-service.js +1 -0
  51. package/dist/services/uniprot/uniprot-service.js.map +1 -1
  52. package/package.json +11 -10
  53. package/server.json +3 -3
package/AGENTS.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** protein-mcp-server
4
- **Version:** 0.4.0
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.10`
4
+ **Version:** 0.4.1
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.5`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
- **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
7
+ **MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
8
8
  **Zod:** ^4.4.3
9
+ **TypeScript:** ^7.0.2
9
10
 
10
11
  > **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.
11
12
 
@@ -188,12 +189,14 @@ Handlers receive a unified `ctx` object. Key properties:
188
189
  | Property | Description |
189
190
  |:---------|:------------|
190
191
  | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
191
- | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
192
+ | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
192
193
  | `ctx.elicit` | Ask user for structured input — form call `(message, schema)` or `.url(message, url)` for an external link. **Check for presence first:** `if (ctx.elicit) { ... }` |
194
+ | `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). |
195
+ | `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`. |
193
196
  | `ctx.signal` | `AbortSignal` for cancellation. |
194
197
  | `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
195
198
  | `ctx.requestId` | Unique request ID. |
196
- | `ctx.tenantId` | Tenant ID from JWT or `'default'` for stdio. |
199
+ | `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
197
200
 
198
201
  ---
199
202
 
@@ -201,7 +204,7 @@ Handlers receive a unified `ctx` object. Key properties:
201
204
 
202
205
  Handlers throw — the framework catches, classifies, and formats.
203
206
 
204
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required descriptive metadata for the agent's next move ( 5 words, lint-validated); for the wire `data.recovery.hint` (mirrored into `content[]` text), pass explicitly at the throw site when dynamic context matters: `ctx.fail('reason', msg, { recovery: { hint: '...' } })`. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
207
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
205
208
 
206
209
  ```ts
207
210
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -213,7 +216,7 @@ errors: [
213
216
  ],
214
217
  async handler(input, ctx) {
215
218
  const item = await db.find(input.id);
216
- if (!item) throw ctx.fail('no_match', `No item ${input.id}`);
219
+ if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
217
220
  return item;
218
221
  }
219
222
  ```
@@ -279,7 +282,7 @@ src/
279
282
 
280
283
  ## Skills
281
284
 
282
- 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.
285
+ 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.
283
286
 
284
287
  **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.
285
288
 
@@ -299,7 +302,7 @@ Available skills:
299
302
  | `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
300
303
  | `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
301
304
  | `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
302
- | `devcheck` | Lint, format, typecheck, audit |
305
+ | `techniques` | Catalog of response/data-shaping techniques — overflow handling, payload shaping, retrieval patterns |
303
306
  | `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
304
307
  | `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
305
308
  | `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
@@ -313,6 +316,7 @@ Available skills:
313
316
  | `api-context` | Context interface, logger, state, progress |
314
317
  | `api-errors` | McpError, JsonRpcErrorCode, error patterns |
315
318
  | `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
319
+ | `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
316
320
  | `api-services` | LLM, Speech, Graph services |
317
321
  | `api-testing` | createMockContext, test patterns |
318
322
  | `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
@@ -331,26 +335,29 @@ When you complete a skill's checklist, check the boxes and add a completion time
331
335
 
332
336
  | Command | Purpose |
333
337
  |:--------|:--------|
334
- | `npm run build` | Compile TypeScript |
335
- | `npm run rebuild` | Clean + build |
336
- | `npm run clean` | Remove build artifacts |
337
- | `npm run devcheck` | Lint + format + typecheck + security + changelog sync |
338
+ | `bun run build` | Compile TypeScript |
339
+ | `bun run rebuild` | Clean + build |
340
+ | `bun run clean` | Remove build artifacts |
341
+ | `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
338
342
  | `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. |
339
- | `npm run tree` | Generate directory structure doc |
340
- | `npm run format` | Auto-fix formatting (safe fixes only) |
341
- | `npm run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
342
- | `npm test` | Run tests |
343
- | `npm run start:stdio` | Production mode (stdio) |
344
- | `npm run start:http` | Production mode (HTTP) |
345
- | `npm run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
346
- | `npm run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
347
- | `npm run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
343
+ | `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
344
+ | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
345
+ | `bun run list-skills` | Print the skill registry |
346
+ | `bun run tree` | Generate directory structure doc |
347
+ | `bun run format` | Auto-fix formatting (safe fixes only) |
348
+ | `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
349
+ | `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
350
+ | `bun run start:stdio` | Production mode (stdio) |
351
+ | `bun run start:http` | Production mode (HTTP) |
352
+ | `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
353
+ | `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
354
+ | `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
348
355
 
349
356
  ---
350
357
 
351
358
  ## Bundling
352
359
 
353
- `npm 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 (`node_modules/**` `skills/`, `.claude/`, `.agents/`, `SKILL.md`) that root-anchored `.mcpbignore` patterns cannot reach. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
360
+ `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 and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
354
361
 
355
362
  **Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
356
363
 
@@ -368,14 +375,14 @@ Each per-version file opens with YAML frontmatter:
368
375
  ---
369
376
  summary: "One-line headline, ≤350 chars" # required — powers the rollup index
370
377
  breaking: false # optional — true flags breaking changes
371
- security: false # optional — true flags security fixes
378
+ security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
372
379
  ---
373
380
 
374
381
  # 0.1.0 — YYYY-MM-DD
375
382
  ...
376
383
  ```
377
384
 
378
- `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. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
385
+ `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`.
379
386
 
380
387
  `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.
381
388
 
package/CLAUDE.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** protein-mcp-server
4
- **Version:** 0.4.0
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.10.10`
4
+ **Version:** 0.4.1
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.11.5`
6
6
  **Engines:** Bun ≥1.3.0, Node ≥24.0.0
7
- **MCP SDK:** `@modelcontextprotocol/sdk` ^1.29.0
7
+ **MCP SDK:** `@modelcontextprotocol/sdk` ^1.30.0
8
8
  **Zod:** ^4.4.3
9
+ **TypeScript:** ^7.0.2
9
10
 
10
11
  > **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.
11
12
 
@@ -188,12 +189,14 @@ Handlers receive a unified `ctx` object. Key properties:
188
189
  | Property | Description |
189
190
  |:---------|:------------|
190
191
  | `ctx.log` | Request-scoped logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId. |
191
- | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
192
+ | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
192
193
  | `ctx.elicit` | Ask user for structured input — form call `(message, schema)` or `.url(message, url)` for an external link. **Check for presence first:** `if (ctx.elicit) { ... }` |
194
+ | `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). |
195
+ | `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`. |
193
196
  | `ctx.signal` | `AbortSignal` for cancellation. |
194
197
  | `ctx.progress` | Task progress (present when `task: true`) — `.setTotal(n)`, `.increment()`, `.update(message)`. |
195
198
  | `ctx.requestId` | Unique request ID. |
196
- | `ctx.tenantId` | Tenant ID from JWT or `'default'` for stdio. |
199
+ | `ctx.tenantId` | Tenant ID from JWT; `'default'` for stdio or HTTP with auth off. |
197
200
 
198
201
  ---
199
202
 
@@ -201,7 +204,7 @@ Handlers receive a unified `ctx` object. Key properties:
201
204
 
202
205
  Handlers throw — the framework catches, classifies, and formats.
203
206
 
204
- **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required descriptive metadata for the agent's next move ( 5 words, lint-validated); for the wire `data.recovery.hint` (mirrored into `content[]` text), pass explicitly at the throw site when dynamic context matters: `ctx.fail('reason', msg, { recovery: { hint: '...' } })`. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
207
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
205
208
 
206
209
  ```ts
207
210
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -213,7 +216,7 @@ errors: [
213
216
  ],
214
217
  async handler(input, ctx) {
215
218
  const item = await db.find(input.id);
216
- if (!item) throw ctx.fail('no_match', `No item ${input.id}`);
219
+ if (!item) throw ctx.fail('no_match', `No item ${input.id}`, ctx.recoveryFor('no_match'));
217
220
  return item;
218
221
  }
219
222
  ```
@@ -279,7 +282,7 @@ src/
279
282
 
280
283
  ## Skills
281
284
 
282
- 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.
285
+ 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.
283
286
 
284
287
  **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.
285
288
 
@@ -299,7 +302,7 @@ Available skills:
299
302
  | `tool-defs-analysis` | Read-only audit of MCP definition language across the surface — voice, leaks, defaults, recovery hints, output descriptions |
300
303
  | `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
301
304
  | `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
302
- | `devcheck` | Lint, format, typecheck, audit |
305
+ | `techniques` | Catalog of response/data-shaping techniques — overflow handling, payload shaping, retrieval patterns |
303
306
  | `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
304
307
  | `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
305
308
  | `release-and-publish` | Push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
@@ -313,6 +316,7 @@ Available skills:
313
316
  | `api-context` | Context interface, logger, state, progress |
314
317
  | `api-errors` | McpError, JsonRpcErrorCode, error patterns |
315
318
  | `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
319
+ | `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
316
320
  | `api-services` | LLM, Speech, Graph services |
317
321
  | `api-testing` | createMockContext, test patterns |
318
322
  | `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
@@ -331,26 +335,29 @@ When you complete a skill's checklist, check the boxes and add a completion time
331
335
 
332
336
  | Command | Purpose |
333
337
  |:--------|:--------|
334
- | `npm run build` | Compile TypeScript |
335
- | `npm run rebuild` | Clean + build |
336
- | `npm run clean` | Remove build artifacts |
337
- | `npm run devcheck` | Lint + format + typecheck + security + changelog sync |
338
+ | `bun run build` | Compile TypeScript |
339
+ | `bun run rebuild` | Clean + build |
340
+ | `bun run clean` | Remove build artifacts |
341
+ | `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
338
342
  | `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. |
339
- | `npm run tree` | Generate directory structure doc |
340
- | `npm run format` | Auto-fix formatting (safe fixes only) |
341
- | `npm run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
342
- | `npm test` | Run tests |
343
- | `npm run start:stdio` | Production mode (stdio) |
344
- | `npm run start:http` | Production mode (HTTP) |
345
- | `npm run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
346
- | `npm run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
347
- | `npm run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
343
+ | `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
344
+ | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
345
+ | `bun run list-skills` | Print the skill registry |
346
+ | `bun run tree` | Generate directory structure doc |
347
+ | `bun run format` | Auto-fix formatting (safe fixes only) |
348
+ | `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
349
+ | `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
350
+ | `bun run start:stdio` | Production mode (stdio) |
351
+ | `bun run start:http` | Production mode (HTTP) |
352
+ | `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
353
+ | `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
354
+ | `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
348
355
 
349
356
  ---
350
357
 
351
358
  ## Bundling
352
359
 
353
- `npm 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 (`node_modules/**` `skills/`, `.claude/`, `.agents/`, `SKILL.md`) that root-anchored `.mcpbignore` patterns cannot reach. MCPB is stdio-only — HTTP and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
360
+ `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 and Cloudflare Workers deployments are unaffected. Consumers who don't need it can delete `manifest.json` and `.mcpbignore`; `lint:packaging` skips cleanly.
354
361
 
355
362
  **Adding an env var requires both files:** `server.json` (registry discovery, `environmentVariables[]`) and `manifest.json` (bundle install UX, `mcp_config.env` + `user_config`). `lint:packaging` (run by `devcheck`) verifies the env var names match.
356
363
 
@@ -368,14 +375,14 @@ Each per-version file opens with YAML frontmatter:
368
375
  ---
369
376
  summary: "One-line headline, ≤350 chars" # required — powers the rollup index
370
377
  breaking: false # optional — true flags breaking changes
371
- security: false # optional — true flags security fixes
378
+ security: false # optional — true ONLY for a source-code security fix, never a dependency CVE bump
372
379
  ---
373
380
 
374
381
  # 0.1.0 — YYYY-MM-DD
375
382
  ...
376
383
  ```
377
384
 
378
- `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. When both are set, badges render `· ⚠️ Breaking · 🛡️ Security`.
385
+ `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`.
379
386
 
380
387
  `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.
381
388
 
package/Dockerfile CHANGED
@@ -4,15 +4,17 @@
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.3 AS build
7
+ FROM oven/bun:1.3.14 AS build
8
8
 
9
9
  WORKDIR /usr/src/app
10
10
 
11
11
  # Copy dependency manifests for optimized layer caching
12
12
  COPY package.json bun.lock ./
13
13
 
14
- # Install all dependencies (including dev dependencies for building)
15
- RUN bun install --frozen-lockfile
14
+ # Install all dependencies (including dev dependencies for building).
15
+ # The BuildKit cache mount persists Bun's global package cache across builds.
16
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
17
+ bun install --frozen-lockfile --ignore-scripts
16
18
 
17
19
  # Copy the rest of the source code
18
20
  COPY . .
@@ -28,7 +30,7 @@ RUN bun run build
28
30
  # application. It uses a slim base image and only includes production
29
31
  # dependencies and build artifacts.
30
32
  # ==============================================================================
31
- FROM oven/bun:1.3-slim AS production
33
+ FROM oven/bun:1.3.14-slim AS production
32
34
 
33
35
  WORKDIR /usr/src/app
34
36
 
@@ -49,14 +51,21 @@ COPY package.json bun.lock ./
49
51
 
50
52
  # Install only production dependencies, ignoring any lifecycle scripts (like 'prepare')
51
53
  # that are not needed in the final production image.
52
- RUN bun install --production --frozen-lockfile --ignore-scripts
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.
59
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
60
+ bun install --production --omit=peer --frozen-lockfile --ignore-scripts
53
61
 
54
62
  # Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
55
63
  # These are not bundled by default to keep the base image lean. Enable at build time
56
64
  # with: docker build --build-arg OTEL_ENABLED=true
57
65
  ARG OTEL_ENABLED=true
58
- RUN if [ "$OTEL_ENABLED" = "true" ]; then \
59
- bun add @hono/otel \
66
+ RUN --mount=type=cache,target=/root/.bun/install/cache \
67
+ if [ "$OTEL_ENABLED" = "true" ]; then \
68
+ bun add --omit=dev --omit=peer --ignore-scripts @hono/otel \
60
69
  @opentelemetry/instrumentation-http \
61
70
  @opentelemetry/exporter-metrics-otlp-http \
62
71
  @opentelemetry/exporter-trace-otlp-http \
package/LICENSE CHANGED
@@ -186,7 +186,7 @@ Apache License
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2025 Casey Hand @cyanheads
189
+ Copyright 2026 Casey Hand @cyanheads
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-0.4.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/protein-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/protein-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/protein-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.4.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![Docker](https://img.shields.io/badge/Docker-ghcr.io-2496ED?style=flat-square&logo=docker&logoColor=white)](https://github.com/users/cyanheads/packages/container/package/protein-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.30.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/protein-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/protein-mcp-server) [![TypeScript](https://img.shields.io/badge/TypeScript-^7.0.2-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.14-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -46,9 +46,9 @@ Seven tools spanning the structure-research arc — discover, fetch, find homolo
46
46
  Federated search across experimental (PDB) and predicted (computed-model) structures via RCSB Search v2.
47
47
 
48
48
  - Free-text, protein-sequence (triggers an mmseqs2 similarity search), and organism / method / resolution filters
49
- - `content_type` scopes the search to `experimental`, `predicted`, or `all`
50
- - Experimental hits are enriched with title, method, resolution, and organism
51
- - Optional `facets` return a method / organism / release-year breakdown alongside the hits at no extra call
49
+ - `content_type` scopes the search to `experimental`, `predicted`, or `all` — the default `all` is a genuine union of both universes, so computed models appear alongside PDB entries
50
+ - Every hit names its `source`; experimental hits are enriched with title, method, resolution, and organism, while computed models carry the UniProt accession parsed from their ID
51
+ - Optional `facets` return a method / organism / release-year breakdown alongside the hits at no extra call, each reporting how many matches carry no value for that dimension
52
52
  - Chain hit IDs straight into `protein_get_structure`
53
53
 
54
54
  ---
@@ -57,7 +57,7 @@ Federated search across experimental (PDB) and predicted (computed-model) struct
57
57
 
58
58
  Fetch structures with metadata and coordinate-file URLs, resolving across providers by `source`.
59
59
 
60
- - `source: experimental` takes PDB entry IDs, batched in one RCSB GraphQL call
60
+ - `source: experimental` takes PDB entry IDs, batched in one RCSB GraphQL call; it also resolves the computed-model IDs search returns (`AF_*` / `MA_*`), which come back as `source: predicted` credited to their modelling provider
61
61
  - `source: predicted` takes UniProt accessions and returns the AlphaFold model with pLDDT/PAE confidence
62
62
  - `source: best_available` takes UniProt accessions and returns the top federated model (experimental if one exists, else the best prediction)
63
63
  - Per-ID partial success — unresolved IDs are listed in `failed[]`, not a batch-level error
@@ -111,6 +111,7 @@ Profile the PDB into distributions and trends over an optional scoping query —
111
111
  - `interval` sets the bin width for value histograms or the period for date histograms (`year` / `month` / `quarter`)
112
112
  - Scope with a free-text `query`, `organism`, `method`, or `max_resolution`; `content_type` selects the structure universe
113
113
  - `bucket_limit` caps buckets per dimension; truncation is flagged in the response
114
+ - Every dimension reports `missingValueCount` — matches in scope carrying no value for that attribute, which therefore fall in no bucket (a `resolution` breakdown does not cover NMR entries, and neither `method` nor `resolution` covers computed models)
114
115
 
115
116
  ---
116
117
 
@@ -351,6 +352,7 @@ Structure and annotation data comes from public upstream databases, each under i
351
352
  |:---|:---|:---|
352
353
  | [RCSB PDB](https://www.rcsb.org/) | `protein_get_structure` — experimental records | CC0 1.0 Universal |
353
354
  | [AlphaFold DB](https://alphafold.ebi.ac.uk/) | `protein_get_structure` — predicted models | CC BY 4.0 |
355
+ | [ModelArchive](https://www.modelarchive.org/) | `protein_get_structure` — `MA_*` computed models | CC BY 4.0 |
354
356
  | [SWISS-MODEL](https://swissmodel.expasy.org/) | `protein_get_structure` — `best_available` models | CC BY-SA 4.0 |
355
357
  | [BFVD](https://bfvd.steineggerlab.workers.dev/) | `protein_get_structure` — `best_available` models | CC BY 4.0 |
356
358
  | [UniProt](https://www.uniprot.org/) | `protein_get_annotations` | CC BY 4.0 |
@@ -0,0 +1,32 @@
1
+ ---
2
+ summary: "protein_search_structures' default content_type union now returns computed models, facet dimensions disclose coverage gaps and empty-dimension explanations, and protein_get_structure credits computed-model IDs to their modelling provider instead of the PDB."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.4.1 — 2026-08-16
8
+
9
+ ## Added
10
+
11
+ - **`protein_search_structures` / `protein_analyze_collection` facets** — every dimension now reports `missingValueCount`, the count of in-scope matches carrying no value for that attribute; a materially incomplete dimension (≥1% gap) adds an advisory to the shared `notice` field. ([#32](https://github.com/cyanheads/protein-mcp-server/issues/32))
12
+ - **`protein_analyze_collection`** — `group_by` on `method` or `resolution` under `content_type: "predicted"` now emits a notice naming the empty dimension, since computed models carry no experimental method or resolution metadata. ([#27](https://github.com/cyanheads/protein-mcp-server/issues/27))
13
+
14
+ ## Changed
15
+
16
+ - **Dependencies:**
17
+ - `@cyanheads/mcp-ts-core` ^0.10.10 → ^0.11.5
18
+ - `@modelcontextprotocol/sdk` ^1.29.0 → ^1.30.0 (transitive via mcp-ts-core)
19
+ - `typescript` ^6.0.3 → ^7.0.2 (dev)
20
+ - `@biomejs/biome` 2.5.2 → 2.5.8 (dev)
21
+ - `@types/node` 26.1.0 → 26.2.0 (dev)
22
+ - `tsc-alias` ^1.8.17 → ^1.9.1 (dev)
23
+ - `vitest` ^4.1.9 → ^4.1.10 (dev)
24
+ - `ignore` ^7.0.5 → ^7.0.6 (dev)
25
+ - `@socketsecurity/bun-security-scanner` ^1.1.2 added (dev) — wired as `bunfig.toml`'s `install.security` scanner
26
+ - Bun packageManager pin 1.3.2 → 1.3.14
27
+
28
+ ## Fixed
29
+
30
+ - **`protein_search_structures` / `protein_analyze_collection`** — `content_type: "all"` (the default on `protein_search_structures`) now sends `results_content_type: ["experimental", "computational"]` explicitly; omitting the option, as before, is RCSB's experimental-only default, so `"all"` silently dropped every computed model. ([#29](https://github.com/cyanheads/protein-mcp-server/issues/29))
31
+ - **`renderFacets()`** — a facet dimension with zero buckets no longer renders a bare `**dimension**` heading with nothing under it; both tools now emit an explicit "no data in this scope" line. ([#26](https://github.com/cyanheads/protein-mcp-server/issues/26))
32
+ - **`protein_get_structure`** — a computed-model ID (`AF_*`/`MA_*`) resolved via `source: "experimental"` now comes back `source: "predicted"` with its modelling provider (AlphaFold DB, ModelArchive) named, credited to that provider's license instead of the PDB's CC0.
@@ -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 unrelated changes with
9
- # semicolons pick the headline. Quotes required: unquoted YAML treats `: `
10
- # inside the value as a key separator and fails GitHub's strict parser.
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,
@@ -15,16 +16,19 @@ summary: ""
15
16
  # usage. Flagged as `Breaking` in the rollup.
16
17
  breaking: false
17
18
 
18
- # Set `true` if this release contains any security fix. Pairs with the
19
- # `## Security` section below. Flagged as `Security` in the rollup so
20
- # users can triage upgrade urgency at a glance.
19
+ # Set `true` ONLY for a security fix in THIS project's own source code — a
20
+ # vulnerability or hardening in code you ship. A dependency or transitive CVE
21
+ # bump is routine maintenance, NOT a security release: record it under
22
+ # `## Dependencies` (with the advisory ID) and leave this `false`. When true,
23
+ # pairs with the `## Security` section below and flags `Security` in the rollup.
21
24
  security: false
22
25
 
23
26
  # Optional free-form notes for maintenance agents processing this release.
24
27
  # Not rendered in CHANGELOG — consumed by agents running `maintenance` on
25
- # downstream servers. Use for adoption instructions that don't fit the
26
- # human-facing sections: new files to create, fields to populate, one-time
27
- # migration steps. Omit the field entirely when there's nothing to say.
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.
28
32
  # agent-notes: |
29
33
  # <instructions for downstream maintenance agents>
30
34
  ---
@@ -39,17 +43,54 @@ security: false
39
43
  each bullet with the symbol or concept name in **bold** so they can skip
40
44
  what's irrelevant and zoom in on what's not.
41
45
 
42
- Tone: terse, fact-dense, not verbose. Default to one sentence per bullet —
43
- name the symbol, state what changed, stop. Use a second sentence only when
44
- it carries weight. If a bullet feels long, it is.
45
-
46
- Cut: mechanism walkthroughs (those belong in JSDoc, CLAUDE.md/AGENTS.md, or the
47
- relevant skill), ceremonial framings ("This release introduces…",
48
- backwards-compat paragraphs), file-by-file test enumerations, internal
49
- implementation notes. Prefer code/symbol names over English re-explanations.
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.
50
89
 
51
90
  Narrative intro: skip by default. Add one short sentence only when the
52
- 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.
53
94
 
54
95
  Sections: Keep a Changelog order — Added, Changed, Deprecated, Removed,
55
96
  Fixed, Security. Include only sections with entries; delete the rest
@@ -1,12 +1,25 @@
1
1
  /**
2
- * @fileoverview Shared Zod output schemas and helpers for the facet breakdown
3
- * surfaced by `protein_analyze_collection` and `protein_search_structures`. Nesting
4
- * is bounded to two levels (a dimension's buckets may each carry one child
5
- * dimension), matching the deepest cross-tab the facet engine produces.
2
+ * @fileoverview Shared schemas and helpers for the two tools that expose a facet
3
+ * breakdown and a `content_type` scope `protein_analyze_collection` and
4
+ * `protein_search_structures`. Facet nesting is bounded to two levels (a
5
+ * dimension's buckets may each carry one child dimension), matching the deepest
6
+ * cross-tab the facet engine produces. Every dimension position also reports its
7
+ * coverage gap, so buckets that sum to less than the stated total say so.
6
8
  * @module mcp-server/tools/definitions/_schemas
7
9
  */
8
10
  import { z } from '@cyanheads/mcp-ts-core';
9
11
  import type { FacetDimension } from '../../../services/rcsb/types.js';
12
+ /**
13
+ * The agent-facing `content_type` scope → the RCSB content universes it selects.
14
+ * `all` names both members explicitly: omitting `results_content_type` upstream
15
+ * is experimental-only, not a union. Shared so the two tools that expose the
16
+ * enum cannot drift apart on what a scope means.
17
+ */
18
+ export declare const CONTENT_TYPE_SCOPES: {
19
+ experimental: "experimental"[];
20
+ predicted: "computational"[];
21
+ all: ("computational" | "experimental")[];
22
+ };
10
23
  /** A facet dimension and its buckets. */
11
24
  export declare const facetDimensionSchema: z.ZodObject<{
12
25
  dimension: z.ZodString;
@@ -24,15 +37,30 @@ export declare const facetDimensionSchema: z.ZodObject<{
24
37
  rangeTo: z.ZodOptional<z.ZodNumber>;
25
38
  }, z.core.$strip>>;
26
39
  truncated: z.ZodOptional<z.ZodBoolean>;
40
+ missingValueCount: z.ZodNumber;
27
41
  }, z.core.$strip>>>;
28
42
  }, z.core.$strip>>;
29
43
  truncated: z.ZodOptional<z.ZodBoolean>;
44
+ missingValueCount: z.ZodNumber;
30
45
  }, z.core.$strip>;
31
46
  export type FacetDimensionOutput = z.infer<typeof facetDimensionSchema>;
32
- /** Project a domain {@link FacetDimension} to the output shape, capping buckets. */
33
- export declare function toFacetOutput(facet: FacetDimension, cap: number): FacetDimensionOutput;
47
+ /**
48
+ * Project a domain {@link FacetDimension} to the output shape, capping buckets.
49
+ * `total` is the population the buckets describe — the response total for a
50
+ * top-level dimension, and the parent bucket's count for a nested one.
51
+ */
52
+ export declare function toFacetOutput(facet: FacetDimension, cap: number, total: number): FacetDimensionOutput;
34
53
  /** Render a list of facet dimensions to markdown lines for `format()` parity. */
35
54
  export declare function renderFacets(facets: FacetDimensionOutput[]): string[];
55
+ /**
56
+ * Advisory fragments for the dimensions whose coverage gap is material, ready to
57
+ * join into the shared `notice` field alongside a caller's other advisories.
58
+ *
59
+ * A dimension that aggregated to nothing at all is skipped: the empty-dimension
60
+ * line in `format()` (and, where it applies, the caller's scope notice) already
61
+ * report it, and quantifying a 100% gap on top adds nothing.
62
+ */
63
+ export declare function coverageNotices(facets: FacetDimensionOutput[], total: number): string[];
36
64
  /** License + citation for one upstream data source that contributed to a response. */
37
65
  export declare const attributionSchema: z.ZodObject<{
38
66
  source: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"_schemas.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AA4D/D,yCAAyC;AACzC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;iBAW4B,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAWxE,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,oBAAoB,CAsBtF;AAkBD,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAarE;AAED,sFAAsF;AACtF,eAAO,MAAM,iBAAiB;;;;;iBAWmD,CAAC;AAElF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAM7E"}
1
+ {"version":3,"file":"_schemas.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/_schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AAC3C,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;CAIuC,CAAC;AAiExE,yCAAyC;AACzC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;iBAgB4B,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAgCxE;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,cAAc,EACrB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACZ,oBAAoB,CAwBtB;AA0CD,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,CAoBrE;AAuDD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAcvF;AAED,sFAAsF;AACtF,eAAO,MAAM,iBAAiB;;;;;iBAWmD,CAAC;AAElF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,iBAAiB,EAAE,GAAG,MAAM,EAAE,CAM7E"}