@cyanheads/mcp-ts-core 0.12.9 → 0.13.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 (126) hide show
  1. package/AGENTS.md +22 -11
  2. package/CLAUDE.md +22 -11
  3. package/README.md +1 -1
  4. package/biome.json +1 -1
  5. package/changelog/0.13.x/0.13.0.md +48 -0
  6. package/changelog/0.13.x/0.13.1.md +56 -0
  7. package/changelog/template.md +7 -24
  8. package/{tsconfig.base.json → config/tsconfig.base.json} +2 -2
  9. package/dist/cli/init.js +2 -2
  10. package/dist/cli/init.js.map +1 -1
  11. package/dist/config/envValue.d.ts +18 -0
  12. package/dist/config/envValue.d.ts.map +1 -0
  13. package/dist/config/envValue.js +35 -0
  14. package/dist/config/envValue.js.map +1 -0
  15. package/dist/config/index.d.ts +8 -0
  16. package/dist/config/index.d.ts.map +1 -1
  17. package/dist/config/index.js +13 -7
  18. package/dist/config/index.js.map +1 -1
  19. package/dist/config/parseEnvConfig.d.ts +7 -0
  20. package/dist/config/parseEnvConfig.d.ts.map +1 -1
  21. package/dist/config/parseEnvConfig.js +9 -1
  22. package/dist/config/parseEnvConfig.js.map +1 -1
  23. package/dist/core/app.d.ts +82 -2
  24. package/dist/core/app.d.ts.map +1 -1
  25. package/dist/core/app.js +129 -6
  26. package/dist/core/app.js.map +1 -1
  27. package/dist/core/index.d.ts +1 -0
  28. package/dist/core/index.d.ts.map +1 -1
  29. package/dist/core/index.js.map +1 -1
  30. package/dist/core/worker.d.ts +6 -1
  31. package/dist/core/worker.d.ts.map +1 -1
  32. package/dist/core/worker.js.map +1 -1
  33. package/dist/linter/rules/resource-rules.js +9 -2
  34. package/dist/linter/rules/resource-rules.js.map +1 -1
  35. package/dist/linter/rules/tool-rules.js +4 -1
  36. package/dist/linter/rules/tool-rules.js.map +1 -1
  37. package/dist/linter/validate.js +2 -2
  38. package/dist/linter/validate.js.map +1 -1
  39. package/dist/mcp-server/types.d.ts +10 -3
  40. package/dist/mcp-server/types.d.ts.map +1 -1
  41. package/dist/mcp-server/types.js +4 -3
  42. package/dist/mcp-server/types.js.map +1 -1
  43. package/dist/services/canvas/core/sqlGate.d.ts.map +1 -1
  44. package/dist/services/canvas/core/sqlGate.js +27 -2
  45. package/dist/services/canvas/core/sqlGate.js.map +1 -1
  46. package/dist/utils/pagination/pagination.d.ts.map +1 -1
  47. package/dist/utils/pagination/pagination.js +4 -1
  48. package/dist/utils/pagination/pagination.js.map +1 -1
  49. package/dist/utils/parsing/frontmatterParser.d.ts +8 -7
  50. package/dist/utils/parsing/frontmatterParser.d.ts.map +1 -1
  51. package/dist/utils/parsing/frontmatterParser.js +91 -16
  52. package/dist/utils/parsing/frontmatterParser.js.map +1 -1
  53. package/framework-skills/README.md +40 -0
  54. package/{skills → framework-skills}/add-app-tool/SKILL.md +2 -2
  55. package/{skills → framework-skills}/add-resource/SKILL.md +2 -2
  56. package/{skills → framework-skills}/add-service/SKILL.md +2 -2
  57. package/{skills → framework-skills}/add-test/SKILL.md +2 -2
  58. package/{skills → framework-skills}/add-tool/SKILL.md +5 -5
  59. package/{skills → framework-skills}/api-config/SKILL.md +21 -3
  60. package/{skills → framework-skills}/api-context/SKILL.md +5 -3
  61. package/{skills → framework-skills}/api-linter/SKILL.md +4 -4
  62. package/{skills → framework-skills}/api-telemetry/SKILL.md +13 -10
  63. package/{skills → framework-skills}/code-simplifier/SKILL.md +12 -6
  64. package/{skills → framework-skills}/design-mcp-server/SKILL.md +2 -2
  65. package/{skills → framework-skills}/maintenance/SKILL.md +30 -21
  66. package/{skills → framework-skills}/orchestrations/SKILL.md +2 -2
  67. package/{skills → framework-skills}/orchestrations/workflows/field-test-fix.md +8 -8
  68. package/{skills → framework-skills}/orchestrations/workflows/fix-wrapup-release.md +5 -5
  69. package/{skills → framework-skills}/orchestrations/workflows/greenfield-build.md +11 -11
  70. package/{skills → framework-skills}/orchestrations/workflows/maintenance-release.md +12 -12
  71. package/{skills → framework-skills}/polish-docs-meta/SKILL.md +18 -10
  72. package/{skills → framework-skills}/polish-docs-meta/references/agent-protocol.md +1 -1
  73. package/{skills → framework-skills}/polish-docs-meta/references/readme.md +93 -73
  74. package/{skills → framework-skills}/release-and-publish/SKILL.md +12 -3
  75. package/{skills → framework-skills}/release-pr-review/SKILL.md +2 -2
  76. package/{skills → framework-skills}/report-issue-framework/SKILL.md +26 -25
  77. package/{skills → framework-skills}/report-issue-local/SKILL.md +28 -24
  78. package/{skills → framework-skills}/setup/SKILL.md +10 -8
  79. package/package.json +13 -13
  80. package/scripts/build.ts +2 -2
  81. package/scripts/check-framework-antipatterns.ts +1 -1
  82. package/scripts/check-skill-versions.ts +16 -9
  83. package/scripts/check-skills-sync.ts +64 -13
  84. package/scripts/clean-mcpb.ts +3 -3
  85. package/scripts/devcheck.ts +18 -15
  86. package/scripts/lint-packaging.ts +158 -24
  87. package/scripts/list-skills.ts +2 -2
  88. package/templates/.claude-plugin/plugin.json +5 -1
  89. package/templates/.env.example +5 -2
  90. package/templates/.github/CONTRIBUTING.md +4 -5
  91. package/templates/.github/ISSUE_TEMPLATE/bug_report.yml +5 -4
  92. package/templates/.github/ISSUE_TEMPLATE/config.yml +6 -1
  93. package/templates/.github/ISSUE_TEMPLATE/feature_request.yml +1 -2
  94. package/templates/AGENTS.md +31 -14
  95. package/templates/CLAUDE.md +31 -14
  96. package/templates/_.mcpbignore +1 -1
  97. package/templates/changelog/template.md +7 -24
  98. package/templates/package.json +3 -2
  99. package/templates/src/index.ts +10 -0
  100. package/templates/src/mcp-server/resources/definitions/echo-app-ui.app-resource.ts +1 -1
  101. package/skills/README.md +0 -38
  102. /package/{skills → framework-skills}/add-export/SKILL.md +0 -0
  103. /package/{skills → framework-skills}/add-prompt/SKILL.md +0 -0
  104. /package/{skills → framework-skills}/add-provider/SKILL.md +0 -0
  105. /package/{skills → framework-skills}/api-auth/SKILL.md +0 -0
  106. /package/{skills → framework-skills}/api-canvas/SKILL.md +0 -0
  107. /package/{skills → framework-skills}/api-errors/SKILL.md +0 -0
  108. /package/{skills → framework-skills}/api-mirror/SKILL.md +0 -0
  109. /package/{skills → framework-skills}/api-services/SKILL.md +0 -0
  110. /package/{skills → framework-skills}/api-services/references/graph.md +0 -0
  111. /package/{skills → framework-skills}/api-services/references/llm.md +0 -0
  112. /package/{skills → framework-skills}/api-services/references/speech.md +0 -0
  113. /package/{skills → framework-skills}/api-testing/SKILL.md +0 -0
  114. /package/{skills → framework-skills}/api-utils/SKILL.md +0 -0
  115. /package/{skills → framework-skills}/api-utils/references/formatting.md +0 -0
  116. /package/{skills → framework-skills}/api-utils/references/parsing.md +0 -0
  117. /package/{skills → framework-skills}/api-utils/references/security.md +0 -0
  118. /package/{skills → framework-skills}/api-workers/SKILL.md +0 -0
  119. /package/{skills → framework-skills}/field-test/SKILL.md +0 -0
  120. /package/{skills → framework-skills}/git-wrapup/SKILL.md +0 -0
  121. /package/{skills → framework-skills}/polish-docs-meta/references/package-meta.md +0 -0
  122. /package/{skills → framework-skills}/polish-docs-meta/references/server-json.md +0 -0
  123. /package/{skills → framework-skills}/security-pass/SKILL.md +0 -0
  124. /package/{skills → framework-skills}/techniques/SKILL.md +0 -0
  125. /package/{skills → framework-skills}/techniques/references/outline-on-overflow.md +0 -0
  126. /package/{skills → framework-skills}/tool-defs-analysis/SKILL.md +0 -0
@@ -17,10 +17,10 @@ This project was just scaffolded with `bunx @cyanheads/mcp-ts-core init`. You're
17
17
 
18
18
  > **Remove this section** from CLAUDE.md / AGENTS.md after completing these steps. The skills and conventions below remain — this block is one-time onboarding only.
19
19
 
20
- 1. **Get your bearings.** Take stock of the project tree, the skills in `skills/`, and the tools/MCP servers available. Light tool use is fine for context-building — you're mapping the territory, not committing yet.
20
+ 1. **Get your bearings.** Take stock of the project tree, the skills in `framework-skills/`, and the tools/MCP servers available. Light tool use is fine for context-building — you're mapping the territory, not committing yet.
21
21
  2. **Read the framework docs** — `node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` (builders, Context, errors, exports, conventions)
22
- 3. **Run the `setup` skill** — read `skills/setup/SKILL.md` and follow its checklist (project orientation, agent protocol file selection, echo definition cleanup, skill sync)
23
- 4. **Design the server** — read `skills/design-mcp-server/SKILL.md` and work through it with the user to map the domain into tools, resources, and services before scaffolding
22
+ 3. **Run the `setup` skill** — read `framework-skills/setup/SKILL.md` and follow its checklist (project orientation, agent protocol file selection, echo definition cleanup, skill sync)
23
+ 4. **Design the server** — read `framework-skills/design-mcp-server/SKILL.md` and work through it with the user to map the domain into tools, resources, and services before scaffolding
24
24
 
25
25
  ---
26
26
 
@@ -174,6 +174,22 @@ await createApp({
174
174
 
175
175
  `instructions` is optional server-level orientation, sent on every `initialize` as session-level context. Use it for deployment guidance (connection aliases, regional notes, scope hints) instead of repeating the same context across tool descriptions. Client adoption is uneven, but there's no downside when set.
176
176
 
177
+ ### Session posture and shutdown
178
+
179
+ Two more `createApp()` options shape how the server runs rather than how it presents itself:
180
+
181
+ ```ts
182
+ await createApp({
183
+ sessionMode: 'stateless', // or { default: 'stateful', require: 'stateful' }
184
+ setup(core) { startMyWatcher(core.config); },
185
+ async teardown() { await stopMyWatcher(); },
186
+ });
187
+ ```
188
+
189
+ `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). Add `require: 'stateful'` when a tool asks the caller for input mid-handler via `ctx.requestInput`: startup then fails with a `ConfigurationError` rather than serving a mode in which a 2025-era client can never answer the prompt. Stdio is never refused.
190
+
191
+ `teardown(core)` is the `setup()` counterpart — release a watcher, socket, or non-`unref()`'d timer there. It runs after the transport stops and before the logger closes, on every shutdown path, and a signal-triggered shutdown then exits the process explicitly (0, or 1 if a step never settles within the framework's 10 s ceiling).
192
+
177
193
  ---
178
194
 
179
195
  ## Context
@@ -231,7 +247,7 @@ throw new Error('Invalid query format'); // → ValidationError
231
247
 
232
248
  // McpError — when no factory exists for the code
233
249
  import { McpError, JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
234
- throw new McpError(JsonRpcErrorCode.DatabaseError, 'Connection failed', { pool: 'primary' });
250
+ throw new McpError(JsonRpcErrorCode.InitializationFailed, 'Connection failed', { pool: 'primary' });
235
251
  ```
236
252
 
237
253
  See framework CLAUDE.md and the `api-errors` skill for the full auto-classification table, all available factories, and the contract reference.
@@ -273,9 +289,9 @@ src/
273
289
 
274
290
  ## Skills
275
291
 
276
- 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.
292
+ 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.
277
293
 
278
- **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.
294
+ **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.
279
295
 
280
296
  Available skills:
281
297
 
@@ -315,7 +331,7 @@ Available skills:
315
331
  | `api-telemetry` | OTel catalog: spans, metrics, completion logs, env config, cardinality rules |
316
332
  | `api-workers` | Cloudflare Workers runtime |
317
333
 
318
- **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.
334
+ **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.
319
335
 
320
336
  When you complete a skill's checklist, check the boxes and add a completion timestamp at the end (e.g., `Completed: 2026-03-11`).
321
337
 
@@ -331,7 +347,8 @@ When you complete a skill's checklist, check the boxes and add a completion time
331
347
  | `bun run rebuild` | Clean + build |
332
348
  | `bun run clean` | Remove build artifacts |
333
349
  | `bun run devcheck` | Lint + format + typecheck + security + changelog sync |
334
- | `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. |
350
+ | `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` |
351
+ | `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` |
335
352
  | `bun run lint:mcp` | Run the MCP definition linter standalone (rule catalog: `api-linter` skill) |
336
353
  | `bun run lint:packaging` | Packaging surface checks — `server.json`/`manifest.json` env-var parity (run by devcheck) |
337
354
  | `bun run list-skills` | Print the skill registry |
@@ -349,11 +366,11 @@ When you complete a skill's checklist, check the boxes and add a completion time
349
366
 
350
367
  ## Bundling
351
368
 
352
- `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 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. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. 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.
369
+ `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 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. A server using DataCanvas therefore ships a portable bundle without the DuckDB native — `@duckdb/node-api` is an optional peer loaded lazily, so canvas tools report an actionable install hint and every other tool works normally. 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.
353
370
 
354
- **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.
371
+ **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": ""`.
355
372
 
356
- **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`.
373
+ **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`.
357
374
 
358
375
  ---
359
376
 
@@ -410,7 +427,7 @@ import { getMyService } from '@/services/my-domain/my-service.js';
410
427
  - [ ] If wrapping external API: tests include at least one sparse payload case with omitted upstream fields
411
428
  - [ ] Registered in `createApp()` arrays (directly or via barrel exports)
412
429
  - [ ] Tests use `createMockContext()` from `@cyanheads/mcp-ts-core/testing`
413
- - [ ] `.codex-plugin/plugin.json` populated — `name`, `version`, `description`, `repository`, `license` from `package.json`; `interface.displayName` = package name; `interface.shortDescription` from `package.json` description
414
- - [ ] `.codex-plugin/mcp.json` updated — server name key matches `package.json` name; env vars added for any required API keys
415
- - [ ] `.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
430
+ - [ ] `.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
431
+ - [ ] `.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
432
+ - [ ] `.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`
416
433
  - [ ] `npm run devcheck` passes
@@ -2,7 +2,7 @@
2
2
  .mcpregistry_*
3
3
  /.claude/
4
4
  /.agents/
5
- /skills/
5
+ /framework-skills/
6
6
  /Dockerfile
7
7
  /bun.lock
8
8
  /bunfig.toml
@@ -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"): the entry's `summary:` as the
123
+ theme line without the version, flat headline bullets — no Keep-a-Changelog
124
+ section headers, no gates line — at most one deps line, issue backlinks,
125
+ and the changelog link last. In release-PR mode the `git-wrapup` skill
126
+ authors that digest as the PR body's `## Changes` and the tag copies it.
144
127
  -->
145
128
 
146
129
  ## Added
@@ -24,6 +24,7 @@
24
24
  "rebuild": "bun run scripts/clean.ts && bun run scripts/build.ts",
25
25
  "clean": "bun run scripts/clean.ts",
26
26
  "devcheck": "bun run scripts/devcheck.ts",
27
+ "audit:fix": "bun audit fix",
27
28
  "audit:refresh": "rm -f bun.lock && bun install && bun audit",
28
29
  "tree": "bun run scripts/tree.ts",
29
30
  "list-skills": "bun run scripts/list-skills.ts",
@@ -65,9 +66,9 @@
65
66
  "zod": "{{ZOD_VERSION}}"
66
67
  },
67
68
  "devDependencies": {
68
- "@biomejs/biome": "2.5.12",
69
+ "@biomejs/biome": "2.5.13",
69
70
  "@socketsecurity/bun-security-scanner": "^1.1.2",
70
- "@types/node": "26.4.0",
71
+ "@types/node": "26.5.1",
71
72
  "@vitest/coverage-istanbul": "4.1.11",
72
73
  "depcheck": "^1.4.7",
73
74
  "fast-check": "^4.9.0",
@@ -20,4 +20,14 @@ await createApp({
20
20
  // instructions: 'Server-level orientation forwarded to the model on every initialize.\n' +
21
21
  // '- Use shortcut `X` for the most common case\n' +
22
22
  // '- Tools require auth via the `inventory:read` scope',
23
+
24
+ // Session posture in code rather than in a Dockerfile. MCP_SESSION_MODE still
25
+ // wins when it is set. Add `require: 'stateful'` — `{ default: 'stateful',
26
+ // require: 'stateful' }` — when a tool asks the caller for input mid-handler,
27
+ // so a stateless deployment fails at startup instead of losing that tool.
28
+ // sessionMode: 'stateless',
29
+
30
+ // Release what setup() allocated: a watcher, a socket, a timer the framework
31
+ // cannot see. Runs after the transport stops and before the logger closes.
32
+ // teardown(core) { core.logger.info('bye', { requestId: 'shutdown', timestamp: new Date().toISOString() }); },
23
33
  });
@@ -67,7 +67,7 @@ const APP_HTML = `<!DOCTYPE html>
67
67
  applyDocumentTheme,
68
68
  applyHostFonts,
69
69
  applyHostStyleVariables,
70
- } from "https://unpkg.com/@modelcontextprotocol/ext-apps@1/app-with-deps";
70
+ } from "https://unpkg.com/@modelcontextprotocol/ext-apps@2/app-with-deps";
71
71
 
72
72
  const app = new App({ name: "Echo App", version: "1.0.0" });
73
73
  const messageEl = document.getElementById("message");
package/skills/README.md DELETED
@@ -1,38 +0,0 @@
1
- # Skills
2
-
3
- Agent Skills for `@cyanheads/mcp-ts-core`. Each subdirectory contains a `SKILL.md` following the [Agent Skills specification](https://agentskills.io/specification).
4
-
5
- ## Three-Tier Distribution
6
-
7
- Skills flow through three locations. Each tier has a distinct role:
8
-
9
- | Tier | Location | Written by | Purpose |
10
- |:-----|:---------|:-----------|:--------|
11
- | 1. Package | `node_modules/@cyanheads/mcp-ts-core/skills/` | `npm publish` / `bun publish` | Canonical source. Ships with the package. |
12
- | 2. Project | `skills/` (project root) | `@cyanheads/mcp-ts-core init` CLI | Project's source of truth. Committed to git. Server-specific skills live here too. |
13
- | 3. Agent | `.claude/skills/`, `.codex/skills/`, etc. | The agent itself | Agent's working copy. Synced from project `skills/`. Checklists are checked here. |
14
-
15
- ### Flow
16
-
17
- ```text
18
- npm publish init CLI agent sync
19
- [package skills/] ──────────> [project skills/] ──────────> [.claude/skills/]
20
- │
21
- ├── core skills (from package)
22
- └── server-specific skills (added by devs)
23
- ```
24
-
25
- ## Audience
26
-
27
- Each skill declares `metadata.audience` in its SKILL.md frontmatter:
28
-
29
- - **`external`** — For consumers building MCP servers. Copied to project `skills/` by `init`.
30
- - **`internal`** — For core package developers. Stays in `node_modules`, not copied.
31
-
32
- ## Versioning
33
-
34
- Skills declare `metadata.version` in frontmatter. When `init` is re-run after `bun update`, it compares versions and updates skills where the package version is newer. To pin a skill and prevent updates, bump its local `metadata.version` above the package's.
35
-
36
- ## Adding Server-Specific Skills
37
-
38
- Create a new directory in `skills/` with a `SKILL.md` following the same format. The agent will pick it up on next sync. Use the core skills as examples for structure and checklist conventions.
File without changes
File without changes