@cyanheads/hn-mcp-server 0.5.15 → 0.5.17

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 (29) hide show
  1. package/AGENTS.md +407 -0
  2. package/CLAUDE.md +55 -31
  3. package/README.md +78 -68
  4. package/changelog/0.5.x/0.5.16.md +29 -0
  5. package/changelog/0.5.x/0.5.17.md +34 -0
  6. package/changelog/template.md +9 -26
  7. package/dist/config/server-config.d.ts.map +1 -1
  8. package/dist/config/server-config.js +3 -2
  9. package/dist/config/server-config.js.map +1 -1
  10. package/dist/index.js +1 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts +5 -0
  13. package/dist/mcp-server/tools/definitions/get-stories.tool.d.ts.map +1 -1
  14. package/dist/mcp-server/tools/definitions/get-stories.tool.js +5 -0
  15. package/dist/mcp-server/tools/definitions/get-stories.tool.js.map +1 -1
  16. package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts +6 -0
  17. package/dist/mcp-server/tools/definitions/get-thread.tool.d.ts.map +1 -1
  18. package/dist/mcp-server/tools/definitions/get-thread.tool.js +6 -0
  19. package/dist/mcp-server/tools/definitions/get-thread.tool.js.map +1 -1
  20. package/dist/mcp-server/tools/definitions/get-user.tool.d.ts +6 -0
  21. package/dist/mcp-server/tools/definitions/get-user.tool.d.ts.map +1 -1
  22. package/dist/mcp-server/tools/definitions/get-user.tool.js +6 -0
  23. package/dist/mcp-server/tools/definitions/get-user.tool.js.map +1 -1
  24. package/dist/mcp-server/tools/definitions/search-content.tool.d.ts +5 -0
  25. package/dist/mcp-server/tools/definitions/search-content.tool.d.ts.map +1 -1
  26. package/dist/mcp-server/tools/definitions/search-content.tool.js +5 -0
  27. package/dist/mcp-server/tools/definitions/search-content.tool.js.map +1 -1
  28. package/package.json +13 -15
  29. package/server.json +3 -3
package/CLAUDE.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # Developer Protocol
2
2
 
3
3
  **Server:** hn-mcp-server
4
- **Version:** 0.5.15
5
- **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.12.5`
6
- **Engines:** Bun ≥1.3.0, Node ≥24.0.0
4
+ **Version:** 0.5.17
5
+ **Framework:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) `^0.13.6`
6
+ **Engines:** Bun ≥1.4.0, Node ≥24.0.0
7
7
  **MCP SDK:** `@modelcontextprotocol/server` 2.0.0
8
- **Zod:** ^4.5.4
8
+ **Zod:** ^4.6.5
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.
11
11
 
@@ -37,6 +37,7 @@ Tailor suggestions to what's actually missing or stale — don't recite the full
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
+ - **Cut noise.** Add only what earns its place: no speculative generality, no guards for states the framework already prevents (Zod-validated params, classified errors), no abstraction until a third caller proves it, no option nothing sets.
40
41
  - **Close the loop on issues.** When implementing work tracked by a GitHub issue, comment on the issue with what landed and close it. Do both — a comment without a close leaves stale issues open; a close without a comment leaves no record of what shipped. The comment is for future readers — state the concrete changes, not the conversation that produced them.
41
42
 
42
43
  ---
@@ -121,6 +122,21 @@ await createApp({
121
122
 
122
123
  `lint:packaging` (check 9) validates the pair against the unscoped package name.
123
124
 
125
+ ### Session posture and shutdown
126
+
127
+ Two more `createApp()` options shape how the server runs rather than how it presents itself:
128
+
129
+ ```ts
130
+ await createApp({
131
+ sessionMode: 'stateless', // or { default: 'stateful', require: 'stateful' }
132
+ setup() { initHnService(); },
133
+ });
134
+ ```
135
+
136
+ `sessionMode` declares the HTTP session posture in `src/` instead of leaving it to a deployment's `MCP_SESSION_MODE`, which still wins whenever it carries a meaningful value (an empty string and an unsubstituted `${…}` placeholder read as unset and fall through to the option). Stateless is right here: no tool calls `ctx.requestInput`, so no caller ever needs a session to answer a mid-handler prompt. Add `require: 'stateful'` if one ever does — startup then fails with a `ConfigurationError` rather than serving a mode in which a 2025-era client can never answer. Stdio is never refused.
137
+
138
+ `teardown(core)` is the `setup()` counterpart — release a watcher, socket, or non-`unref()`'d timer there. `initHnService()` allocates none of those (the service holds a concurrency limit and nothing else), so this server declares no `teardown`. Add one alongside any future long-lived handle.
139
+
124
140
  ---
125
141
 
126
142
  ## Context
@@ -129,7 +145,7 @@ Handlers receive a unified `ctx` object. Key properties:
129
145
 
130
146
  | Property | Description |
131
147
  |:---------|:------------|
132
- | `ctx.log` | Request-scoped dual-sink logger — `.debug()`, `.info()`, `.notice()`, `.warning()`, `.error()`. Auto-correlates requestId, traceId, tenantId; eligible messages also reach the client through MCP logging notifications. |
148
+ | `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. |
133
149
  | `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
134
150
  | `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. |
135
151
  | `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
@@ -145,7 +161,7 @@ Handlers receive a unified `ctx` object. Key properties:
145
161
 
146
162
  Handlers throw — the framework catches, classifies, and formats.
147
163
 
148
- **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`, `RequestCancelled`) bubble freely and don't need declaring.
164
+ **Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable?, severity?, thrownBy? }]` 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 unless the message already contains it verbatim); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Forwarding it is lint-enforced per throw site (`error-contract-recovery-unforwarded`). `severity` (`debug` / `info` / `notice` / `warning`) drops the log record for a modeled outcome below `error` — the `item_not_found` / `user_not_found` misses use `notice`; upstream faults keep `error`. Mark an entry the service layer throws with `thrownBy: 'service'` so `error-contract-unthrown` skips it — lint-only metadata, nothing at runtime reads it. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
149
165
 
150
166
  ```ts
151
167
  import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
@@ -153,7 +169,8 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
153
169
  errors: [
154
170
  { reason: 'item_not_found', code: JsonRpcErrorCode.NotFound,
155
171
  when: 'HN reports no item exists for the given itemId.',
156
- recovery: 'Verify the itemId via hn_search_content or hn_get_stories.' },
172
+ recovery: 'Verify the itemId via hn_search_content or hn_get_stories.',
173
+ severity: 'notice' },
157
174
  ],
158
175
  async handler(input, ctx) {
159
176
  const root = await hn.fetchItem(input.itemId, ctx);
@@ -184,7 +201,7 @@ import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
184
201
  throw new McpError(JsonRpcErrorCode.DatabaseError, 'Connection failed', { pool: 'primary' });
185
202
  ```
186
203
 
187
- **Service-layer:** services don't have `ctx.fail`, but can carry the contract reason via `data: { reason: 'X' }` on a factory throw. The auto-classifier preserves `data` on the wire so clients see the same `error.data.reason` they'd see from `ctx.fail`. See framework CLAUDE.md and `api-errors` skill for the full auto-classification table and all factories.
204
+ **Service-layer:** services don't have `ctx.fail`, but can carry the contract reason via `data: { reason: 'X' }` on a factory throw. The auto-classifier preserves `data` on the wire so clients see the same `error.data.reason` they'd see from `ctx.fail`. `hn-service.ts` throws all five `upstream_*` reasons this way, so each of their `errors[]` entries carries `thrownBy: 'service'` — `error-contract-unthrown` reads the handler body alone and would otherwise flag them as dead. See framework CLAUDE.md and `api-errors` skill for the full auto-classification table and all factories.
188
205
 
189
206
  ---
190
207
 
@@ -222,9 +239,9 @@ src/
222
239
 
223
240
  ## Skills
224
241
 
225
- 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.
242
+ Skills are modular instructions in `framework-skills/` at the project root. Read them directly when a task matches — e.g., `framework-skills/add-tool/SKILL.md` when adding a tool. `bun run list-skills` prints the full registry. The directory is deliberately not `skills/`: Claude Code and Codex auto-load a plugin's root `skills/`, so a server that ships `.claude-plugin/` or `.codex-plugin/` would hand these development skills to every agent that installs it. Keep `skills/` free for skills meant for those agents.
226
243
 
227
- **Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). This makes skills available as context without needing to reference `skills/` paths manually. After framework updates, run the `maintenance` skill — it re-syncs the agent directory automatically (Phase B).
244
+ **Agent skill directory:** Copy skills into the directory your agent discovers (Claude Code: `.claude/skills/`, others: equivalent). Skills then load as context without referencing `framework-skills/` paths. After framework updates, run the `maintenance` skill — Phase B re-syncs the agent directory.
228
245
 
229
246
  Available skills:
230
247
 
@@ -233,7 +250,7 @@ Available skills:
233
250
  | `setup` | Post-init project orientation |
234
251
  | `design-mcp-server` | Design tool surface, resources, and services for a new server |
235
252
  | `add-tool` | Scaffold a new tool definition |
236
- | `add-app-tool` | Scaffold an MCP App tool + UI resource pair (interactive HTML UI) |
253
+ | `add-app-tool` | Scaffold an MCP App tool + paired UI resource |
237
254
  | `add-resource` | Scaffold a new resource definition |
238
255
  | `add-prompt` | Scaffold a new prompt definition |
239
256
  | `add-service` | Scaffold a new service integration |
@@ -243,27 +260,28 @@ Available skills:
243
260
  | `security-pass` | Audit server for MCP-flavored security gaps: output injection, scope blast radius, input sinks, tenant isolation |
244
261
  | `code-simplifier` | Post-session cleanup against `git diff` — modernize syntax, consolidate duplication, align with the codebase |
245
262
  | `polish-docs-meta` | Finalize docs, README, metadata, and agent protocol for shipping |
246
- | `git-wrapup` | Land working-tree changes as a versioned commit + annotated tag — version bump, changelog, verify, tag. Local only. |
247
- | `release-and-publish` | Push + npm + MCP Registry + GitHub Release + Docker. Picks up from `git-wrapup` |
263
+ | `git-wrapup` | Land working-tree changes as a commit stack — version bump, changelog, verify, commit by concern, release commit on top. No tag, no push to main; opens the release PR when the project declares release PR mode |
264
+ | `release-pr-review` | Review pass on an open release PR — simplifier + correctness review, fixes as ordinary commits on top of the stack, PR body kept in sync. Release PR mode only |
265
+ | `release-and-publish` | Fast-forward merge (release PR mode) + tag + push + npm + MCP Registry + GH Release + Docker. Picks up from `git-wrapup` |
248
266
  | `maintenance` | Investigate changelogs, adopt upstream changes, sync skills to agent dirs |
249
267
  | `orchestrations` | Chain task skills into a gated multi-phase pipeline — build-out, QA-fix, update-ship — when you can spawn sub-agents |
250
- | `techniques` | Catalog of reusable response/data-shaping patterns (outline-on-overflow, etc.) |
268
+ | `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
269
+ | `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
270
+ | `techniques` | Catalog of response/data-shaping techniques — overflow handling, payload shaping, retrieval patterns |
251
271
  | `api-auth` | Auth modes, scopes, JWT/OAuth |
252
272
  | `api-canvas` | DataCanvas: register tabular data, run SQL, export, plus the `spillover()` helper for big result sets — Tier 3 opt-in |
253
273
  | `api-config` | AppConfig, parseConfig, env vars |
254
274
  | `api-context` | Context interface, RequestContext, logger, state, multi-round-trip input |
255
275
  | `api-errors` | McpError, JsonRpcErrorCode, error patterns |
256
276
  | `api-linter` | Definition linter rule catalog — invoked by `bun run lint:mcp` and `devcheck` |
257
- | `api-mirror` | MirrorService: persistent self-refreshing local index (SQLite+FTS5) for bulk/slow upstream datasets |
277
+ | `api-mirror` | MirrorService: persistent self-refreshing local mirror (embedded SQLite + FTS5) of a bulk upstream dataset — Tier 3 opt-in |
258
278
  | `api-services` | LLM, Speech, Graph services |
259
279
  | `api-testing` | createMockContext, test patterns |
260
280
  | `api-utils` | Formatting, parsing, security, pagination, scheduling, telemetry helpers |
261
281
  | `api-telemetry` | OTel catalog: spans, metrics, completion logs, env config, cardinality rules |
262
282
  | `api-workers` | Cloudflare Workers runtime |
263
- | `report-issue-framework` | File a bug or feature request against `@cyanheads/mcp-ts-core` via `gh` CLI |
264
- | `report-issue-local` | File a bug or feature request against this server's own repo via `gh` CLI |
265
283
 
266
- **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.
284
+ **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*, `framework-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.
267
285
 
268
286
  When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
269
287
 
@@ -282,27 +300,30 @@ When you complete a skill's checklist, check the boxes and add a completion time
282
300
  | `bun run tree` | Generate directory structure doc |
283
301
  | `bun run format` | Auto-fix formatting (safe fixes only) |
284
302
  | `bun run format:unsafe` | Also apply Biome's unsafe autofixes — review the diff; they can change behavior |
285
- | `bun run list-skills` | Print skills index from project `skills/` |
303
+ | `bun run list-skills` | Print the skill registry |
286
304
  | `bun run lint:mcp` | Validate MCP tool/resource definitions (rule catalog: `api-linter` skill) |
287
- | `bun run lint:packaging` | Validate env-var alignment between `manifest.json` and `server.json` |
305
+ | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity, MCPB `user_config` wiring, plugin manifests (run by devcheck) |
288
306
  | `bun run bundle` | Build, pack, and clean a `.mcpb` for one-click Claude Desktop install |
289
307
  | `bun run changelog:build` | Regenerate `CHANGELOG.md` from `changelog/*.md` |
290
308
  | `bun run changelog:check` | Verify `CHANGELOG.md` is in sync (used by devcheck) |
291
- | `bun run audit:refresh` | Delete `bun.lock`, reinstall, re-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. |
309
+ | `bun run audit:fix` | `bun audit fix` — upgrade vulnerable packages to the lowest safe version within existing ranges (`--dry-run` previews, `--latest` rewrites ranges). First response when `devcheck` flags a transitive advisory; then `bun update <name>`, then `bun dedupe` |
310
+ | `bun run audit:refresh` | Delete `bun.lock` and reinstall. Last resort after `audit:fix`, `bun update <name>`, and `bun dedupe` — re-resolves every ranged dep (the framework pin included) and rewrites the lockfile as `lockfileVersion: 2` |
292
311
  | `bun run test` | Run tests (Vitest — use `bun run test`, not `bun test`) |
293
312
  | `bun run test:coverage` | Run the full Vitest suite with Istanbul coverage |
294
313
  | `bun run start:stdio` | Production mode (stdio) |
295
314
  | `bun run start:http` | Production mode (HTTP) |
296
315
 
316
+ **CI is one file.** `.github/workflows/codeql.yml` is the only GitHub Actions workflow: CodeQL is GitHub-owned end to end, and the file runs only while the repo's CodeQL *default setup* is turned off. Verification — `devcheck`, tests, the release gates — runs locally; don't add a workflow that re-runs it.
317
+
297
318
  ---
298
319
 
299
320
  ## Bundling
300
321
 
301
- `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.
322
+ `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 (`framework-skills/`, `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.
302
323
 
303
- **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.
324
+ **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, that every `user_config` option is wired into `mcp_config.env` as `"X": "${user_config.X}"` (the host substitutes nothing else — `"${X}"` reaches the server as that literal string), and that an optional string option carries `"default": ""`.
304
325
 
305
- **README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `skills/polish-docs-meta/references/readme.md`.
326
+ **README install badges** (Claude Desktop `.mcpb`, Cursor, VS Code) and the `base64` / `encodeURIComponent` config-generation commands are ship-time concerns — run the `polish-docs-meta` skill, which carries the badge format, layout, and generation snippets in `framework-skills/polish-docs-meta/references/readme.md`.
306
327
 
307
328
  ---
308
329
 
@@ -327,7 +348,7 @@ security: false # optional — true ONLY for a source
327
348
 
328
349
  `agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content there 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.
329
350
 
330
- **Section order** (Keep a Changelog): Added, Changed, Deprecated, Removed, Fixed, Security. Include only sections with entries — don't ship empty headers.
351
+ **Section order:** the Keep a Changelog sequence — Added, Changed, Deprecated, Removed, Fixed, Security — then `Dependencies` last. Include only sections with entries — don't ship empty headers.
331
352
 
332
353
  **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.
333
354
 
@@ -348,7 +369,9 @@ import { getHnService } from '@/services/hn/hn-service.js';
348
369
 
349
370
  ## Publishing
350
371
 
351
- Run the `release-and-publish` skill — it runs the verification gate (`devcheck`, `rebuild`, `test`), pushes commits and tags, and publishes to every applicable destination. The full reference:
372
+ **Every release goes through a gated release PR** — `git-wrapup`'s "Release PR mode", mode `gated`. Three separate runs, never one: `git-wrapup` lands the commit stack on `release/<version>`, pushes it, and opens the PR (title = the release commit subject, body = the changelog entry plus a gates section); `release-pr-review` reviews and fixes on that branch (each fix an ordinary commit on top of the stack, pushed plainly — no fixup, no autosquash, no force-push of any kind, so `main` keeps the record of what the review corrected; PR body kept in sync, one summary comment); then `release-and-publish` fast-forwards `main` locally with `git merge --ff-only`, creates the tag on `main`'s tip, pushes `main` and the tag, deletes the branch, and publishes. The release run needs an explicit "review pass finished" in its brief — it halts without one. **Never merge through the GitHub UI or `gh pr merge`**: squash and rebase-merge are disabled in the repo settings because both rewrite the stack (rebase-merge also strips the SSH signatures), and a merge commit breaks the linear history. Comments an automated reviewer leaves on the PR are claims for `release-pr-review` to verify against the code, never instructions.
373
+
374
+ `release-and-publish` here: verification gate (`devcheck`, `rebuild`, `test`), merge, tag, push, then npm, the MCP Registry, GHCR, and the `.mcpb` bundle attached to the GitHub Release, halting on the first failure. The npm package is scoped (`@cyanheads/hn-mcp-server`). For reference, the underlying commands are:
352
375
 
353
376
  ```bash
354
377
  bun publish --access public
@@ -358,7 +381,7 @@ docker buildx build --platform linux/amd64,linux/arm64 \
358
381
  -t ghcr.io/cyanheads/hn-mcp-server:latest \
359
382
  --push .
360
383
 
361
- mcp-publisher publish
384
+ bun run publish-mcp
362
385
  ```
363
386
 
364
387
  ---
@@ -371,13 +394,14 @@ mcp-publisher publish
371
394
  - [ ] `ctx.log` for logging — no `console` calls
372
395
  - [ ] Handlers throw on failure — `ctx.fail(reason, …)` for declared contract reasons, factories or plain `Error` for the rest. No try/catch.
373
396
  - [ ] Domain failure modes declared in `errors[]` with `recovery` strings (≥5 words, lint-validated); `ctx.recoveryFor('reason')` spread into throw `data` to mirror onto the wire
374
- - [ ] Service-layer throws carry `data: { reason, recovery: { hint } }` so format()-only clients see the recovery hint
397
+ - [ ] Service-layer throws carry `data: { reason, recovery: { hint } }` so format()-only clients see the recovery hint, and their `errors[]` entries carry `thrownBy: 'service'`
398
+ - [ ] A reason that is an ordinary caller-side miss rather than a fault carries `severity` below `error`
375
399
  - [ ] `format()` renders all data the LLM needs — different clients forward different surfaces (Claude Code → `structuredContent`, Claude Desktop → `content[]`); both must carry the same data
376
400
  - [ ] Wrapping HN/Algolia: schemas reflect real upstream sparsity (HN omits fields freely); `format()` preserves uncertainty rather than fabricating from missing data
377
401
  - [ ] Tests cover at least one sparse payload case per tool that wraps upstream items
378
402
  - [ ] Tests use `createMockContext({ errors: tool.errors })` when the test exercises `ctx.fail`
379
403
  - [ ] Registered in `createApp()` tools array
380
- - [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = package name; `interface.shortDescription` from `package.json` description
381
- - [ ] `.codex-plugin/mcp.json` updated — server name key matches `package.json` name; env vars added for any required API keys
382
- - [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; inline `mcpServers` entry with server name key, env vars for any required API keys
404
+ - [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = the unscoped repo name (never the npm scope — `lint:packaging` enforces this); `interface.shortDescription` from `package.json` description
405
+ - [ ] `.codex-plugin/mcp.json` updated — server name key is the unscoped repo name; every user-supplied variable (API key, contact email, instance URL) is listed in `env_vars` so Codex forwards it from the user's environment. Never write `"KEY": ""` into `env` — an empty value replaces the user's exported key and is read as unset
406
+ - [ ] `.claude-plugin/plugin.json` populated — `name`, `version`, `description`, `author`, `repository`, `license`, `keywords` from `package.json`; inline `mcpServers` entry keyed by the unscoped repo name. Every user-supplied variable is declared under `userConfig` (`type`, `title`, `description`; `sensitive: true` for keys and tokens; `required: true` or `default: ""`) and referenced from `env` as `"KEY": "${user_config.<option>}"` — mirror the `user_config` block in `manifest.json`. Never write `"KEY": ""` into `env`
383
407
  - [ ] `bun run devcheck` passes
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.5.15-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/hn-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/hn-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/hn-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->=1.3.0-f9f1e1.svg?style=flat-square)](https://bun.sh/)
10
+ [![Version](https://img.shields.io/badge/Version-0.5.17-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/hn-mcp-server) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-2.0.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![npm](https://img.shields.io/npm/v/@cyanheads/hn-mcp-server?style=flat-square&logo=npm&logoColor=white)](https://www.npmjs.com/package/@cyanheads/hn-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->=1.4.0-f9f1e1.svg?style=flat-square)](https://bun.sh/)
11
11
 
12
12
  </div>
13
13
 
@@ -27,76 +27,73 @@
27
27
 
28
28
  ---
29
29
 
30
- ## Tools
30
+ ## Overview
31
31
 
32
- Four read-only tools for accessing Hacker News data:
32
+ Feeds, threads, and profiles from the Hacker News Firebase API and Algolia Search API. Browse ranked feeds, read full comment threads, look up user profiles, and search stories and comments by type, author, date, or score. Runs as a stdio process, a local Streamable HTTP server, or the public hosted endpoint above.
33
33
 
34
- | Tool Name | Description |
35
- |:----------|:------------|
36
- | `hn_get_stories` | Fetch stories from an HN feed (top, new, best, ask, show, jobs) with pagination. |
37
- | `hn_get_thread` | Get an item and its comment tree as a threaded discussion with depth/count controls. |
38
- | `hn_get_user` | Fetch a user profile with karma, about, and optionally a page of their submissions. |
39
- | `hn_search_content` | Search stories and comments via Algolia with type, author, date, and score filters. |
34
+ ### Tools
40
35
 
41
- ### `hn_get_stories`
36
+ | Tool | Description |
37
+ |:---|:---|
38
+ | `hn_get_stories` | Fetch stories from an HN feed (top, new, best, ask, show, jobs), with title, URL, score, author, and comment count |
39
+ | `hn_get_thread` | Get an item and its comment tree as a threaded discussion, with depth and comment-count controls |
40
+ | `hn_get_user` | Fetch a user profile with karma, about, and optionally a page of resolved submissions |
41
+ | `hn_search_content` | Search stories and comments via Algolia, filterable by type, author, date range, and minimum points |
42
42
 
43
- Fetch stories from any HN feed with pagination support.
43
+ ## Capability reference
44
44
 
45
- - Six feed types: `top`, `new`, `best`, `ask`, `show`, `jobs`
46
- - Configurable count (1–100, default 30) and offset for pagination
47
- - Returns enriched story objects with title, URL, score, author, comment count, and body text
45
+ ### `hn_get_stories` <sub>tool</sub>
48
46
 
49
- ---
47
+ - Six feed types: `top`, `new`, `best`, `ask`, `show`, `jobs`; `count` (1–100, default 30) and `offset` for pagination
48
+ - Returns id, type, title, url, domain, score, author, timestamp, comment count, and body text — each field omitted (not null) when HN doesn't provide it
49
+ - Enrichment reports `total`, `offset`, `hasMore`, and a `notice` explaining empty pages (empty feed, offset past end, or every item on the page deleted/flagged)
50
50
 
51
- ### `hn_get_thread`
51
+ ---
52
52
 
53
- Retrieve an item and its full comment tree via ranked breadth-first traversal.
53
+ ### `hn_get_thread` <sub>tool</sub>
54
54
 
55
- - Depth control (0–10, default 3) — depth 0 doubles as a single-item lookup
56
- - Comment limit (1–200, default 50) caps total comments across all levels
57
- - Breadth-first traversal preserves HN's ranking order
58
- - Flat comment list with `depth`/`parentId` for tree reconstruction
55
+ - `itemId` plus `depth` (0–10, default 3; 0 returns the item with no comments) and `maxComments` (1–200, default 50) capping the total across all levels
56
+ - Breadth-first traversal ranked like HN — top-ranked top-level comments resolve first, replies fill in only after the level above is exhausted
57
+ - Flat comment list carries `depth`/`parentId` for tree reconstruction, plus `childCount` and an `isOp` flag when the comment author matches the root item's author
58
+ - `notice` reports deleted/dead comments omitted during traversal and, when `totalLoaded` is below `totalAvailable`, the hint to raise `maxComments`/`depth`
59
59
 
60
60
  ---
61
61
 
62
- ### `hn_get_user`
63
-
64
- Fetch a user profile with optional submission resolution.
62
+ ### `hn_get_user` <sub>tool</sub>
65
63
 
66
- - Profile includes karma, creation date, and about text (HTML stripped)
67
- - Optionally resolves submissions into full items, up to 50 per page
68
- - `submissionOffset` pages through a long history; enrichment echoes the applied offset and the offset to request next
69
- - Submission resolution filters out dead/deleted items
64
+ - `username` is case-sensitive and trimmed; `includeSubmissions` (default false) resolves recent submissions, with `submissionCount` (1–50, default 10) and `submissionOffset` paging through a long history
65
+ - Profile includes karma, creation date, and about text (HTML stripped); submissions filter out dead/deleted items
66
+ - Enrichment echoes `submissionOffset` and the offset to send next, or a notice when the requested offset is past the end of the history
70
67
 
71
68
  ---
72
69
 
73
- ### `hn_search_content`
70
+ ### `hn_search_content` <sub>tool</sub>
74
71
 
75
- Full-text search via the Algolia HN Search API.
76
-
77
- - Filter by content type: `story`, `comment`, `ask_hn`, `show_hn`, `front_page`
78
- - Filter by author, date range (ISO 8601), and minimum points
79
- - Sort by relevance or date
80
- - Pagination with page/count controls
72
+ - Free-text `query` plus `tags` (`story`/`comment`/`ask_hn`/`show_hn`/`front_page`), `author`, `dateRange` (ISO 8601), and `minPoints` filters; `sort` by relevance or date; `count` (1–50, default 30) and `page` for pagination
81
73
  - `view: "compact"` drops the two body-text fields (`text`, `highlights.text`), which otherwise repeat a long comment twice per hit — pass a hit id to `hn_get_thread` to read the body
74
+ - Highlight metadata (`highlights.title`, `highlights.text`, `matchedWords`) shows which terms matched and where
75
+ - Enrichment reports `totalHits`, `page`, and the actual reachable `totalPages` — not derived from `totalHits`, since broad queries report far more hits than Algolia will serve
82
76
 
83
77
  ## Features
84
78
 
85
- Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core):
86
-
87
- - Declarative tool definitions — single file per tool, framework handles registration and validation
88
- - Unified error handling across all tools
89
- - Structured logging with request correlation
90
- - Runs locally (stdio/HTTP) from the same codebase
79
+ Built on [`@cyanheads/mcp-ts-core`](https://github.com/cyanheads/mcp-ts-core): stdio and Streamable HTTP transports, pluggable auth (`none` / `jwt` / `oauth`), swappable storage (`in-memory`, `filesystem`, `Supabase`, `Cloudflare KV/R2/D1`), structured logging with optional OpenTelemetry tracing.
91
80
 
92
81
  HN-specific:
93
82
 
94
- - Server-level `instructions` orientation forwarded to LLM clients on `initialize` — item types, ID reuse across tools, case-sensitive usernames, and field sparsity expectations
95
- - Concurrent batch fetching with configurable parallelism for item resolution
96
- - HTML entity decoding and tag stripping with code block and link preservation
97
- - No API keys required — HN APIs are public
83
+ - Two upstream APIs: HN's Firebase API for feeds, items, and users; Algolia's HN Search API for full-text search
84
+ - Concurrent batch fetching with configurable parallelism for item resolution (`HN_CONCURRENCY_LIMIT`)
85
+ - HTML entity decoding and tag stripping, preserving code blocks and links
86
+ - Server-level `instructions` forwarded to LLM clients on `initialize` — item types, ID reuse across tools, case-sensitive usernames, field sparsity
87
+ - No API keys required — both upstream APIs are public
98
88
 
99
- ## Getting Started
89
+ Agent-friendly output:
90
+
91
+ - Graceful partial failure — `hn_get_thread` counts deleted and dead comments dropped during traversal and surfaces the count in `notice` rather than silently shrinking the result; `hn_get_stories` and `hn_get_user` filter dead/deleted items the same way
92
+ - Discriminated output contracts — typed error reasons (`item_not_found`, `upstream_rate_limited`, `upstream_html`, …) with per-reason recovery text, and a `depth`/`parentId` pair on every comment so callers reconstruct the tree without guessing nesting
93
+ - Pagination provenance — every paged tool echoes the offset it used (`offset`, `submissionOffset`, `page`) plus the exact next-offset value in `notice`, so an agent can resume a listing without recomputing state
94
+ - Response shaping — HTML stripping, URL normalization, and domain extraction remove upstream markup noise; `hn_search_content`'s `view: "compact"` drops the two body-text fields that otherwise duplicate a hit's full text
95
+
96
+ ## Getting started
100
97
 
101
98
  ### Public Hosted Instance
102
99
 
@@ -171,7 +168,7 @@ Or with Docker:
171
168
 
172
169
  ### Prerequisites
173
170
 
174
- - [Bun v1.3.0](https://bun.sh/) or higher (or Node.js >= 24)
171
+ - [Bun v1.4.0](https://bun.sh/) or higher (or Node.js >= 24)
175
172
 
176
173
  ### Installation
177
174
 
@@ -191,55 +188,68 @@ All configuration is via environment variables. No API keys required — HN APIs
191
188
  | `MCP_TRANSPORT_TYPE` | Transport: `stdio` or `http`. | `stdio` |
192
189
  | `MCP_HTTP_PORT` | HTTP server port. | `3010` |
193
190
  | `MCP_HTTP_HOST` | HTTP server host. | `localhost` |
194
- | `MCP_SESSION_MODE` | HTTP session handling: `auto`, `stateful`, or `stateless`. `auto` resolves to `stateful`. The published Docker image and `.env.example` pin `stateless`. | `auto` |
191
+ | `MCP_SESSION_MODE` | HTTP session handling: `stateful`, `stateless`, or `auto` (resolves to `stateful`). The server declares `stateless` in source, and the published Docker image and `.env.example` set it too; a meaningful env value still overrides. | `stateless` |
195
192
  | `MCP_LOG_LEVEL` | Log level: `debug`, `info`, `notice`, `warning`, `error`. | `info` |
196
193
  | `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |
197
194
 
198
- ## Running the Server
195
+ See [`.env.example`](./.env.example) for the full list of optional overrides.
199
196
 
200
- ### Local Development
197
+ ## Running the server
201
198
 
202
- ```sh
203
- MCP_TRANSPORT_TYPE=stdio bun --watch src/index.ts # Dev mode (stdio, auto-reload)
204
- MCP_TRANSPORT_TYPE=http bun --watch src/index.ts # Dev mode (HTTP, auto-reload)
205
- bun run test # Run test suite
206
- bun run devcheck # Lint + format + typecheck + audit
207
- ```
199
+ ### Local development
208
200
 
209
- ### Production
201
+ - **Dev mode (auto-reload):**
210
202
 
211
- ```sh
212
- bun run build
213
- bun run start:stdio # or start:http
214
- ```
203
+ ```sh
204
+ MCP_TRANSPORT_TYPE=stdio bun --watch src/index.ts # stdio
205
+ MCP_TRANSPORT_TYPE=http bun --watch src/index.ts # HTTP
206
+ ```
207
+
208
+ - **Build and run:**
209
+
210
+ ```sh
211
+ bun run rebuild
212
+ bun run start:stdio # or start:http
213
+ ```
214
+
215
+ - **Run checks and tests:**
216
+
217
+ ```sh
218
+ bun run devcheck # Lint, format, typecheck, security
219
+ bun run test # Vitest test suite
220
+ ```
215
221
 
216
222
  ### Docker
217
223
 
218
224
  ```sh
219
225
  docker build -t hn-mcp-server .
220
- docker run -p 3010:3010 hn-mcp-server
226
+ docker run --rm -p 3010:3010 hn-mcp-server
221
227
  ```
222
228
 
223
- ## Project Structure
229
+ The Dockerfile defaults to HTTP transport, stateless session mode, and logs to `/var/log/hn-mcp-server`. OpenTelemetry peer dependencies are installed by default — build with `--build-arg OTEL_ENABLED=false` to omit them.
230
+
231
+ ## Project structure
224
232
 
225
233
  | Directory | Purpose |
226
234
  |:----------|:--------|
227
- | `src/index.ts` | `createApp()` entry point. |
228
- | `src/config/` | Server-specific env var parsing with Zod. |
229
- | `src/services/hn/` | HN Firebase + Algolia API client and domain types. |
235
+ | `src/index.ts` | `createApp()` entry point — registers tools and inits the HN service. |
236
+ | `src/config/` | Server-specific environment variable parsing and validation with Zod. |
230
237
  | `src/mcp-server/tools/definitions/` | Tool definitions (`*.tool.ts`). |
238
+ | `src/services/hn/` | HN Firebase + Algolia API client and domain types. |
239
+ | `tests/` | Unit and integration tests mirroring `src/`. |
231
240
 
232
- ## Development Guide
241
+ ## Development guide
233
242
 
234
243
  See [`CLAUDE.md`](./CLAUDE.md) for development guidelines and architectural rules. The short version:
235
244
 
236
245
  - Handlers throw, framework catches — no `try/catch` in tool logic
237
246
  - Use `ctx.log` for request-scoped logging
238
247
  - All tools are read-only — no auth scopes required
248
+ - Wrap external API calls: validate raw → normalize to domain type → return output schema; never fabricate missing fields
239
249
 
240
250
  ## Contributing
241
251
 
242
- Issues and pull requests are welcome. Run checks before submitting:
252
+ Issues are welcome. Run checks before submitting:
243
253
 
244
254
  ```sh
245
255
  bun run devcheck
@@ -0,0 +1,29 @@
1
+ ---
2
+ summary: "Adopted mcp-ts-core ^0.13.0 (blank/unsubstituted env vars now read as unset, dev skills moved to framework-skills/) plus a matching HN_CONCURRENCY_LIMIT fix and routine dependency bumps"
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.5.16 — 2026-09-13
8
+
9
+ ## Changed
10
+
11
+ - **Development skills moved from `skills/` to `framework-skills/`** ([cyanheads/mcp-ts-core#428](https://github.com/cyanheads/mcp-ts-core/issues/428)) — installing this server's `.claude-plugin`/`.codex-plugin` no longer hands these authoring skills to every agent that installs it.
12
+ - A rejected tool call's error now also carries `structuredContent.error` (code `-32602`) alongside the existing `Invalid arguments for tool …` text ([cyanheads/mcp-ts-core#377](https://github.com/cyanheads/mcp-ts-core/issues/377)).
13
+ - `manifest.json`'s `mcp_config.env` now references `${user_config.HN_CONCURRENCY_LIMIT}` / `${user_config.MCP_LOG_LEVEL}`, the form MCPB hosts substitute.
14
+ - A trailing slash on `MCP_PUBLIC_URL` no longer doubles in the HTTP landing page and `/.well-known/mcp.json` links, and the landing page's curl snippet now sends a handshake `initialize` accepts ([cyanheads/mcp-ts-core#395](https://github.com/cyanheads/mcp-ts-core/issues/395)).
15
+ - Minor/internal: `engines.bun` floor raised to `>=1.4.0`; new `audit:fix` script (`bun audit fix`); the `fast-uri`/`qs` `overrides` block removed now that the framework's `@modelcontextprotocol/ext-apps` dependency no longer pulls `@modelcontextprotocol/sdk` 1.x; GitHub issue forms gained assignee/secondary-label guidance and a security-advisory contact link; `.claude-plugin/plugin.json` gained `$schema` and `keywords`.
16
+
17
+ ## Fixed
18
+
19
+ - **`HN_CONCURRENCY_LIMIT` now reads a blank value or an unsubstituted `${user_config.HN_CONCURRENCY_LIMIT}` placeholder as unset**, falling back to the default of 10, via mcp-ts-core's `parseEnvConfig` ([cyanheads/mcp-ts-core#427](https://github.com/cyanheads/mcp-ts-core/issues/427)). Previously an empty value failed validation. Validation errors now name `HN_CONCURRENCY_LIMIT`.
20
+
21
+ ## Dependencies
22
+
23
+ - `@cyanheads/mcp-ts-core` `^0.12.5` → `^0.13.0`
24
+ - `zod` `^4.5.4` → `^4.6.1`
25
+ - `vitest` / `@vitest/coverage-istanbul` `^4.1.11` → `^5.0.0`
26
+ - `@biomejs/biome` `^2.5.11` → `^2.5.13`
27
+ - `@types/node` `^26.4.0` → `^26.5.1`
28
+ - `ignore` `^7.0.8` → `^7.0.9`
29
+ - `tsc-alias` `^1.9.3` → `^1.9.4`
@@ -0,0 +1,34 @@
1
+ ---
2
+ summary: "Adopted mcp-ts-core ^0.13.6: the server declares stateless session mode in source, argument rejections carry a reason and a schema-derived recovery hint, and tool errors close with their reason and retryable status."
3
+ breaking: false
4
+ security: false
5
+ ---
6
+
7
+ # 0.5.17 — 2026-09-19
8
+
9
+ ## Added
10
+
11
+ - **`.github/workflows/codeql.yml`** — the one GitHub Actions workflow this server carries; runs only while the repo's CodeQL default setup stays off.
12
+ - **`devcheck.config.json` gains a `lint` key** ([cyanheads/mcp-ts-core#388](https://github.com/cyanheads/mcp-ts-core/issues/388)), ready to carry a `truncationAllowlist` declaration read by `lint:mcp`.
13
+ - **The npm package now ships `AGENTS.md`** alongside `CLAUDE.md`.
14
+
15
+ ## Changed
16
+
17
+ - **`createApp({ sessionMode: 'stateless' })` declares the HTTP session posture in source** ([cyanheads/mcp-ts-core#376](https://github.com/cyanheads/mcp-ts-core/issues/376)). With `MCP_SESSION_MODE` unset, the server now resolves `stateless` from its own `createApp({ sessionMode: 'stateless' })` declaration instead of the schema default `auto` (which resolves to `stateful`); an explicit `MCP_SESSION_MODE` value still overrides it. The Docker image and `.env.example` already set `stateless` — the README env row's default now matches.
18
+ - **`SIGTERM`/`SIGINT` now end the process explicitly** ([cyanheads/mcp-ts-core#435](https://github.com/cyanheads/mcp-ts-core/issues/435)) — exit `0` once shutdown settles, `1` if the 10s ceiling fires.
19
+ - **An argument rejection carries `data.reason: "invalid_arguments"` and a schema-derived `Recovery:` hint** naming the tool's accepted keys ([cyanheads/mcp-ts-core#445](https://github.com/cyanheads/mcp-ts-core/issues/445), [cyanheads/mcp-ts-core#378](https://github.com/cyanheads/mcp-ts-core/issues/378)); a required field omitted from an enum now renders as missing rather than as a wrong choice. An unknown key is still rejected — never dropped or ignored.
20
+ - **Tool arguments pass a pre-validation step before schema parsing** ([cyanheads/mcp-ts-core#452](https://github.com/cyanheads/mcp-ts-core/issues/452), [cyanheads/mcp-ts-core#453](https://github.com/cyanheads/mcp-ts-core/issues/453), [cyanheads/mcp-ts-core#234](https://github.com/cyanheads/mcp-ts-core/issues/234)) — a fixed list of client-added keys is dropped, a case-folded undeclared key matching exactly one declared key is rewritten to it, and a JSON-stringified array is repaired once after a failed parse. Advertised `inputSchema`/`outputSchema` are unchanged.
21
+ - **A tool error's text now closes with `(reason <reason>)`**, plus ` · retryable` / ` · not retryable` when the entry declares `retryable` ([cyanheads/mcp-ts-core#458](https://github.com/cyanheads/mcp-ts-core/issues/458)).
22
+ - **`hn_get_thread`'s `item_not_found` and `hn_get_user`'s `user_not_found` declare `severity: 'notice'`** ([cyanheads/mcp-ts-core#380](https://github.com/cyanheads/mcp-ts-core/issues/380)) — a lookup miss now logs at `notice` instead of `error`; the wire envelope is unchanged.
23
+ - `.env.example`'s `MCP_SESSION_MODE` comment explains the stateless/stateful tradeoff instead of stating only the default; the README row documents the new source default.
24
+ - CLAUDE.md's `## Publishing` section documents the full gated release-PR flow (`git-wrapup` → `release-pr-review` → `release-and-publish`), replacing the single-skill pointer.
25
+ - Minor/internal: all four tools' `upstream_*` service-thrown error reasons carry `thrownBy: 'service'` ([cyanheads/mcp-ts-core#462](https://github.com/cyanheads/mcp-ts-core/issues/462)); 22 `framework-skills/` files and 6 framework scripts (`build.ts`, `clean.ts`, `clean-mcpb.ts`, `devcheck.ts`, `lint-mcp.ts`, `lint-packaging.ts`) re-synced to their current mcp-ts-core versions.
26
+
27
+ ## Dependencies
28
+
29
+ - `@cyanheads/mcp-ts-core` ^0.13.0 → ^0.13.6
30
+ - `zod` ^4.6.1 → ^4.6.5
31
+ - `@biomejs/biome` ^2.5.13 → ^2.5.14
32
+ - `@types/node` ^26.5.1 → ^26.6.1
33
+ - `vitest` / `@vitest/coverage-istanbul` ^5.0.0 → ^5.0.1
34
+ - `tsc-alias` ^1.9.4 → ^1.9.5
@@ -6,8 +6,8 @@
6
6
 
7
7
  # Required. One-line GitHub Release-style headline. 350 character cap — a
8
8
  # ceiling, not a target. Default short and scannable. Don't pad, don't stitch
9
- # unrelated changes with commas/semicolons into an inventory — pick the
10
- # headline, like a tag's theme line. Quotes required: unquoted YAML treats
9
+ # unrelated changes with commas/semicolons into an inventory — pick the one
10
+ # headline the release is about. Quotes required: unquoted YAML treats
11
11
  # `: ` inside the value as a key separator and fails GitHub's strict parser.
12
12
  summary: ""
13
13
 
@@ -117,30 +117,13 @@ security: false
117
117
  in that unrelated item's metadata.
118
118
 
119
119
  TAG ANNOTATIONS — the annotated tag body renders as the GitHub Release body
120
- via `gh release create --notes-from-tag`. The tag is a derivative of this
121
- changelog entry — a condensed, scannable version, not a copy. Format:
122
-
123
- <theme — omit version number, GitHub prepends it>
124
- ← blank line
125
- <1-2 sentence context: what this release does>
126
- ← blank line
127
- Dependency bumps: ← section header
128
- ← blank line
129
- - `@cyanheads/mcp-ts-core` ^0.9.1 → ^0.9.6 ← bullet
130
- ← blank line
131
- Changed: ← only sections with entries
132
- ← blank line
133
- - `format()` output includes `query` in text mode
134
- ← blank line
135
- Added:
136
- ← blank line
137
- - `manifest.json` scaffolded for MCPB bundle support
138
- - Install badges (Claude Desktop, Cursor, VS Code)
139
- ← blank line
140
- <N> tests pass; `bun run devcheck` clean. ← footer
141
-
142
- Never a flat comma-separated string. Always structured markdown with
143
- sections. The tag must scan well as a rendered GitHub Release page.
120
+ via `gh release create --notes-from-tag`. It is a condensed digest of this
121
+ entry, never a copy, and its format is owned by the `release-and-publish`
122
+ skill (step 4, "Create the annotated tag"): a short subject line without the
123
+ version, flat headline bullets — no Keep-a-Changelog section headers, no
124
+ gates line — at most one deps line, issue backlinks, and the changelog link
125
+ last. In release-PR mode the `git-wrapup` skill authors those bullets as the
126
+ PR body's `## Changes` and the tag copies them.
144
127
  -->
145
128
 
146
129
  ## Added
@@ -1 +1 @@
1
- {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,wBAAgB,eAAe;;EAK9B"}
1
+ {"version":3,"file":"server-config.d.ts","sourceRoot":"","sources":["../../src/config/server-config.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,wBAAgB,eAAe;;EAK9B"}
@@ -3,6 +3,7 @@
3
3
  * @module config/server-config
4
4
  */
5
5
  import { z } from '@cyanheads/mcp-ts-core';
6
+ import { parseEnvConfig } from '@cyanheads/mcp-ts-core/config';
6
7
  const ServerConfigSchema = z.object({
7
8
  concurrencyLimit: z.coerce
8
9
  .number()
@@ -14,8 +15,8 @@ const ServerConfigSchema = z.object({
14
15
  });
15
16
  let _config;
16
17
  export function getServerConfig() {
17
- _config ??= ServerConfigSchema.parse({
18
- concurrencyLimit: process.env.HN_CONCURRENCY_LIMIT,
18
+ _config ??= parseEnvConfig(ServerConfigSchema, {
19
+ concurrencyLimit: 'HN_CONCURRENCY_LIMIT',
19
20
  });
20
21
  return _config;
21
22
  }