@cyanheads/mcp-ts-core 0.12.4 → 0.12.6
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 +26 -15
- package/CLAUDE.md +26 -15
- package/README.md +1 -1
- package/biome.json +1 -1
- package/changelog/0.12.x/0.12.5.md +18 -0
- package/changelog/0.12.x/0.12.6.md +44 -0
- package/dist/config/appRoot.d.ts +28 -0
- package/dist/config/appRoot.d.ts.map +1 -0
- package/dist/config/appRoot.js +141 -0
- package/dist/config/appRoot.js.map +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +11 -39
- package/dist/config/index.js.map +1 -1
- package/dist/core/app.d.ts +2 -2
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/app.js +6 -2
- package/dist/core/app.js.map +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +2 -2
- package/dist/core/worker.d.ts +1 -1
- package/dist/core/worker.js +1 -1
- package/dist/mcp-server/apps/appBuilders.d.ts +2 -2
- package/dist/mcp-server/apps/appBuilders.js +2 -2
- package/dist/mcp-server/cacheHints.d.ts +1 -1
- package/dist/mcp-server/prompts/prompt-registration.d.ts +1 -1
- package/dist/mcp-server/prompts/prompt-registration.js +1 -1
- package/dist/mcp-server/resources/resource-registration.d.ts +3 -3
- package/dist/mcp-server/resources/resource-registration.js +1 -1
- package/dist/mcp-server/resources/resourceSubscriptions.d.ts +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +2 -2
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +4 -4
- package/dist/mcp-server/server.d.ts +4 -4
- package/dist/mcp-server/server.js +1 -1
- package/dist/mcp-server/tools/tool-registration.d.ts +3 -3
- package/dist/mcp-server/tools/tool-registration.js +2 -2
- package/dist/mcp-server/tools/utils/disabled-tool.d.ts +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +4 -4
- package/dist/mcp-server/transports/auth/authFactory.d.ts +1 -1
- package/dist/mcp-server/transports/auth/authFactory.js +2 -2
- package/dist/mcp-server/transports/auth/authMiddleware.d.ts +1 -1
- package/dist/mcp-server/transports/auth/authMiddleware.js +1 -1
- package/dist/mcp-server/transports/auth/lib/authUtils.js +1 -1
- package/dist/mcp-server/transports/auth/lib/claimParser.d.ts +1 -1
- package/dist/mcp-server/transports/auth/strategies/authStrategy.d.ts +1 -1
- package/dist/mcp-server/transports/auth/strategies/jwtStrategy.d.ts +2 -2
- package/dist/mcp-server/transports/auth/strategies/jwtStrategy.js +1 -1
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.d.ts +2 -2
- package/dist/mcp-server/transports/auth/strategies/oauthStrategy.js +1 -1
- package/dist/mcp-server/transports/http/httpErrorHandler.d.ts +1 -1
- package/dist/mcp-server/transports/http/httpServer.d.ts +1 -1
- package/dist/mcp-server/transports/http/httpServer.js +1 -1
- package/dist/mcp-server/transports/http/httpTransport.d.ts +3 -3
- package/dist/mcp-server/transports/http/httpTransport.js +12 -12
- package/dist/mcp-server/transports/http/landing-page/handler.d.ts +1 -1
- package/dist/mcp-server/transports/http/sessionStore.js +1 -1
- package/dist/mcp-server/transports/manager.d.ts +2 -2
- package/dist/mcp-server/transports/manager.js +3 -3
- package/dist/services/llm/providers/openrouter.provider.d.ts +1 -1
- package/dist/storage/core/StorageService.d.ts +1 -1
- package/dist/storage/core/StorageService.js +1 -1
- package/dist/storage/core/storageFactory.d.ts +2 -2
- package/dist/storage/core/storageFactory.js +6 -6
- package/dist/storage/core/storageValidation.d.ts.map +1 -1
- package/dist/storage/core/storageValidation.js +5 -3
- package/dist/storage/core/storageValidation.js.map +1 -1
- package/dist/storage/providers/cloudflare/d1Provider.d.ts +1 -1
- package/dist/storage/providers/cloudflare/d1Provider.js +1 -1
- package/dist/storage/providers/cloudflare/kvProvider.d.ts +1 -1
- package/dist/storage/providers/cloudflare/kvProvider.js +1 -1
- package/dist/storage/providers/cloudflare/r2Provider.d.ts +1 -1
- package/dist/storage/providers/cloudflare/r2Provider.js +1 -1
- package/dist/storage/providers/fileSystem/fileSystemProvider.d.ts +1 -1
- package/dist/storage/providers/fileSystem/fileSystemProvider.js +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts +3 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.d.ts.map +1 -1
- package/dist/storage/providers/inMemory/inMemoryProvider.js +11 -7
- package/dist/storage/providers/inMemory/inMemoryProvider.js.map +1 -1
- package/dist/storage/providers/supabase/supabaseProvider.d.ts +2 -2
- package/dist/storage/providers/supabase/supabaseProvider.js +1 -1
- package/dist/testing/fuzz.d.ts.map +1 -1
- package/dist/testing/fuzz.js +92 -53
- package/dist/testing/fuzz.js.map +1 -1
- package/dist/utils/formatting/diffFormatter.d.ts +2 -2
- package/dist/utils/formatting/diffFormatter.js +4 -4
- package/dist/utils/formatting/markdownBuilder.d.ts +8 -0
- package/dist/utils/formatting/markdownBuilder.d.ts.map +1 -1
- package/dist/utils/formatting/markdownBuilder.js +16 -1
- package/dist/utils/formatting/markdownBuilder.js.map +1 -1
- package/dist/utils/formatting/tableFormatter.d.ts +2 -2
- package/dist/utils/formatting/tableFormatter.js +3 -3
- package/dist/utils/formatting/treeFormatter.d.ts +3 -3
- package/dist/utils/formatting/treeFormatter.js +4 -4
- package/dist/utils/internal/error-handler/errorHandler.js +6 -6
- package/dist/utils/internal/error-handler/helpers.js +1 -1
- package/dist/utils/internal/error-handler/types.d.ts +1 -1
- package/dist/utils/internal/health.js +2 -2
- package/dist/utils/internal/lazyImport.js +1 -1
- package/dist/utils/internal/logger.d.ts +34 -3
- package/dist/utils/internal/logger.d.ts.map +1 -1
- package/dist/utils/internal/logger.js +87 -5
- package/dist/utils/internal/logger.js.map +1 -1
- package/dist/utils/internal/performance.d.ts +1 -1
- package/dist/utils/internal/performance.js +6 -6
- package/dist/utils/internal/requestContext.d.ts +1 -1
- package/dist/utils/internal/requestContext.js +2 -2
- package/dist/utils/metrics/tokenCounter.d.ts +1 -1
- package/dist/utils/metrics/tokenCounter.js +2 -2
- package/dist/utils/network/fetchWithTimeout.d.ts +1 -1
- package/dist/utils/network/fetchWithTimeout.js +6 -6
- package/dist/utils/network/httpError.js +1 -1
- package/dist/utils/network/retry.d.ts +1 -1
- package/dist/utils/network/retry.js +1 -1
- package/dist/utils/pagination/pagination.d.ts +2 -2
- package/dist/utils/pagination/pagination.js +4 -4
- package/dist/utils/parsing/csvParser.d.ts +4 -4
- package/dist/utils/parsing/csvParser.js +6 -6
- package/dist/utils/parsing/dateParser.d.ts +3 -3
- package/dist/utils/parsing/dateParser.js +6 -6
- package/dist/utils/parsing/frontmatterParser.d.ts +2 -2
- package/dist/utils/parsing/frontmatterParser.js +3 -3
- package/dist/utils/parsing/htmlExtractor.d.ts +3 -3
- package/dist/utils/parsing/htmlExtractor.js +5 -5
- package/dist/utils/parsing/jsonParser.d.ts +4 -4
- package/dist/utils/parsing/jsonParser.js +6 -6
- package/dist/utils/parsing/pdfParser.d.ts +2 -2
- package/dist/utils/parsing/pdfParser.js +4 -4
- package/dist/utils/parsing/xmlParser.d.ts +4 -4
- package/dist/utils/parsing/xmlParser.js +5 -5
- package/dist/utils/parsing/yamlParser.d.ts +4 -4
- package/dist/utils/parsing/yamlParser.js +6 -6
- package/dist/utils/scheduling/scheduler.d.ts +3 -3
- package/dist/utils/scheduling/scheduler.js +5 -5
- package/dist/utils/security/rateLimiter.d.ts +2 -2
- package/dist/utils/security/rateLimiter.js +3 -3
- package/dist/utils/security/rateLimiter.js.map +1 -1
- package/dist/utils/security/sanitization.d.ts +3 -3
- package/dist/utils/security/sanitization.js +7 -7
- package/dist/utils/telemetry/instrumentation.d.ts.map +1 -1
- package/dist/utils/telemetry/instrumentation.js +7 -8
- package/dist/utils/telemetry/instrumentation.js.map +1 -1
- package/dist/utils/telemetry/trace.d.ts +1 -1
- package/dist/utils/telemetry/trace.js +1 -1
- package/package.json +13 -7
- package/scripts/devcheck.ts +6 -4
- package/skills/api-config/SKILL.md +4 -2
- package/skills/api-utils/SKILL.md +2 -2
- package/skills/api-utils/references/formatting.md +1 -1
- package/skills/api-workers/SKILL.md +3 -3
- package/skills/setup/SKILL.md +14 -2
- package/templates/AGENTS.md +2 -2
- package/templates/CLAUDE.md +2 -2
- package/templates/_bunfig.toml +15 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../../src/utils/telemetry/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,CAAC,IAAI,GAAG,GAAmB,IAAI,CAAC;AAEtC,kCAAkC;AAClC,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAC9B,IAAI,qBAAqB,GAAyB,IAAI,CAAC;AAEvD;;;;;;;;GAQG;AACH,SAAS,aAAa;IACpB,OAAO,CACL,WAAW,CAAC,MAAM;QAClB,CAAC,WAAW,CAAC,YAAY;QACzB,OAAO,OAAO,EAAE,QAAQ,EAAE,IAAI,KAAK,QAAQ;QAC3C,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,CAChC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAS,mBAAmB;IAC1B,6EAA6E;IAC7E,4EAA4E;IAC5E,yEAAyE;IACzE,MAAM,cAAc,GAAG,gBAAgB,CAAC;IACxC,MAAM,cAAc,GAAG,gBAAgB,CAAC;IACxC,MAAM,YAAY,GAAG,cAAc,CAAC;IAEpC,MAAM,KAAK,GAA2B,EAAE,CAAC;IAEzC,qBAAqB;IACrB,IAAI,WAAW,CAAC,YAAY,EAAE,CAAC;QAC7B,K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SAAS,CAAC,CAAC;YAC7F,eAAe,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;IAC1D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;QACzD,MAAM,KAAK,CAAC,CAAC,gCAAgC;IAC/C,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,GAAG,GAAG,IAAI,CAAC;QACX,iBAAiB,GAAG,KAAK,CAAC;QAC1B,qBAAqB,GAAG,IAAI,CAAC;IAC/B,CAAC;AACH,CAAC"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @module src/utils/telemetry/trace
|
|
6
6
|
*/
|
|
7
7
|
import { type Span } from '@opentelemetry/api';
|
|
8
|
-
import type { RequestContext } from '
|
|
8
|
+
import type { RequestContext } from '../internal/requestContext.js';
|
|
9
9
|
/**
|
|
10
10
|
* Parsed fields from a W3C `traceparent` header (`00-<traceId>-<spanId>-<flags>`).
|
|
11
11
|
* Used to propagate distributed trace context across service boundaries.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { context as otContext, propagation, ROOT_CONTEXT, SpanStatusCode, trace, } from '@opentelemetry/api';
|
|
8
8
|
import { config } from '../../config/index.js';
|
|
9
|
-
import { requestContextService } from '
|
|
9
|
+
import { requestContextService } from '../internal/requestContext.js';
|
|
10
10
|
/**
|
|
11
11
|
* Builds a W3C `traceparent` header value from a `RequestContext` or the currently active span.
|
|
12
12
|
* Uses `ctx.traceId`/`ctx.spanId` when provided; falls back to the active OTel span context.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/mcp-ts-core",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.6",
|
|
4
4
|
"mcpName": "io.github.cyanheads/mcp-ts-core",
|
|
5
5
|
"description": "Agent-native TypeScript framework for building MCP servers. Build tools, not infrastructure. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.",
|
|
6
6
|
"files": [
|
|
@@ -164,21 +164,27 @@
|
|
|
164
164
|
"format:unsafe": "biome check --write --unsafe .",
|
|
165
165
|
"typecheck": "bunx tsc --noEmit",
|
|
166
166
|
"typecheck:scripts": "bunx tsc --project tsconfig.scripts.json --noEmit",
|
|
167
|
+
"list-skills": "bun run scripts/list-skills.ts",
|
|
167
168
|
"tree": "bun run scripts/tree.ts",
|
|
168
169
|
"fetch-spec": "bun run scripts/fetch-openapi-spec.ts",
|
|
170
|
+
"bench": "bunx vitest bench --run --config tests/config/vitest.benchmark.ts",
|
|
171
|
+
"bench:node": "bun run scripts/with-node.ts ./node_modules/vitest/vitest.mjs bench --run --config tests/config/vitest.benchmark.ts",
|
|
172
|
+
"bench:io": "bun run scripts/with-node.ts ./node_modules/vitest/vitest.mjs run --config tests/config/vitest.performance.ts",
|
|
173
|
+
"bench:io:bun": "bunx vitest run --config tests/config/vitest.performance.ts --project http --project native",
|
|
169
174
|
"test": "bunx vitest run",
|
|
170
175
|
"test:all": "bun run rebuild && bun run test:coverage && bun run test:node && bun run test:worker && bun run test:integration",
|
|
171
|
-
"test:integration": "bunx vitest run --config vitest.integration.ts",
|
|
172
|
-
"test:leaks": "
|
|
173
|
-
"test:node": "
|
|
174
|
-
"test:order": "
|
|
175
|
-
"test:package": "bun run rebuild && bunx vitest run --config vitest.package.ts",
|
|
176
|
+
"test:integration": "bunx vitest run --config tests/config/vitest.integration.ts",
|
|
177
|
+
"test:leaks": "bun run tests/leaks/run.ts",
|
|
178
|
+
"test:node": "bun run scripts/with-node.ts ./node_modules/vitest/vitest.mjs run && bun run scripts/with-node.ts ./node_modules/vitest/vitest.mjs run --config tests/config/vitest.integration.ts",
|
|
179
|
+
"test:order": "bun run scripts/with-node.ts ./node_modules/vitest/vitest.mjs run --sequence.shuffle --sequence.seed=20260809 --expect.requireAssertions",
|
|
180
|
+
"test:package": "bun run rebuild && bunx vitest run --config tests/config/vitest.package.ts",
|
|
176
181
|
"test:unit": "bunx vitest run --project unit",
|
|
177
182
|
"test:smoke": "bunx vitest run --project smoke",
|
|
178
183
|
"test:fuzz": "bunx vitest run --project fuzz",
|
|
179
184
|
"test:typecheck": "bunx vitest run --project typecheck",
|
|
180
185
|
"test:compliance": "bunx vitest run --project compliance",
|
|
181
|
-
"test:
|
|
186
|
+
"test:leak-gate": "bunx vitest run --project leak-gate",
|
|
187
|
+
"test:worker": "bun run scripts/with-node.ts ./node_modules/vitest/vitest.mjs run --config tests/config/vitest.worker.ts && bun run scripts/with-node.ts ./node_modules/vitest/vitest.mjs run --config tests/config/vitest.worker-bundle.ts",
|
|
182
188
|
"test:ui": "bunx vitest --ui",
|
|
183
189
|
"test:coverage": "bunx vitest run --coverage",
|
|
184
190
|
"audit": "bun audit",
|
package/scripts/devcheck.ts
CHANGED
|
@@ -437,16 +437,18 @@ const ALL_CHECKS: Check[] = [
|
|
|
437
437
|
flag: '--no-packaging',
|
|
438
438
|
canFix: false,
|
|
439
439
|
// Validates env var alignment between manifest.json (MCPB bundle) and
|
|
440
|
-
// server.json (MCP Registry), plus plugin marketplace manifests (#240)
|
|
441
|
-
//
|
|
442
|
-
// when none exist — consumers on an
|
|
440
|
+
// server.json (MCP Registry), plus plugin marketplace manifests (#240), and
|
|
441
|
+
// the bundle-content guards on .mcpbignore (#343). Runs when any of those
|
|
442
|
+
// inputs is present; skipped cleanly when none exist — consumers on an
|
|
443
|
+
// HTTP-only deploy are unaffected.
|
|
443
444
|
getCommand: () => {
|
|
444
445
|
const hasManifest = existsSync(path.join(ROOT_DIR, 'manifest.json'));
|
|
445
446
|
const hasPluginManifest =
|
|
446
447
|
existsSync(path.join(ROOT_DIR, '.claude-plugin/plugin.json')) ||
|
|
447
448
|
existsSync(path.join(ROOT_DIR, '.codex-plugin/plugin.json')) ||
|
|
448
449
|
existsSync(path.join(ROOT_DIR, '.codex-plugin/mcp.json'));
|
|
449
|
-
|
|
450
|
+
const hasMcpbIgnore = existsSync(path.join(ROOT_DIR, '.mcpbignore'));
|
|
451
|
+
if (!hasManifest && !hasPluginManifest && !hasMcpbIgnore) return null;
|
|
450
452
|
return ['bun', 'run', 'scripts/lint-packaging.ts'];
|
|
451
453
|
},
|
|
452
454
|
tip: (c) =>
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Reference for core and server configuration in `@cyanheads/mcp-ts-core`. Covers env var tables with defaults, priority order, server-specific Zod schema pattern, and Workers lazy-parsing requirement.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.15"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -27,6 +27,8 @@ Managed by `@cyanheads/mcp-ts-core`. Validated via Zod from environment variable
|
|
|
27
27
|
2. Environment variables
|
|
28
28
|
3. `package.json` fields
|
|
29
29
|
|
|
30
|
+
**Where `package.json` is read from:** the application root — the nearest `package.json` at or above the process entry module (`process.argv[1]`), which is the served package on every launch path (`npx`, `.mcpb`, a client config naming `dist/index.js`), none of which run from the package root. The launching client's working directory is never the anchor: a stdio client starts the server from wherever it happens to be, so reading identity from there makes a server report a foreign project's name and version. When the entry module is a tool installed under the project's own `node_modules` and the process runs from that project — a test runner is the usual case — the project's manifest wins. With no manifest reachable, the framework's own identity is the fallback.
|
|
31
|
+
|
|
30
32
|
---
|
|
31
33
|
|
|
32
34
|
### Identity
|
|
@@ -75,7 +77,7 @@ await createApp({
|
|
|
75
77
|
|:--------|:-----------------|:--------|:------|
|
|
76
78
|
| `NODE_ENV` | `environment` | `development` | Aliases: `dev`→`development`, `prod`→`production`, `test`→`testing` |
|
|
77
79
|
| `MCP_LOG_LEVEL` | `logLevel` | `debug` | Aliases: `warn`→`warning`, `err`→`error`, `fatal`/`silent`→`emerg`, `trace`→`debug`, `information`→`info` |
|
|
78
|
-
| `LOGS_DIR` | `logsPath` | `<
|
|
80
|
+
| `LOGS_DIR` | `logsPath` | `<app-root>/logs` | Node.js only; absolute paths are used verbatim, relative ones resolve against the application root (see Core config) — never the framework's install directory |
|
|
79
81
|
|
|
80
82
|
### Transport
|
|
81
83
|
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
API reference for all utilities exported from `@cyanheads/mcp-ts-core/utils`. Use when looking up utility method signatures, options, peer dependencies, or usage patterns.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "2.
|
|
7
|
+
version: "2.8"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -81,7 +81,7 @@ The `utils` export includes two type guards. The full set of guards lives in the
|
|
|
81
81
|
| Export | API | Notes |
|
|
82
82
|
|:-------|:----|:------|
|
|
83
83
|
| `Logger` | Class | The `Logger` class itself. Use `Logger.getInstance()` if needed; most consumers use the `logger` singleton. |
|
|
84
|
-
| `logger` | `Logger` instance (wraps Pino). `.debug(msg, ctx?)` `.info(msg, ctx?)` `.notice(msg, ctx?)` `.warning(msg, ctx?)` `.error(msg, errorOrCtx, ctx?)` `.crit(msg, errorOrCtx, ctx?)` `.alert(msg, errorOrCtx, ctx?)` `.emerg(msg, errorOrCtx, ctx?)` `.fatal(msg, errorOrCtx, ctx?)` | Global structured logger. Use `ctx.log` in handlers instead. `logger` is for lifecycle/background contexts (startup, shutdown, `setup()`). Auto-redacts sensitive fields. **Note:** `.error()` and higher accept `(msg, Error, ctx?)` or `(msg, ctx?)` — the second arg is overloaded. `.fatal()` is an alias for `.emerg()`. Full RFC 5424 severity set. |
|
|
84
|
+
| `logger` | `Logger` instance (wraps Pino). `.debug(msg, ctx?)` `.info(msg, ctx?)` `.notice(msg, ctx?)` `.warning(msg, ctx?)` `.error(msg, errorOrCtx, ctx?)` `.crit(msg, errorOrCtx, ctx?)` `.alert(msg, errorOrCtx, ctx?)` `.emerg(msg, errorOrCtx, ctx?)` `.fatal(msg, errorOrCtx, ctx?)` | Global structured logger. Use `ctx.log` in handlers instead. `logger` is for lifecycle/background contexts (startup, shutdown, `setup()`). Auto-redacts sensitive fields. Records logged before the framework initializes the logger — anything in `setup()` — are held in a 250-record buffer and replayed once the sinks exist, filtered against the level the logger starts with. **Note:** `.error()` and higher accept `(msg, Error, ctx?)` or `(msg, ctx?)` — the second arg is overloaded. `.fatal()` is an alias for `.emerg()`. Full RFC 5424 severity set. |
|
|
85
85
|
| `McpLogLevel` | Type | Log level union type for typing level variables. |
|
|
86
86
|
|
|
87
87
|
---
|
|
@@ -21,7 +21,7 @@ import { markdown, MarkdownBuilder, diffFormatter, tableFormatter, treeFormatter
|
|
|
21
21
|
| `keyValue` | `(key, value) -> this` | `**key:** value` |
|
|
22
22
|
| `keyValuePlain` | `(key, value) -> this` | `key: value` (no bold) |
|
|
23
23
|
| `list` | `(items, ordered?) -> this` | `ordered` defaults to `false`; empty arrays silently ignored |
|
|
24
|
-
| `codeBlock` | `(content, language?) -> this` | Fenced block; `language` defaults to `''` |
|
|
24
|
+
| `codeBlock` | `(content, language?) -> this` | Fenced block; `language` defaults to `''`. The fence outgrows the longest backtick run in `content`, so a payload the tool did not author (upstream text, a file excerpt) cannot break out of the block; content is emitted byte-for-byte |
|
|
25
25
|
| `inlineCode` | `(code) -> this` | Backtick-wrapped; no trailing newline |
|
|
26
26
|
| `paragraph` | `(text) -> this` | Text + `\n\n` |
|
|
27
27
|
| `blockquote` | `(text) -> this` | Each line prefixed with `>` + space |
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Cloudflare Workers deployment using `createWorkerHandler` from `@cyanheads/mcp-ts-core/worker`. Covers the full handler signature, binding types, CloudflareBindings extensibility, runtime compatibility guards, and wrangler.toml requirements.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.8"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -224,9 +224,9 @@ The interface is the SDK's `ServerEventBus` — `publish(event)` and `subscribe(
|
|
|
224
224
|
|
|
225
225
|
## Testing Workers with miniflare
|
|
226
226
|
|
|
227
|
-
`bun run test:worker` runs the worker suite under `vitest.worker.ts` (using `@cloudflare/vitest-pool-workers` + miniflare). Each test **file** gets its own fresh V8 isolate — module scope (including `createWorkerHandler`'s `appPromise` singleton) is reset between files.
|
|
227
|
+
`bun run test:worker` runs the worker suite under `tests/config/vitest.worker.ts` (using `@cloudflare/vitest-pool-workers` + miniflare). Each test **file** gets its own fresh V8 isolate — module scope (including `createWorkerHandler`'s `appPromise` singleton) is reset between files.
|
|
228
228
|
|
|
229
|
-
### vitest.worker.ts miniflare bindings
|
|
229
|
+
### tests/config/vitest.worker.ts miniflare bindings
|
|
230
230
|
|
|
231
231
|
Declare all storage bindings used in the suite:
|
|
232
232
|
|
package/skills/setup/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Post-init orientation for an MCP server built on @cyanheads/mcp-ts-core. Use after running `@cyanheads/mcp-ts-core init` to understand the project structure, conventions, and skill sync model. Also use when onboarding to an existing project for the first time.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.10"
|
|
8
8
|
audience: external
|
|
9
9
|
type: workflow
|
|
10
10
|
---
|
|
@@ -130,7 +130,18 @@ Complete these one-time setup tasks:
|
|
|
130
130
|
2. **Update dependencies to latest** — `bun update --latest`. The scaffolded `package.json` pins minimum versions from when the framework was published; updating ensures you start with the latest compatible releases.
|
|
131
131
|
3. **Initialize git** — use your git tools: init the repo, stage all files, and commit with message `chore: scaffold from @cyanheads/mcp-ts-core`
|
|
132
132
|
4. **Verify the substituted server name** — when `init` runs without a `[name]` argument, the package name defaults to the cwd directory name. If that's not what you want as the published server name, update `package.json`, `CLAUDE.md`/`AGENTS.md`, and `server.json` to your actual server name.
|
|
133
|
-
5. **
|
|
133
|
+
5. **Populate the publishing identity** — the scaffold ships identity fields empty on purpose, so the first `devcheck` run is a to-do list rather than a green light. These fail the gate until they are set:
|
|
134
|
+
|
|
135
|
+
| File | Gated fields | Gate |
|
|
136
|
+
|:--|:--|:--|
|
|
137
|
+
| `server.json` | `name` (reverse-DNS, e.g. `io.github.<owner>/<server>`), `description`, `repository.url` | `lint:mcp` |
|
|
138
|
+
| `.claude-plugin/plugin.json` | `description` | `lint:packaging` |
|
|
139
|
+
| `.codex-plugin/plugin.json` | `description`, `interface.shortDescription`, `interface.longDescription` | `lint:packaging` |
|
|
140
|
+
|
|
141
|
+
Fill the rest of the same blocks while you are in them — `package.json` `description` and `repository.url`, both plugin manifests' `author` / `homepage` / `repository`, the Codex manifest's `interface.developerName` / `category` / `websiteURL`, and `manifest.json` `description` / `author.name`. Nothing gates them, and every install surface reads them.
|
|
142
|
+
|
|
143
|
+
A server that will never be published or installed as a plugin can drop the plugin-manifest gate instead — set `"packaging": { "pluginManifests": false }` in `devcheck.config.json`.
|
|
144
|
+
6. **Verify the scaffold builds clean** — `bun run devcheck`. Fix any issues before starting real work.
|
|
134
145
|
|
|
135
146
|
## Changelog Convention
|
|
136
147
|
|
|
@@ -158,6 +169,7 @@ Skip or reorder as the project calls for it. The agent protocol's "What's Next?"
|
|
|
158
169
|
- [ ] Dependencies updated (`bun update --latest`)
|
|
159
170
|
- [ ] Git repo initialized and initial commit made (`chore: scaffold from @cyanheads/mcp-ts-core`)
|
|
160
171
|
- [ ] Substituted server name verified in `package.json`, agent protocol file, and `server.json`
|
|
172
|
+
- [ ] Publishing identity populated (`server.json`, `package.json`, plugin manifests, `manifest.json`) — or the plugin-manifest gate opted out
|
|
161
173
|
- [ ] Framework docs read (`node_modules/@cyanheads/mcp-ts-core/CLAUDE.md` or `AGENTS.md`)
|
|
162
174
|
- [ ] Unused echo definitions cleaned up (and unregistered from `src/index.ts`)
|
|
163
175
|
- [ ] Skills copied to agent directory (`cp -R skills/* .claude/skills/` or equivalent)
|
package/templates/AGENTS.md
CHANGED
|
@@ -197,7 +197,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
197
197
|
|
|
198
198
|
Handlers throw — the framework catches, classifies, and formats.
|
|
199
199
|
|
|
200
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
200
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
|
|
201
201
|
|
|
202
202
|
```ts
|
|
203
203
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
@@ -376,7 +376,7 @@ security: false # optional — true ONLY for a source
|
|
|
376
376
|
|
|
377
377
|
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
378
378
|
|
|
379
|
-
**Section order
|
|
379
|
+
**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.
|
|
380
380
|
|
|
381
381
|
**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.
|
|
382
382
|
|
package/templates/CLAUDE.md
CHANGED
|
@@ -197,7 +197,7 @@ Handlers receive a unified `ctx` object. Key properties:
|
|
|
197
197
|
|
|
198
198
|
Handlers throw — the framework catches, classifies, and formats.
|
|
199
199
|
|
|
200
|
-
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble freely and don't need declaring.
|
|
200
|
+
**Recommended: typed error contract.** Declare `errors: [{ reason, code, when, recovery, retryable? }]` on `tool()` / `resource()` to receive `ctx.fail(reason, …)` typed against the reason union. TypeScript catches typos at compile time, `data.reason` is auto-populated for observability, linter enforces conformance against the handler body. `recovery` is required (≥ 5 words, lint-validated) — the single source of truth for the agent's next move. Pass `ctx.recoveryFor('reason')` as the throw's data to put it on the wire (`data.recovery.hint`, mirrored into `content[]` text); override with an explicit `{ recovery: { hint: '...' } }` when dynamic runtime context matters. Baseline codes (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`, `RequestCancelled`) bubble freely and don't need declaring.
|
|
201
201
|
|
|
202
202
|
```ts
|
|
203
203
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
@@ -376,7 +376,7 @@ security: false # optional — true ONLY for a source
|
|
|
376
376
|
|
|
377
377
|
`agent-notes` is an optional free-form field for maintenance agents processing the release downstream. Content here won't appear in the rendered CHANGELOG — it's consumed by agents running the `maintenance` skill. Use it for adoption instructions that don't fit the human-facing sections: new files to create, fields to populate, one-time migration steps. Omit entirely when there's nothing to say.
|
|
378
378
|
|
|
379
|
-
**Section order
|
|
379
|
+
**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.
|
|
380
380
|
|
|
381
381
|
**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.
|
|
382
382
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Bunfig: Centralized configuration for Bun behavior
|
|
2
|
+
# For more options, see: https://bun.com/docs/runtime/bunfig
|
|
3
|
+
|
|
4
|
+
[install]
|
|
5
|
+
# Block package versions published less than 3 days ago — supply-chain guard
|
|
6
|
+
# against freshly compromised releases. Existing versions in bun.lock are
|
|
7
|
+
# unaffected.
|
|
8
|
+
minimumReleaseAge = 259200 # seconds (3 days)
|
|
9
|
+
# Framework releases are first-party — adopt them same-day.
|
|
10
|
+
minimumReleaseAgeExcludes = ["@cyanheads/mcp-ts-core"]
|
|
11
|
+
|
|
12
|
+
[install.security]
|
|
13
|
+
# Socket scans every package before install (malware, typosquats, CVEs).
|
|
14
|
+
# Note: configuring a scanner disables Bun's auto-install.
|
|
15
|
+
scanner = "@socketsecurity/bun-security-scanner"
|