@cyanheads/mcp-ts-core 0.13.6 → 0.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -3
- package/CLAUDE.md +3 -3
- package/README.md +55 -52
- package/biome.json +1 -1
- package/changelog/0.13.x/0.13.7.md +77 -0
- package/config/tsconfig.base.json +2 -2
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +42 -11
- package/dist/config/index.js.map +1 -1
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/app.js +21 -4
- package/dist/core/app.js.map +1 -1
- package/dist/core/context.d.ts +9 -1
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +4 -13
- package/dist/core/context.js.map +1 -1
- package/dist/core/worker.d.ts.map +1 -1
- package/dist/core/worker.js +7 -1
- package/dist/core/worker.js.map +1 -1
- package/dist/mcp-server/handlerContext.d.ts +6 -0
- package/dist/mcp-server/handlerContext.d.ts.map +1 -1
- package/dist/mcp-server/handlerContext.js +3 -0
- package/dist/mcp-server/handlerContext.js.map +1 -1
- package/dist/mcp-server/prompts/prompt-registration.d.ts.map +1 -1
- package/dist/mcp-server/prompts/prompt-registration.js +6 -3
- package/dist/mcp-server/prompts/prompt-registration.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +5 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.js +15 -5
- package/dist/mcp-server/transports/http/httpErrorHandler.js.map +1 -1
- package/dist/storage/core/IStorageProvider.d.ts +5 -2
- package/dist/storage/core/IStorageProvider.d.ts.map +1 -1
- package/dist/storage/core/providerHelpers.d.ts +29 -8
- package/dist/storage/core/providerHelpers.d.ts.map +1 -1
- package/dist/storage/core/providerHelpers.js +49 -11
- package/dist/storage/core/providerHelpers.js.map +1 -1
- package/dist/storage/providers/cloudflare/d1Provider.js +4 -4
- package/dist/storage/providers/cloudflare/d1Provider.js.map +1 -1
- package/dist/storage/providers/cloudflare/kvProvider.d.ts +2 -0
- package/dist/storage/providers/cloudflare/kvProvider.d.ts.map +1 -1
- package/dist/storage/providers/cloudflare/kvProvider.js +11 -9
- package/dist/storage/providers/cloudflare/kvProvider.js.map +1 -1
- package/dist/storage/providers/cloudflare/r2Provider.d.ts.map +1 -1
- package/dist/storage/providers/cloudflare/r2Provider.js +8 -5
- package/dist/storage/providers/cloudflare/r2Provider.js.map +1 -1
- package/dist/storage/providers/fileSystem/fileSystemProvider.d.ts +1 -0
- package/dist/storage/providers/fileSystem/fileSystemProvider.d.ts.map +1 -1
- package/dist/storage/providers/fileSystem/fileSystemProvider.js +10 -8
- package/dist/storage/providers/fileSystem/fileSystemProvider.js.map +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts +5 -0
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts.map +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.js +9 -5
- package/dist/storage/providers/inMemory/inMemoryProvider.js.map +1 -1
- package/dist/storage/providers/supabase/supabaseProvider.d.ts.map +1 -1
- package/dist/storage/providers/supabase/supabaseProvider.js +5 -1
- package/dist/storage/providers/supabase/supabaseProvider.js.map +1 -1
- package/dist/testing/index.d.ts +6 -4
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6 -4
- package/dist/testing/index.js.map +1 -1
- package/dist/utils/formatting/partialResult.d.ts +28 -2
- package/dist/utils/formatting/partialResult.d.ts.map +1 -1
- package/dist/utils/formatting/partialResult.js +46 -2
- package/dist/utils/formatting/partialResult.js.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.d.ts +8 -2
- package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.js +27 -16
- package/dist/utils/internal/error-handler/errorHandler.js.map +1 -1
- package/dist/utils/internal/error-handler/mappings.d.ts +1 -0
- package/dist/utils/internal/error-handler/mappings.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/mappings.js +1 -0
- package/dist/utils/internal/error-handler/mappings.js.map +1 -1
- package/dist/utils/internal/performance.d.ts +5 -1
- package/dist/utils/internal/performance.d.ts.map +1 -1
- package/dist/utils/internal/performance.js +13 -8
- package/dist/utils/internal/performance.js.map +1 -1
- package/dist/utils/security/sanitization.d.ts +15 -15
- package/dist/utils/security/sanitization.d.ts.map +1 -1
- package/dist/utils/security/sanitization.js +108 -88
- package/dist/utils/security/sanitization.js.map +1 -1
- package/dist/utils/telemetry/instrumentation.d.ts +6 -2
- package/dist/utils/telemetry/instrumentation.d.ts.map +1 -1
- package/dist/utils/telemetry/instrumentation.js +23 -8
- package/dist/utils/telemetry/instrumentation.js.map +1 -1
- package/framework-skills/add-app-tool/SKILL.md +12 -18
- package/framework-skills/add-prompt/SKILL.md +3 -1
- package/framework-skills/add-provider/SKILL.md +14 -4
- package/framework-skills/add-resource/SKILL.md +3 -3
- package/framework-skills/add-tool/SKILL.md +22 -7
- package/framework-skills/api-canvas/SKILL.md +2 -2
- package/framework-skills/api-config/SKILL.md +4 -3
- package/framework-skills/api-context/SKILL.md +8 -5
- package/framework-skills/api-errors/SKILL.md +7 -3
- package/framework-skills/api-linter/SKILL.md +8 -8
- package/framework-skills/api-telemetry/SKILL.md +9 -4
- package/framework-skills/api-testing/SKILL.md +21 -13
- package/framework-skills/api-utils/SKILL.md +3 -3
- package/framework-skills/api-utils/references/security.md +7 -6
- package/framework-skills/code-simplifier/SKILL.md +31 -18
- package/framework-skills/design-mcp-server/SKILL.md +62 -35
- package/framework-skills/git-wrapup/SKILL.md +16 -10
- package/framework-skills/maintenance/SKILL.md +2 -2
- package/framework-skills/orchestrations/SKILL.md +1 -1
- package/framework-skills/orchestrations/workflows/greenfield-build.md +15 -8
- package/framework-skills/polish-docs-meta/SKILL.md +2 -2
- package/framework-skills/polish-docs-meta/references/package-meta.md +1 -1
- package/framework-skills/polish-docs-meta/references/readme.md +3 -3
- package/framework-skills/release-and-publish/SKILL.md +6 -4
- package/framework-skills/release-pr-review/SKILL.md +18 -1
- package/framework-skills/report-issue-framework/SKILL.md +2 -2
- package/framework-skills/report-issue-local/SKILL.md +3 -3
- package/framework-skills/security-pass/SKILL.md +11 -3
- package/framework-skills/tool-defs-analysis/SKILL.md +3 -3
- package/package.json +15 -36
- package/templates/.env.example +3 -1
- package/templates/.github/ISSUE_TEMPLATE/feature_request.yml +1 -1
- package/templates/AGENTS.md +2 -2
- package/templates/CLAUDE.md +2 -2
- package/templates/Dockerfile +4 -4
- package/templates/package.json +3 -3
- package/templates/src/mcp-server/prompts/definitions/echo.prompt.ts +2 -4
- package/templates/src/mcp-server/resources/definitions/echo-app-ui.app-resource.ts +51 -14
- package/templates/src/mcp-server/resources/definitions/echo.resource.ts +1 -1
- package/templates/src/mcp-server/tools/definitions/echo-app.app-tool.ts +2 -3
- package/templates/src/mcp-server/tools/definitions/echo.tool.ts +1 -1
- package/dist/utils/telemetry/index.d.ts +0 -12
- package/dist/utils/telemetry/index.d.ts.map +0 -1
- package/dist/utils/telemetry/index.js +0 -12
- package/dist/utils/telemetry/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/mcp-ts-core",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.7",
|
|
4
4
|
"mcpName": "io.github.cyanheads/mcp-ts-core",
|
|
5
5
|
"description": "Agent-native TypeScript framework for MCP servers. Includes runtime infrastructure and agent skills for building, testing, and shipping servers.",
|
|
6
6
|
"files": [
|
|
@@ -156,7 +156,6 @@
|
|
|
156
156
|
"devcheck": "bun run scripts/devcheck.ts",
|
|
157
157
|
"rebuild": "bun run scripts/clean.ts && bun run build",
|
|
158
158
|
"docs:generate": "bunx typedoc",
|
|
159
|
-
"depcheck": "bunx depcheck",
|
|
160
159
|
"lint": "biome check",
|
|
161
160
|
"lint:mcp": "bun run scripts/lint-mcp.ts",
|
|
162
161
|
"lint:packaging": "bun run scripts/lint-packaging.ts",
|
|
@@ -199,9 +198,10 @@
|
|
|
199
198
|
"devDependencies": {
|
|
200
199
|
"@biomejs/biome": "2.5.14",
|
|
201
200
|
"@cloudflare/vitest-pool-workers": "^0.22.0",
|
|
202
|
-
"@cloudflare/workers-types": "5.
|
|
201
|
+
"@cloudflare/workers-types": "5.20260922.1",
|
|
203
202
|
"@duckdb/node-api": "^1.5.5-r.5",
|
|
204
203
|
"@hono/otel": "^1.1.2",
|
|
204
|
+
"@modelcontextprotocol/client": "^2.0.0",
|
|
205
205
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.222.0",
|
|
206
206
|
"@opentelemetry/exporter-trace-otlp-http": "^0.222.0",
|
|
207
207
|
"@opentelemetry/instrumentation-http": "^0.222.0",
|
|
@@ -211,42 +211,39 @@
|
|
|
211
211
|
"@opentelemetry/sdk-node": "^0.222.0",
|
|
212
212
|
"@opentelemetry/sdk-trace-node": "^2.11.0",
|
|
213
213
|
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
214
|
-
"@socketsecurity/bun-security-scanner": "^1.1.
|
|
215
|
-
"@supabase/supabase-js": "^2.
|
|
214
|
+
"@socketsecurity/bun-security-scanner": "^1.1.3",
|
|
215
|
+
"@supabase/supabase-js": "^2.117.0",
|
|
216
216
|
"@types/bun": "^1.4.2",
|
|
217
|
-
"@types/node": "26.
|
|
217
|
+
"@types/node": "26.6.2",
|
|
218
218
|
"@types/papaparse": "^5.5.2",
|
|
219
219
|
"@types/sanitize-html": "^2.16.1",
|
|
220
|
-
"@types/validator": "^13.15.10",
|
|
221
220
|
"@vitest/coverage-istanbul": "4.1.11",
|
|
222
221
|
"@vitest/ui": "4.1.11",
|
|
223
222
|
"better-sqlite3": "^13.0.3",
|
|
224
|
-
"bun-types": "^1.4.2",
|
|
225
223
|
"chrono-node": "^2.10.1",
|
|
226
224
|
"clipboardy": "^5.3.2",
|
|
227
|
-
"defuddle": "^0.19.
|
|
225
|
+
"defuddle": "^0.19.4",
|
|
228
226
|
"depcheck": "^1.4.7",
|
|
229
227
|
"diff": "^9.0.0",
|
|
230
228
|
"execa": "^10.0.1",
|
|
231
|
-
"fast-check": "^4.10.
|
|
229
|
+
"fast-check": "^4.10.2",
|
|
232
230
|
"fast-xml-parser": "^5.11.1",
|
|
233
|
-
"ignore": "^7.0.
|
|
231
|
+
"ignore": "^7.0.10",
|
|
234
232
|
"js-yaml": "^5.4.2",
|
|
235
233
|
"linkedom": "^0.18.13",
|
|
236
234
|
"node-cron": "^4.6.0",
|
|
237
|
-
"openai": "^7.
|
|
235
|
+
"openai": "^7.21.0",
|
|
238
236
|
"papaparse": "^5.7.0",
|
|
239
237
|
"partial-json": "^0.1.7",
|
|
240
238
|
"pdf-lib": "^1.17.1",
|
|
241
239
|
"pino-pretty": "^13.1.3",
|
|
242
|
-
"repomix": "^1.18.
|
|
240
|
+
"repomix": "^1.18.1",
|
|
243
241
|
"sanitize-html": "^2.17.7",
|
|
244
242
|
"tsc-alias": "^1.9.5",
|
|
245
243
|
"typedoc": "^0.28.20",
|
|
246
244
|
"typescript": "^7.0.2",
|
|
247
245
|
"typescript-v6": "npm:typescript@^6.0.3",
|
|
248
246
|
"unpdf": "^1.8.1",
|
|
249
|
-
"validator": "^13.15.35",
|
|
250
247
|
"vite": "8.3.0",
|
|
251
248
|
"vitest": "^4.1.11"
|
|
252
249
|
},
|
|
@@ -280,32 +277,18 @@
|
|
|
280
277
|
"url": "https://www.buymeacoffee.com/cyanheads"
|
|
281
278
|
}
|
|
282
279
|
],
|
|
283
|
-
"packageManager": "bun@1.4.
|
|
280
|
+
"packageManager": "bun@1.4.2",
|
|
284
281
|
"engines": {
|
|
285
282
|
"bun": ">=1.4.0",
|
|
286
283
|
"node": ">=24.0.0"
|
|
287
284
|
},
|
|
288
|
-
"depcheck": {
|
|
289
|
-
"ignores": [
|
|
290
|
-
"bun",
|
|
291
|
-
"repomix",
|
|
292
|
-
"tsc-alias",
|
|
293
|
-
"@cyanheads/mcp-ts-core",
|
|
294
|
-
"@modelcontextprotocol/ext-apps",
|
|
295
|
-
"@socketsecurity/bun-security-scanner"
|
|
296
|
-
],
|
|
297
|
-
"ignorePatterns": ["examples"]
|
|
298
|
-
},
|
|
299
285
|
"publishConfig": {
|
|
300
286
|
"access": "public"
|
|
301
287
|
},
|
|
302
288
|
"dependencies": {
|
|
303
289
|
"@hono/node-server": "^2.1.1",
|
|
304
|
-
"@modelcontextprotocol/client": "^2.0.0",
|
|
305
|
-
"@modelcontextprotocol/ext-apps": "^2.0.0",
|
|
306
290
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
307
291
|
"@opentelemetry/api": "^1.9.1",
|
|
308
|
-
"dotenv": "^17.4.2",
|
|
309
292
|
"hono": "^4.13.8",
|
|
310
293
|
"jose": "^6.2.12",
|
|
311
294
|
"pino": "^10.3.1",
|
|
@@ -314,9 +297,9 @@
|
|
|
314
297
|
"peerDependencies": {
|
|
315
298
|
"@duckdb/node-api": "^1.5.5-r.1",
|
|
316
299
|
"@hono/otel": "^1.1.2",
|
|
317
|
-
"@opentelemetry/instrumentation-http": "^0.222.0",
|
|
318
300
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.222.0",
|
|
319
301
|
"@opentelemetry/exporter-trace-otlp-http": "^0.222.0",
|
|
302
|
+
"@opentelemetry/instrumentation-http": "^0.222.0",
|
|
320
303
|
"@opentelemetry/instrumentation-pino": "^0.68.0",
|
|
321
304
|
"@opentelemetry/resources": "^2.10.0",
|
|
322
305
|
"@opentelemetry/sdk-metrics": "^2.10.0",
|
|
@@ -329,7 +312,6 @@
|
|
|
329
312
|
"defuddle": "^0.19.2",
|
|
330
313
|
"diff": "^9.0.0",
|
|
331
314
|
"fast-check": "^4.9.0",
|
|
332
|
-
"vitest": ">=4.0.0",
|
|
333
315
|
"fast-xml-parser": "^5.10.1",
|
|
334
316
|
"js-yaml": "^5.2.2",
|
|
335
317
|
"linkedom": "^0.18.13",
|
|
@@ -340,8 +322,8 @@
|
|
|
340
322
|
"pdf-lib": "^1.17.1",
|
|
341
323
|
"sanitize-html": "^2.17.6",
|
|
342
324
|
"unpdf": "^1.6.2",
|
|
343
|
-
"
|
|
344
|
-
"zod": "^4.
|
|
325
|
+
"vitest": ">=4.0.0",
|
|
326
|
+
"zod": "^4.6.5"
|
|
345
327
|
},
|
|
346
328
|
"peerDependenciesMeta": {
|
|
347
329
|
"@duckdb/node-api": {
|
|
@@ -425,9 +407,6 @@
|
|
|
425
407
|
"unpdf": {
|
|
426
408
|
"optional": true
|
|
427
409
|
},
|
|
428
|
-
"validator": {
|
|
429
|
-
"optional": true
|
|
430
|
-
},
|
|
431
410
|
"vitest": {
|
|
432
411
|
"optional": true
|
|
433
412
|
}
|
package/templates/.env.example
CHANGED
|
@@ -34,7 +34,9 @@ MCP_SESSION_MODE=stateless # stateful | stateless | auto. Set here, not
|
|
|
34
34
|
|
|
35
35
|
# ── Telemetry ─────────────────────────────────────────────────────────
|
|
36
36
|
# OTEL_ENABLED=false # Enable OpenTelemetry (default: false)
|
|
37
|
-
# OTEL_EXPORTER_OTLP_ENDPOINT= # OTLP
|
|
37
|
+
# OTEL_EXPORTER_OTLP_ENDPOINT= # OTLP base URL (e.g., http://localhost:4318); traces → /v1/traces, metrics → /v1/metrics
|
|
38
|
+
# OTEL_EXPORTER_OTLP_TRACES_ENDPOINT= # Overrides the base for traces; used as-is
|
|
39
|
+
# OTEL_EXPORTER_OTLP_METRICS_ENDPOINT= # Overrides the base for metrics; used as-is
|
|
38
40
|
|
|
39
41
|
# ── Server-specific ──────────────────────────────────────────────────
|
|
40
42
|
# Add your server's environment variables below
|
|
@@ -10,7 +10,7 @@ body:
|
|
|
10
10
|
**Secondary labels.** `enhancement` is applied automatically — also add one or more of the following in the sidebar if they apply:
|
|
11
11
|
- `performance` — improves memory, CPU, latency, or resource usage
|
|
12
12
|
- `security` — hardens the security posture
|
|
13
|
-
- `breaking-change` — will break public API
|
|
13
|
+
- `breaking-change` — will break public API or an existing tool contract
|
|
14
14
|
- `surplus-token-idea` — worth exploring when token budget allows
|
|
15
15
|
|
|
16
16
|
- type: textarea
|
package/templates/AGENTS.md
CHANGED
|
@@ -67,7 +67,7 @@ export const searchItems = tool('search_items', {
|
|
|
67
67
|
annotations: { readOnlyHint: true },
|
|
68
68
|
input: z.object({
|
|
69
69
|
query: z.string().describe('Search terms'),
|
|
70
|
-
limit: z.number().default(10).describe('Max results'),
|
|
70
|
+
limit: z.number().int().min(1).max(100).default(10).describe('Max results (1–100)'),
|
|
71
71
|
}),
|
|
72
72
|
output: z.object({
|
|
73
73
|
items: z.array(z.object({
|
|
@@ -199,7 +199,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
199
199
|
| Property | Description |
|
|
200
200
|
|:---------|:------------|
|
|
201
201
|
| `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. |
|
|
202
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
202
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any JSON-serializable value; reads return its JSON form (a `Date` comes back as an ISO string). |
|
|
203
203
|
| `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. |
|
|
204
204
|
| `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
|
|
205
205
|
| `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). |
|
package/templates/CLAUDE.md
CHANGED
|
@@ -67,7 +67,7 @@ export const searchItems = tool('search_items', {
|
|
|
67
67
|
annotations: { readOnlyHint: true },
|
|
68
68
|
input: z.object({
|
|
69
69
|
query: z.string().describe('Search terms'),
|
|
70
|
-
limit: z.number().default(10).describe('Max results'),
|
|
70
|
+
limit: z.number().int().min(1).max(100).default(10).describe('Max results (1–100)'),
|
|
71
71
|
}),
|
|
72
72
|
output: z.object({
|
|
73
73
|
items: z.array(z.object({
|
|
@@ -199,7 +199,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
199
199
|
| Property | Description |
|
|
200
200
|
|:---------|:------------|
|
|
201
201
|
| `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. |
|
|
202
|
-
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any serializable value. |
|
|
202
|
+
| `ctx.state` | Tenant-scoped KV — `.get(key)`, `.set(key, value, { ttl? })`, `.delete(key)`, `.getMany(keys)`, `.list(prefix, { cursor, limit })`. Accepts any JSON-serializable value; reads return its JSON form (a `Date` comes back as an ISO string). |
|
|
203
203
|
| `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. |
|
|
204
204
|
| `ctx.inputs` | Reader over a retried request's responses — `.accepted(key, schema)`, `.view(key)`, `.state()`, `.dropped`. Empty on the first round. |
|
|
205
205
|
| `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). |
|
package/templates/Dockerfile
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# output. A stage that compiles a native addon needs the target-arch toolchain
|
|
15
15
|
# and cannot cross-compile this way — drop the flag there.
|
|
16
16
|
# ==============================================================================
|
|
17
|
-
FROM --platform=$BUILDPLATFORM oven/bun:1.4.
|
|
17
|
+
FROM --platform=$BUILDPLATFORM oven/bun:1.4.2 AS build
|
|
18
18
|
|
|
19
19
|
WORKDIR /usr/src/app
|
|
20
20
|
|
|
@@ -40,7 +40,7 @@ RUN bun run build
|
|
|
40
40
|
# application. It uses a slim base image and only includes production
|
|
41
41
|
# dependencies and build artifacts.
|
|
42
42
|
# ==============================================================================
|
|
43
|
-
FROM oven/bun:1.4.
|
|
43
|
+
FROM oven/bun:1.4.2-slim AS production
|
|
44
44
|
|
|
45
45
|
WORKDIR /usr/src/app
|
|
46
46
|
|
|
@@ -70,8 +70,8 @@ RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
|
70
70
|
bun install --production --omit=peer --frozen-lockfile --ignore-scripts
|
|
71
71
|
|
|
72
72
|
# Conditionally install OpenTelemetry optional peer dependencies (Tier 3).
|
|
73
|
-
#
|
|
74
|
-
# with: docker build --build-arg OTEL_ENABLED=
|
|
73
|
+
# Installed by default. Omit them for a leaner image at build time
|
|
74
|
+
# with: docker build --build-arg OTEL_ENABLED=false
|
|
75
75
|
ARG OTEL_ENABLED=true
|
|
76
76
|
RUN --mount=type=cache,target=/root/.bun/install/cache \
|
|
77
77
|
if [ "$OTEL_ENABLED" = "true" ]; then \
|
package/templates/package.json
CHANGED
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"url": ""
|
|
53
53
|
},
|
|
54
54
|
"license": "Apache-2.0",
|
|
55
|
-
"packageManager": "bun@1.4.
|
|
55
|
+
"packageManager": "bun@1.4.2",
|
|
56
56
|
"engines": {
|
|
57
57
|
"bun": ">=1.4.0",
|
|
58
58
|
"node": ">=24.0.0"
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@biomejs/biome": "2.5.14",
|
|
70
|
-
"@socketsecurity/bun-security-scanner": "^1.1.
|
|
71
|
-
"@types/node": "26.
|
|
70
|
+
"@socketsecurity/bun-security-scanner": "^1.1.3",
|
|
71
|
+
"@types/node": "26.6.2",
|
|
72
72
|
"@vitest/coverage-istanbul": "4.1.11",
|
|
73
73
|
"depcheck": "^1.4.7",
|
|
74
74
|
"fast-check": "^4.9.0",
|
|
@@ -8,11 +8,9 @@ import { prompt, z } from '@cyanheads/mcp-ts-core';
|
|
|
8
8
|
// Prompts are pure message templates — no Context, no auth, no side effects.
|
|
9
9
|
// They generate conversation messages that clients can use to start interactions.
|
|
10
10
|
export const echoPrompt = prompt('template_echo_message', {
|
|
11
|
-
description: '
|
|
11
|
+
description: 'Generate a simple echo message. Replace this with your first real prompt.',
|
|
12
12
|
args: z.object({
|
|
13
13
|
message: z.string().describe('The message to echo.'),
|
|
14
14
|
}),
|
|
15
|
-
generate: (args) => [
|
|
16
|
-
{ role: 'user', content: { type: 'text', text: `Echo: ${args.message}` } },
|
|
17
|
-
],
|
|
15
|
+
generate: (args) => [{ role: 'user', content: { type: 'text', text: `Echo: ${args.message}` } }],
|
|
18
16
|
});
|
|
@@ -18,31 +18,69 @@ const APP_HTML = `<!DOCTYPE html>
|
|
|
18
18
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
19
19
|
<title>Echo App</title>
|
|
20
20
|
<style>
|
|
21
|
+
/*
|
|
22
|
+
* Local tokens are the pre-connect baseline: light by default, dark when the
|
|
23
|
+
* OS prefers it, and pinned by the data-theme attribute applyDocumentTheme sets.
|
|
24
|
+
* Every rule reads the host's variable first (installed by applyHostStyleVariables)
|
|
25
|
+
* and falls back to the local token until host context arrives.
|
|
26
|
+
*/
|
|
27
|
+
:root {
|
|
28
|
+
color-scheme: light dark;
|
|
29
|
+
--bg: #ffffff; --surface: #f8fafc; --fg: #0f172a; --muted: #64748b;
|
|
30
|
+
--border: #e2e8f0; --accent: #2563eb; --accent-fg: #ffffff;
|
|
31
|
+
}
|
|
32
|
+
@media (prefers-color-scheme: dark) {
|
|
33
|
+
:root:not([data-theme="light"]) {
|
|
34
|
+
--bg: #0f172a; --surface: #1e293b; --fg: #e2e8f0; --muted: #94a3b8;
|
|
35
|
+
--border: #334155; --accent: #3b82f6; --accent-fg: #ffffff;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
:root[data-theme="dark"] {
|
|
39
|
+
--bg: #0f172a; --surface: #1e293b; --fg: #e2e8f0; --muted: #94a3b8;
|
|
40
|
+
--border: #334155; --accent: #3b82f6; --accent-fg: #ffffff;
|
|
41
|
+
}
|
|
21
42
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
22
43
|
body {
|
|
23
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
24
|
-
background:
|
|
44
|
+
font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
|
|
45
|
+
background: var(--color-background-primary, var(--bg));
|
|
46
|
+
color: var(--color-text-primary, var(--fg));
|
|
25
47
|
padding: 1.5rem; min-height: 100vh;
|
|
26
48
|
display: flex; flex-direction: column; align-items: center; gap: 1rem;
|
|
27
49
|
}
|
|
28
|
-
h1 {
|
|
50
|
+
h1 {
|
|
51
|
+
font-size: var(--font-heading-sm-size, 1.25rem);
|
|
52
|
+
font-weight: var(--font-weight-semibold, 600);
|
|
53
|
+
}
|
|
29
54
|
.card {
|
|
30
|
-
background:
|
|
55
|
+
background: var(--color-background-secondary, var(--surface));
|
|
56
|
+
border: 1px solid var(--color-border-primary, var(--border));
|
|
57
|
+
border-radius: var(--border-radius-lg, 0.5rem);
|
|
31
58
|
padding: 1rem 1.25rem; width: 100%; max-width: 480px;
|
|
32
59
|
}
|
|
33
|
-
.label {
|
|
34
|
-
|
|
60
|
+
.label {
|
|
61
|
+
font-size: var(--font-text-xs-size, 0.75rem);
|
|
62
|
+
color: var(--color-text-secondary, var(--muted));
|
|
63
|
+
text-transform: uppercase; letter-spacing: 0.05em;
|
|
64
|
+
}
|
|
65
|
+
.value { font-size: var(--font-text-md-size, 1rem); margin-top: 0.25rem; word-break: break-word; }
|
|
35
66
|
.controls { display: flex; gap: 0.5rem; width: 100%; max-width: 480px; }
|
|
36
67
|
input[type="text"] {
|
|
37
|
-
flex: 1; padding: 0.5rem 0.75rem;
|
|
38
|
-
|
|
68
|
+
flex: 1; padding: 0.5rem 0.75rem;
|
|
69
|
+
background: var(--color-background-secondary, var(--surface));
|
|
70
|
+
border: 1px solid var(--color-border-primary, var(--border));
|
|
71
|
+
border-radius: var(--border-radius-md, 0.375rem);
|
|
72
|
+
color: var(--color-text-primary, var(--fg));
|
|
73
|
+
font: inherit; font-size: var(--font-text-sm-size, 0.875rem); outline: none;
|
|
39
74
|
}
|
|
40
|
-
input[type="text"]:focus { border-color:
|
|
75
|
+
input[type="text"]:focus { border-color: var(--color-ring-primary, var(--accent)); }
|
|
41
76
|
button {
|
|
42
|
-
padding: 0.5rem 1rem;
|
|
43
|
-
|
|
77
|
+
padding: 0.5rem 1rem; border: none;
|
|
78
|
+
background: var(--color-background-inverse, var(--accent));
|
|
79
|
+
color: var(--color-text-inverse, var(--accent-fg));
|
|
80
|
+
border-radius: var(--border-radius-md, 0.375rem);
|
|
81
|
+
font: inherit; font-size: var(--font-text-sm-size, 0.875rem); cursor: pointer;
|
|
44
82
|
}
|
|
45
|
-
button:hover {
|
|
83
|
+
button:hover { opacity: 0.9; }
|
|
46
84
|
button:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
47
85
|
</style>
|
|
48
86
|
</head>
|
|
@@ -138,8 +176,7 @@ export const echoAppUiResource = appResource('ui://template-echo-app/app.html',
|
|
|
138
176
|
name: 'echo-app-ui',
|
|
139
177
|
title: 'Echo App UI',
|
|
140
178
|
description:
|
|
141
|
-
'Interactive HTML app for the echo app tool. Displayed as a sandboxed iframe '
|
|
142
|
-
'by MCP Apps-capable hosts.',
|
|
179
|
+
'Interactive HTML app for the echo app tool. Displayed as a sandboxed iframe by MCP Apps-capable hosts.',
|
|
143
180
|
params: ParamsSchema,
|
|
144
181
|
auth: ['resource:echo-app-ui:read'],
|
|
145
182
|
_meta: {
|
|
@@ -9,7 +9,7 @@ import { resource, z } from '@cyanheads/mcp-ts-core';
|
|
|
9
9
|
// Like tools, prefix names with your server name: template-echo, tasks-status, etc.
|
|
10
10
|
export const echoResource = resource('echo://{message}', {
|
|
11
11
|
name: 'template-echo-resource',
|
|
12
|
-
description: '
|
|
12
|
+
description: 'Echo a message from the URI. Replace this with your first real resource.',
|
|
13
13
|
mimeType: 'application/json',
|
|
14
14
|
params: z.object({
|
|
15
15
|
message: z.string().describe('The message to echo back.'),
|
|
@@ -15,15 +15,14 @@ export const echoAppTool = appTool('template_echo_app', {
|
|
|
15
15
|
resourceUri: UI_RESOURCE_URI,
|
|
16
16
|
title: 'Echo App',
|
|
17
17
|
description:
|
|
18
|
-
'
|
|
19
|
-
'the extension render an HTML interface; others receive a text fallback.',
|
|
18
|
+
'Echo a message back with an interactive UI. Hosts that support MCP Apps render an HTML interface; other hosts receive a text fallback.',
|
|
20
19
|
annotations: { readOnlyHint: true },
|
|
21
20
|
input: z.object({
|
|
22
21
|
message: z.string().describe('The message to echo.'),
|
|
23
22
|
}),
|
|
24
23
|
output: z.object({
|
|
25
24
|
message: z.string().describe('The echoed message.'),
|
|
26
|
-
timestamp: z.
|
|
25
|
+
timestamp: z.iso.datetime().describe('ISO 8601 timestamp of the echo.'),
|
|
27
26
|
}),
|
|
28
27
|
|
|
29
28
|
handler(input, ctx) {
|
|
@@ -9,7 +9,7 @@ import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
|
9
9
|
// Tool names are snake_case, prefixed with your server name to avoid collisions across servers.
|
|
10
10
|
// e.g. for a "tasks" server: tasks_fetch_list, tasks_create_item.
|
|
11
11
|
export const echoTool = tool('template_echo_message', {
|
|
12
|
-
description: '
|
|
12
|
+
description: 'Echo a message back. Replace this with your first real tool.',
|
|
13
13
|
annotations: { readOnlyHint: true },
|
|
14
14
|
input: z.object({
|
|
15
15
|
message: z.string().describe('The message to echo back.'),
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Barrel for telemetry utilities.
|
|
3
|
-
* Provides OpenTelemetry instrumentation, MCP attribute keys, trace helpers,
|
|
4
|
-
* and metrics creation utilities for observability.
|
|
5
|
-
*
|
|
6
|
-
* @module src/utils/telemetry
|
|
7
|
-
*/
|
|
8
|
-
export * from './attributes.js';
|
|
9
|
-
export * from './instrumentation.js';
|
|
10
|
-
export * from './metrics.js';
|
|
11
|
-
export * from './trace.js';
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Barrel for telemetry utilities.
|
|
3
|
-
* Provides OpenTelemetry instrumentation, MCP attribute keys, trace helpers,
|
|
4
|
-
* and metrics creation utilities for observability.
|
|
5
|
-
*
|
|
6
|
-
* @module src/utils/telemetry
|
|
7
|
-
*/
|
|
8
|
-
export * from './attributes.js';
|
|
9
|
-
export * from './instrumentation.js';
|
|
10
|
-
export * from './metrics.js';
|
|
11
|
-
export * from './trace.js';
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/telemetry/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|