@cyanheads/mcp-ts-core 0.8.20 → 0.9.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.
- package/CLAUDE.md +21 -13
- package/README.md +45 -9
- package/biome.json +1 -1
- package/changelog/0.9.x/0.9.0.md +80 -0
- package/changelog/0.9.x/0.9.1.md +41 -0
- package/changelog/template.md +1 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/core/app.d.ts +11 -2
- package/dist/core/app.d.ts.map +1 -1
- package/dist/core/app.js +6 -19
- package/dist/core/app.js.map +1 -1
- package/dist/core/context.d.ts +6 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +2 -0
- package/dist/core/context.js.map +1 -1
- package/dist/core/worker.d.ts +17 -2
- package/dist/core/worker.d.ts.map +1 -1
- package/dist/core/worker.js +6 -2
- package/dist/core/worker.js.map +1 -1
- package/dist/linter/rules/index.d.ts +1 -0
- package/dist/linter/rules/index.d.ts.map +1 -1
- package/dist/linter/rules/index.js +1 -0
- package/dist/linter/rules/index.js.map +1 -1
- package/dist/linter/rules/portability-rules.d.ts +49 -0
- package/dist/linter/rules/portability-rules.d.ts.map +1 -0
- package/dist/linter/rules/portability-rules.js +209 -0
- package/dist/linter/rules/portability-rules.js.map +1 -0
- package/dist/linter/rules/prompt-rules.d.ts +2 -1
- package/dist/linter/rules/prompt-rules.d.ts.map +1 -1
- package/dist/linter/rules/prompt-rules.js +7 -2
- package/dist/linter/rules/prompt-rules.js.map +1 -1
- package/dist/linter/rules/resource-rules.d.ts +2 -1
- package/dist/linter/rules/resource-rules.d.ts.map +1 -1
- package/dist/linter/rules/resource-rules.js +12 -3
- package/dist/linter/rules/resource-rules.js.map +1 -1
- package/dist/linter/rules/schema-rules.d.ts +2 -0
- package/dist/linter/rules/schema-rules.d.ts.map +1 -1
- package/dist/linter/rules/schema-rules.js +1 -1
- package/dist/linter/rules/schema-rules.js.map +1 -1
- package/dist/linter/rules/tool-rules.d.ts +2 -1
- package/dist/linter/rules/tool-rules.d.ts.map +1 -1
- package/dist/linter/rules/tool-rules.js +12 -3
- package/dist/linter/rules/tool-rules.js.map +1 -1
- package/dist/linter/types.d.ts +15 -0
- package/dist/linter/types.d.ts.map +1 -1
- package/dist/linter/validate.d.ts.map +1 -1
- package/dist/linter/validate.js +22 -3
- package/dist/linter/validate.js.map +1 -1
- package/dist/logs/combined.log +7 -7
- package/dist/logs/error.log +5 -5
- package/dist/mcp-server/resources/resource-registration.d.ts.map +1 -1
- package/dist/mcp-server/resources/resource-registration.js +2 -0
- package/dist/mcp-server/resources/resource-registration.js.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts +2 -0
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js +2 -0
- package/dist/mcp-server/resources/utils/resourceHandlerFactory.js.map +1 -1
- package/dist/mcp-server/server.d.ts +15 -0
- package/dist/mcp-server/server.d.ts.map +1 -1
- package/dist/mcp-server/server.js +12 -7
- package/dist/mcp-server/server.js.map +1 -1
- package/dist/mcp-server/tools/tool-registration.d.ts.map +1 -1
- package/dist/mcp-server/tools/tool-registration.js +4 -0
- package/dist/mcp-server/tools/tool-registration.js.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts +2 -0
- package/dist/mcp-server/tools/utils/toolHandlerFactory.d.ts.map +1 -1
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js +2 -0
- package/dist/mcp-server/tools/utils/toolHandlerFactory.js.map +1 -1
- package/dist/mcp-server/transports/http/httpServer.d.ts +22 -0
- package/dist/mcp-server/transports/http/httpServer.d.ts.map +1 -0
- package/dist/mcp-server/transports/http/httpServer.js +121 -0
- package/dist/mcp-server/transports/http/httpServer.js.map +1 -0
- package/dist/mcp-server/transports/http/httpTransport.d.ts +5 -14
- package/dist/mcp-server/transports/http/httpTransport.d.ts.map +1 -1
- package/dist/mcp-server/transports/http/httpTransport.js +15 -114
- package/dist/mcp-server/transports/http/httpTransport.js.map +1 -1
- package/dist/mcp-server/transports/manager.js +1 -1
- package/dist/mcp-server/transports/manager.js.map +1 -1
- package/dist/storage/core/storageValidation.js +2 -2
- package/dist/storage/providers/fileSystem/fileSystemProvider.d.ts.map +1 -1
- package/dist/storage/providers/fileSystem/fileSystemProvider.js +15 -10
- package/dist/storage/providers/fileSystem/fileSystemProvider.js.map +1 -1
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/utils/internal/logger.d.ts.map +1 -1
- package/dist/utils/internal/logger.js +25 -10
- package/dist/utils/internal/logger.js.map +1 -1
- package/dist/utils/internal/runtime.d.ts +18 -2
- package/dist/utils/internal/runtime.d.ts.map +1 -1
- package/dist/utils/internal/runtime.js +18 -3
- package/dist/utils/internal/runtime.js.map +1 -1
- package/dist/utils/network/fetchWithTimeout.d.ts +19 -16
- package/dist/utils/network/fetchWithTimeout.d.ts.map +1 -1
- package/dist/utils/network/fetchWithTimeout.js +66 -32
- package/dist/utils/network/fetchWithTimeout.js.map +1 -1
- package/dist/utils/scheduling/scheduler.js +1 -1
- package/dist/utils/scheduling/scheduler.js.map +1 -1
- package/dist/utils/security/rateLimiter.d.ts.map +1 -1
- package/dist/utils/security/rateLimiter.js +4 -1
- package/dist/utils/security/rateLimiter.js.map +1 -1
- package/dist/utils/telemetry/instrumentation.d.ts.map +1 -1
- package/dist/utils/telemetry/instrumentation.js +10 -7
- package/dist/utils/telemetry/instrumentation.js.map +1 -1
- package/package.json +27 -26
- package/scripts/build-changelog.ts +3 -3
- package/scripts/devcheck.ts +8 -4
- package/skills/add-tool/SKILL.md +17 -1
- package/skills/api-errors/SKILL.md +7 -1
- package/skills/api-linter/SKILL.md +75 -1
- package/skills/api-workers/SKILL.md +15 -1
- package/skills/design-mcp-server/SKILL.md +2 -1
- package/skills/field-test/SKILL.md +2 -1
- package/skills/polish-docs-meta/SKILL.md +2 -2
- package/skills/polish-docs-meta/references/readme.md +1 -1
- package/skills/tool-defs-analysis/SKILL.md +19 -3
- package/templates/AGENTS.md +9 -9
- package/templates/CLAUDE.md +9 -9
- package/templates/changelog/template.md +1 -1
- package/templates/src/index.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rateLimiter.d.ts","sourceRoot":"","sources":["../../../src/utils/security/rateLimiter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,oCAAoC,CAAC;AAchG,0FAA0F;AAC1F,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oEAAoE;IACpE,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,KAAK,MAAM,CAAC;IACxE,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,sGAAsG;IACtG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;C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AAC,GAAG,EAAE,MAAM,GAAG;QAC7B,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,IAAI;IAWR;;;;OAIG;IACI,OAAO,IAAI,IAAI;CAOvB"}
|
|
@@ -250,7 +250,10 @@ export class RateLimiter {
|
|
|
250
250
|
activeSpan?.addEvent('rate_limit_exceeded', {
|
|
251
251
|
'mcp.rate_limit.wait_time_seconds': waitTime,
|
|
252
252
|
});
|
|
253
|
-
|
|
253
|
+
// No `mcp.rate_limit.key` attribute — `limitKey` is caller-supplied and
|
|
254
|
+
// typically per-client, which would materialize an unbounded series in
|
|
255
|
+
// the OTel meter. Per-key attribution lives on the span (line 268).
|
|
256
|
+
getRateLimitMetrics().rejectionCounter.add(1);
|
|
254
257
|
throw rateLimited(errorMessage, {
|
|
255
258
|
waitTimeSeconds: waitTime,
|
|
256
259
|
key: limitKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rateLimiter.js","sourceRoot":"","sources":["../../../src/utils/security/rateLimiter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAuB,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,IAAI,gBAA8D,CAAC;AAEnE,SAAS,mBAAmB;IAC1B,gBAAgB,KAAK,aAAa,CAChC,0BAA0B,EAC1B,uBAAuB,EACvB,cAAc,CACf,CAAC;IACF,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC9B,CAAC;AAED,0FAA0F;AAC1F,MAAM,UAAU,oBAAoB;IAClC,mBAAmB,EAAE,CAAC;AACxB,CAAC;AAkCD;;;;;;;;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I,SAAS,CAAC,GAAW;QAM1B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QACxB,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,KAAK;YACpB,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,WAAW;YACvC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,eAAe,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC;YACtE,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,OAAO;QACZ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACjC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAKvD;;;;;GAKG;AACH,eAAO,IAAI,GAAG,EAAE,OAAO,GAAG,IAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../src/utils/telemetry/instrumentation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAKvD;;;;;GAKG;AACH,eAAO,IAAI,GAAG,EAAE,OAAO,GAAG,IAAW,CAAC;AAmEtC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC,CAsH7D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,qBAAqB,CAAC,SAAS,SAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B3E"}
|
|
@@ -19,12 +19,16 @@ let isOtelInitialized = false;
|
|
|
19
19
|
let initializationPromise = null;
|
|
20
20
|
/**
|
|
21
21
|
* Determines if the NodeSDK can be used in the current runtime.
|
|
22
|
-
* Returns false in Worker/Edge environments
|
|
22
|
+
* Returns false in Worker/Edge environments — Cloudflare Workers with
|
|
23
|
+
* `nodejs_compat` populate `process.versions.node`, so we must explicitly
|
|
24
|
+
* check `isWorkerLike` to avoid the SDK loading `node:perf_hooks` and
|
|
25
|
+
* `node:worker_threads` that the polyfill does not provide.
|
|
23
26
|
* Bun is allowed — auto-instrumentations that rely on Node http hooks silently
|
|
24
27
|
* no-op, but manual spans, custom metrics, and OTLP export all work correctly.
|
|
25
28
|
*/
|
|
26
29
|
function canUseNodeSDK() {
|
|
27
30
|
return (runtimeCaps.isNode &&
|
|
31
|
+
!runtimeCaps.isWorkerLike &&
|
|
28
32
|
typeof process?.versions?.node === 'string' &&
|
|
29
33
|
typeof process.env === 'object');
|
|
30
34
|
}
|
|
@@ -35,13 +39,12 @@ function canUseNodeSDK() {
|
|
|
35
39
|
* @returns Record of cloud-related resource attributes
|
|
36
40
|
*/
|
|
37
41
|
function detectCloudResource() {
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
42
|
+
// cloud.* attrs remain in @opentelemetry/semantic-conventions/incubating, so
|
|
43
|
+
// string literals are kept here. Stable attrs (service.*, deployment.*) are
|
|
44
|
+
// applied at the resource construction site using their typed constants.
|
|
41
45
|
const CLOUD_PROVIDER = 'cloud.provider';
|
|
42
46
|
const CLOUD_PLATFORM = 'cloud.platform';
|
|
43
47
|
const CLOUD_REGION = 'cloud.region';
|
|
44
|
-
const DEPLOYMENT_ENV_NAME = 'deployment.environment.name';
|
|
45
48
|
const attrs = {};
|
|
46
49
|
// Cloudflare Workers
|
|
47
50
|
if (runtimeCaps.isWorkerLike) {
|
|
@@ -64,7 +67,6 @@ function detectCloudResource() {
|
|
|
64
67
|
attrs[CLOUD_REGION] = process.env.GCP_REGION;
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
attrs[DEPLOYMENT_ENV_NAME] = config.environment;
|
|
68
70
|
return attrs;
|
|
69
71
|
}
|
|
70
72
|
/**
|
|
@@ -116,7 +118,7 @@ export async function initializeOpenTelemetry() {
|
|
|
116
118
|
}
|
|
117
119
|
try {
|
|
118
120
|
// Lazy-load Node-specific modules
|
|
119
|
-
const [{ HttpInstrumentation }, { OTLPMetricExporter }, { OTLPTraceExporter }, { PinoInstrumentation }, { resourceFromAttributes }, { PeriodicExportingMetricReader }, { NodeSDK }, { BatchSpanProcessor, TraceIdRatioBasedSampler }, { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION },] = await Promise.all([
|
|
121
|
+
const [{ HttpInstrumentation }, { OTLPMetricExporter }, { OTLPTraceExporter }, { PinoInstrumentation }, { resourceFromAttributes }, { PeriodicExportingMetricReader }, { NodeSDK }, { BatchSpanProcessor, TraceIdRatioBasedSampler }, { ATTR_DEPLOYMENT_ENVIRONMENT_NAME, ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION },] = await Promise.all([
|
|
120
122
|
import('@opentelemetry/instrumentation-http'),
|
|
121
123
|
import('@opentelemetry/exporter-metrics-otlp-http'),
|
|
122
124
|
import('@opentelemetry/exporter-trace-otlp-http'),
|
|
@@ -138,6 +140,7 @@ export async function initializeOpenTelemetry() {
|
|
|
138
140
|
const resource = resourceFromAttributes({
|
|
139
141
|
[ATTR_SERVICE_NAME]: config.openTelemetry.serviceName,
|
|
140
142
|
[ATTR_SERVICE_VERSION]: config.openTelemetry.serviceVersion,
|
|
143
|
+
[ATTR_DEPLOYMENT_ENVIRONMENT_NAME]: config.environment,
|
|
141
144
|
...detectCloudResource(),
|
|
142
145
|
});
|
|
143
146
|
const spanProcessors = [];
|
|
@@ -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
|
|
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;IAC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
|
"description": "Agent-native TypeScript framework for building MCP servers. Declarative definitions with auth, multi-backend storage, OpenTelemetry, and first-class support for Bun/Node/Cloudflare Workers.",
|
|
6
6
|
"main": "dist/core/index.js",
|
|
@@ -154,48 +154,49 @@
|
|
|
154
154
|
"publish-mcp": "mcp-publisher login github -token \"$(security find-generic-password -a \"$USER\" -s mcp-publisher-github-pat -w)\" && mcp-publisher publish"
|
|
155
155
|
},
|
|
156
156
|
"resolutions": {
|
|
157
|
-
"brace-expansion": "
|
|
157
|
+
"brace-expansion": "5.0.6",
|
|
158
|
+
"fast-xml-parser": "5.7.3",
|
|
158
159
|
"flatted": "3.4.2",
|
|
159
160
|
"handlebars": "4.7.9",
|
|
160
161
|
"lodash": "4.18.1",
|
|
161
162
|
"path-to-regexp": "8.4.2",
|
|
162
|
-
"picomatch": "
|
|
163
|
-
"protobufjs": "
|
|
164
|
-
"yaml": "
|
|
163
|
+
"picomatch": "4.0.4",
|
|
164
|
+
"protobufjs": "8.3.0",
|
|
165
|
+
"yaml": "2.9.0"
|
|
165
166
|
},
|
|
166
167
|
"devDependencies": {
|
|
167
|
-
"@biomejs/biome": "2.4.
|
|
168
|
-
"@cloudflare/vitest-pool-workers": "^0.16.
|
|
169
|
-
"@cloudflare/workers-types": "^4.
|
|
168
|
+
"@biomejs/biome": "2.4.15",
|
|
169
|
+
"@cloudflare/vitest-pool-workers": "^0.16.6",
|
|
170
|
+
"@cloudflare/workers-types": "^4.20260515.1",
|
|
170
171
|
"@duckdb/node-api": "^1.5.2-r.1",
|
|
171
172
|
"@hono/otel": "^1.1.2",
|
|
172
|
-
"@opentelemetry/exporter-metrics-otlp-http": "^0.
|
|
173
|
-
"@opentelemetry/exporter-trace-otlp-http": "^0.
|
|
174
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
175
|
-
"@opentelemetry/instrumentation-pino": "^0.
|
|
173
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
174
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.218.0",
|
|
175
|
+
"@opentelemetry/instrumentation-http": "^0.218.0",
|
|
176
|
+
"@opentelemetry/instrumentation-pino": "^0.64.0",
|
|
176
177
|
"@opentelemetry/resources": "^2.7.1",
|
|
177
178
|
"@opentelemetry/sdk-metrics": "^2.7.1",
|
|
178
|
-
"@opentelemetry/sdk-node": "^0.
|
|
179
|
+
"@opentelemetry/sdk-node": "^0.218.0",
|
|
179
180
|
"@opentelemetry/sdk-trace-node": "^2.7.1",
|
|
180
|
-
"@opentelemetry/semantic-conventions": "^1.
|
|
181
|
+
"@opentelemetry/semantic-conventions": "^1.41.1",
|
|
181
182
|
"@supabase/supabase-js": "^2.105.4",
|
|
182
|
-
"@types/bun": "^1.3.
|
|
183
|
+
"@types/bun": "^1.3.14",
|
|
183
184
|
"@types/js-yaml": "^4.0.9",
|
|
184
|
-
"@types/node": "^25.
|
|
185
|
+
"@types/node": "^25.8.0",
|
|
185
186
|
"@types/papaparse": "^5.5.2",
|
|
186
187
|
"@types/sanitize-html": "^2.16.1",
|
|
187
188
|
"@types/validator": "^13.15.10",
|
|
188
|
-
"@vitest/coverage-istanbul": "4.1.
|
|
189
|
-
"@vitest/ui": "4.1.
|
|
190
|
-
"bun-types": "^1.3.
|
|
189
|
+
"@vitest/coverage-istanbul": "4.1.6",
|
|
190
|
+
"@vitest/ui": "4.1.6",
|
|
191
|
+
"bun-types": "^1.3.14",
|
|
191
192
|
"chrono-node": "^2.9.1",
|
|
192
193
|
"clipboardy": "^5.3.1",
|
|
193
194
|
"defuddle": "^0.18.1",
|
|
194
195
|
"depcheck": "^1.4.7",
|
|
195
196
|
"diff": "^9.0.0",
|
|
196
197
|
"execa": "^9.6.1",
|
|
197
|
-
"fast-check": "^4.
|
|
198
|
-
"fast-xml-parser": "
|
|
198
|
+
"fast-check": "^4.8.0",
|
|
199
|
+
"fast-xml-parser": "5.7.3",
|
|
199
200
|
"ignore": "^7.0.5",
|
|
200
201
|
"js-yaml": "^4.1.1",
|
|
201
202
|
"linkedom": "^0.18.12",
|
|
@@ -206,14 +207,14 @@
|
|
|
206
207
|
"pdf-lib": "^1.17.1",
|
|
207
208
|
"pino-pretty": "^13.1.3",
|
|
208
209
|
"repomix": "^1.14.0",
|
|
209
|
-
"sanitize-html": "^2.17.
|
|
210
|
+
"sanitize-html": "^2.17.4",
|
|
210
211
|
"tsc-alias": "^1.8.17",
|
|
211
212
|
"typedoc": "^0.28.19",
|
|
212
213
|
"typescript": "^6.0.3",
|
|
213
214
|
"unpdf": "^1.6.2",
|
|
214
215
|
"validator": "^13.15.35",
|
|
215
|
-
"vite": "8.0.
|
|
216
|
-
"vitest": "^4.1.
|
|
216
|
+
"vite": "8.0.13",
|
|
217
|
+
"vitest": "^4.1.6"
|
|
217
218
|
},
|
|
218
219
|
"keywords": [
|
|
219
220
|
"agent",
|
|
@@ -292,7 +293,7 @@
|
|
|
292
293
|
"chrono-node": "^2.9.0",
|
|
293
294
|
"defuddle": "^0.18.1",
|
|
294
295
|
"diff": "latest",
|
|
295
|
-
"fast-xml-parser": "
|
|
296
|
+
"fast-xml-parser": "5.7.3",
|
|
296
297
|
"js-yaml": "^4.1.1",
|
|
297
298
|
"linkedom": "^0.18.12",
|
|
298
299
|
"node-cron": "^4.2.1",
|
|
@@ -300,7 +301,7 @@
|
|
|
300
301
|
"papaparse": "^5.5.3",
|
|
301
302
|
"partial-json": "^0.1.7",
|
|
302
303
|
"pdf-lib": "^1.17.1",
|
|
303
|
-
"sanitize-html": "^2.17.
|
|
304
|
+
"sanitize-html": "^2.17.4",
|
|
304
305
|
"unpdf": "^1.6.0",
|
|
305
306
|
"validator": "^13.15.35"
|
|
306
307
|
},
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Source of truth: `changelog/<major.minor>.x/<version>.md` — each file opens with
|
|
6
6
|
* YAML frontmatter declaring:
|
|
7
|
-
* • summary (required) — ≤
|
|
7
|
+
* • summary (required) — ≤350-char headline, no markdown, one line
|
|
8
8
|
* • breaking (optional) — `true` flags releases with breaking changes
|
|
9
9
|
* • security (optional) — `true` flags releases with security fixes
|
|
10
10
|
*
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* • --check → exit 1 if CHANGELOG.md differs from what would be generated
|
|
25
25
|
*
|
|
26
26
|
* Missing `summary`: warning (not failure) — the entry renders header-only.
|
|
27
|
-
* Summary >
|
|
27
|
+
* Summary > 350 chars, or malformed `breaking` / `security`: hard error.
|
|
28
28
|
*
|
|
29
29
|
* @module scripts/build-changelog
|
|
30
30
|
*/
|
|
@@ -37,7 +37,7 @@ const CHANGELOG_DIR = resolve('changelog');
|
|
|
37
37
|
const CHANGELOG_PATH = resolve('CHANGELOG.md');
|
|
38
38
|
const EXCLUDED_FILES = new Set(['template.md', 'README.md']);
|
|
39
39
|
const SERIES_PATTERN = /^\d+\.\d+\.x$/;
|
|
40
|
-
const SUMMARY_MAX_LENGTH =
|
|
40
|
+
const SUMMARY_MAX_LENGTH = 350;
|
|
41
41
|
|
|
42
42
|
const HEADER = `# Changelog
|
|
43
43
|
|
package/scripts/devcheck.ts
CHANGED
|
@@ -591,20 +591,24 @@ const ALL_CHECKS: Check[] = [
|
|
|
591
591
|
const output = result.stdout.trim();
|
|
592
592
|
if (result.exitCode !== 0 && !output.includes('|')) return false;
|
|
593
593
|
|
|
594
|
-
// Parse the tabular output.
|
|
595
|
-
//
|
|
594
|
+
// Parse the tabular output. `bun outdated` emits markdown-style rows
|
|
595
|
+
// (`| col1 | col2 | ... |`), so split('|') yields an empty leading cell —
|
|
596
|
+
// package data starts at index [1]. Strip the trailing `(dev|peer|prod|optional)`
|
|
597
|
+
// workspace-type marker so the allowlist takes the bare package name.
|
|
596
598
|
const lines = output.split('\n');
|
|
599
|
+
const stripWorkspaceMarker = (cell: string): string =>
|
|
600
|
+
cell.replace(/\s*\((?:dev|peer|prod|optional)\)$/, '');
|
|
597
601
|
const packageLines = lines.filter((line) => {
|
|
598
602
|
if (!line.includes('|')) return false;
|
|
599
603
|
// Skip table chrome: header row and separator (e.g., "---")
|
|
600
|
-
const firstCell = line.split('|')[
|
|
604
|
+
const firstCell = line.split('|')[1]?.trim() ?? '';
|
|
601
605
|
if (!firstCell || firstCell === 'Package' || /^-+$/.test(firstCell)) return false;
|
|
602
606
|
return true;
|
|
603
607
|
});
|
|
604
608
|
|
|
605
609
|
// Check if every outdated package is in the allowlist
|
|
606
610
|
const unexpected = packageLines.filter((line) => {
|
|
607
|
-
const pkgName = line.split('|')[
|
|
611
|
+
const pkgName = stripWorkspaceMarker(line.split('|')[1]?.trim() ?? '');
|
|
608
612
|
return !OUTDATED_ALLOWLIST.has(pkgName);
|
|
609
613
|
});
|
|
610
614
|
|
package/skills/add-tool/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Scaffold a new MCP tool definition. Use when the user asks to add a tool, create a new tool, or implement a new capability for the server.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "2.
|
|
7
|
+
version: "2.9"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -293,6 +293,21 @@ format: (result) => {
|
|
|
293
293
|
},
|
|
294
294
|
```
|
|
295
295
|
|
|
296
|
+
### Mutator response design
|
|
297
|
+
|
|
298
|
+
Mutators (write/update/delete/append/patch verbs, or `destructiveHint: true`) surface raw pre- and post-mutation observable state — not a synthetic verdict. The server can detect anomalies but can't classify them as problems; only the agent knows whether `file shrunk` is intentional truncation or a bug.
|
|
299
|
+
|
|
300
|
+
```typescript
|
|
301
|
+
output: z.object({
|
|
302
|
+
path: z.string().describe('Resolved target path.'),
|
|
303
|
+
created: z.boolean().describe('True when the operation created a new target.'),
|
|
304
|
+
previousSizeInBytes: z.number().describe('Byte size before the mutation. Zero when created is true.'),
|
|
305
|
+
currentSizeInBytes: z.number().describe('Byte size after the mutation. Equals previous when no-op.'),
|
|
306
|
+
}),
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
The agent reads `created: true, previousSizeInBytes: 0, currentSizeInBytes: 68` and knows: brand new target, the full file content is the body. If that matches intent, fine; if not (typo path, uninitialized periodic note), the agent self-corrects without re-fetching. Anti-pattern: server-side `>=` integrity throws on mutators — the server can't distinguish intentional shrink from bug, so it throws on every shrink, including the deliberate ones.
|
|
310
|
+
|
|
296
311
|
### Sparse upstream data must stay honest
|
|
297
312
|
|
|
298
313
|
When tool output comes from a third-party API, don't overstate certainty. Upstream systems often omit fields entirely; the tool schema and `format()` should preserve that uncertainty instead of collapsing it into fake `false`, `0`, or empty-string facts.
|
|
@@ -514,6 +529,7 @@ Large payloads burn the agent's context window. Default to curated summaries; of
|
|
|
514
529
|
|
|
515
530
|
- [ ] File created at `src/mcp-server/tools/definitions/{{tool-name}}.tool.ts`
|
|
516
531
|
- [ ] All Zod schema fields have `.describe()` annotations
|
|
532
|
+
- [ ] Numeric `output` fields carry units in the field name (`sizeInBytes`, `durationInMs`, `priceInCents`, `latencyInMs`) — `.describe()` may be summarized away or truncated, but the field name persists into the JSON the agent reads. Exempt: dimensionless counts (`totalCount`, `itemCount`), indices (`index`, `position`)
|
|
517
533
|
- [ ] Schemas use only JSON-Schema-serializable types (no `z.custom()`, `z.date()`, `z.transform()`, `z.bigint()`, `z.symbol()`, `z.void()`, `z.map()`, `z.set()`)
|
|
518
534
|
- [ ] JSDoc `@fileoverview` and `@module` header present
|
|
519
535
|
- [ ] Optional nested objects guarded for empty inner values from form-based clients (check `?.field` truthiness, not just object presence)
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
McpError constructor, JsonRpcErrorCode reference, and error handling patterns for `@cyanheads/mcp-ts-core`. Use when looking up error codes, understanding where errors should be thrown vs. caught, or using ErrorHandler.tryCatch in services.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.6"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -161,6 +161,12 @@ throw validationError(message, {
|
|
|
161
161
|
|
|
162
162
|
---
|
|
163
163
|
|
|
164
|
+
## When not to throw
|
|
165
|
+
|
|
166
|
+
Throw when the server has authoritative classification — auth failure, rate limit, schema violation, upstream 5xx, missing required input. Don't throw when "this looks wrong" depends on intent the server can't see. For mutators, surface raw pre- and post-mutation observable state in the response and let the agent decide whether it matches intent — the server can detect that the file shrunk, but only the agent knows whether it was supposed to. Tell: defensive code justified as a free rider on other work — audit it standalone, and it usually doesn't earn its keep.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
164
170
|
## Error Factories (fallback)
|
|
165
171
|
|
|
166
172
|
Use when no contract entry fits — ad-hoc throws, tools without a contract, or service-layer code. Shorter than `new McpError(...)` and self-documenting. All return `McpError` instances and accept an optional `options` parameter for error chaining via `{ cause }`.
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
MCP definition linter rules reference. Use when `bun run lint:mcp`, `bun run devcheck`, or `createApp()` startup reports a lint error or warning (`format-parity`, `schema-is-object`, `name-format`, `server-json-*`, etc.) and you need to understand the rule, its severity, and how to fix it. Every rule ID the linter emits has an entry in this doc.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.3"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -45,6 +45,7 @@ Grouped by family. Jump to any rule ID via its anchor.
|
|
|
45
45
|
|:-------|:------|:--------|
|
|
46
46
|
| Format parity | `format-parity`, `format-parity-threw`, `format-parity-walk-failed` | [Format parity](#format-parity) |
|
|
47
47
|
| Schema | `schema-is-object`, `describe-on-fields`, `schema-serializable` | [Schema rules](#schema-rules) |
|
|
48
|
+
| Portability | `schema-format-portability`, `schema-anyof-needs-type`, `schema-no-discriminator-keyword`, `schema-no-defs`, `schema-dialect-tag` | [Portability rules](#portability-rules) |
|
|
48
49
|
| Names | `name-required`, `name-format`, `name-unique` | [Name rules](#name-rules) |
|
|
49
50
|
| Tools | `description-required`, `handler-required`, `auth-type`, `auth-scope-format`, `annotation-type`, `annotation-coherence`, `meta-ui-type`, `meta-ui-resource-uri-required`, `meta-ui-resource-uri-scheme`, `app-tool-resource-pairing` | [Tool rules](#tool-rules) |
|
|
50
51
|
| Resources | `uri-template-required`, `uri-template-valid`, `resource-name-not-uri`, `template-params-align` | [Resource rules](#resource-rules) |
|
|
@@ -188,6 +189,79 @@ Parse the string to a `Date` inside the handler if you need one.
|
|
|
188
189
|
|
|
189
190
|
---
|
|
190
191
|
|
|
192
|
+
## Portability rules
|
|
193
|
+
|
|
194
|
+
MCP pins JSON Schema 2020-12 as the default dialect (SEP-1613), but LLM vendors accept different *subsets*. A schema that passes `schema-serializable` can still hard-fail at OpenAI's tool validator or silently lose fields at Gemini's API surface. These rules walk the emitted JSON Schema for patterns that break cross-vendor.
|
|
195
|
+
|
|
196
|
+
Three default-on, two opt-in. Promote opt-ins via `MCP_LINT_PORTABILITY=strict` (env) or `validateDefinitions({ portability: 'strict' })` when targeting multi-vendor deployments.
|
|
197
|
+
|
|
198
|
+
| Rule | Severity | Default-on? |
|
|
199
|
+
|:-----|:---------|:------------|
|
|
200
|
+
| `schema-format-portability` | error | yes |
|
|
201
|
+
| `schema-anyof-needs-type` | warning | yes |
|
|
202
|
+
| `schema-no-discriminator-keyword` | warning | yes |
|
|
203
|
+
| `schema-no-defs` | warning | only when `portability: 'strict'` |
|
|
204
|
+
| `schema-dialect-tag` | warning | only when `portability: 'strict'` |
|
|
205
|
+
|
|
206
|
+
### schema-format-portability
|
|
207
|
+
|
|
208
|
+
**Severity:** error
|
|
209
|
+
|
|
210
|
+
Fires when the emitted schema contains a `format` value outside the allowlist. Default = OpenAI's nine: `date-time`, `time`, `date`, `duration`, `email`, `hostname`, `ipv4`, `ipv6`, `uuid` — the strictest commonly-used target. OpenAI's tool validator **hard-rejects** unknown formats: the tool never registers and the model never sees it. Field report: [cyanheads/git-mcp-server#47](https://github.com/cyanheads/git-mcp-server/issues/47) (`gpt-5-codex` rejecting `format: "uri"` from `z.url()`).
|
|
211
|
+
|
|
212
|
+
Zod methods vs. the default allowlist:
|
|
213
|
+
|
|
214
|
+
| Zod call | Emitted format | Allowed? |
|
|
215
|
+
|:---------|:---------------|:---------|
|
|
216
|
+
| `z.email()`, `z.uuid()`, `z.iso.datetime()`, `z.iso.date()` | `email` / `uuid` / `date-time` / `date` | yes |
|
|
217
|
+
| `z.url()` | `uri` | **no — fires** |
|
|
218
|
+
| `z.cuid()`, `z.cuid2()`, `z.ulid()`, `z.nanoid()`, `z.base64()`, `z.jwt()` | various | **no — fires** |
|
|
219
|
+
|
|
220
|
+
**Fix:** drop the format method, move the constraint into `.describe()` text where the model reads it:
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
// Wrong // Right
|
|
224
|
+
homepage: z.url().describe('Homepage') homepage: z.string().describe('Homepage (absolute URL)')
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Override:** widen the allowlist when targeting only vendors that accept the format:
|
|
228
|
+
|
|
229
|
+
```ts
|
|
230
|
+
validateDefinitions({ formatAllowlist: ['email', 'uuid', 'date-time', 'uri'], tools, resources, prompts });
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### schema-anyof-needs-type
|
|
234
|
+
|
|
235
|
+
**Severity:** warning
|
|
236
|
+
|
|
237
|
+
Fires when an `anyOf`/`oneOf` branch lacks a top-level `type`. Gemini rejects with `400: reference to undefined schema`. Triggered by patterns like `z.union([z.object({...}).nullable(), z.object({...})])` — the inner nullable emits a typeless `anyOf`.
|
|
238
|
+
|
|
239
|
+
**Fix:** prefer optionality via required-omission, or use `z.discriminatedUnion` for tagged unions — both emit branches with explicit `type: "object"`.
|
|
240
|
+
|
|
241
|
+
### schema-no-discriminator-keyword
|
|
242
|
+
|
|
243
|
+
**Severity:** warning
|
|
244
|
+
|
|
245
|
+
Fires when a schema carries the OpenAPI `discriminator` keyword. OpenAI silently ignores it; Gemini doesn't recognize it. Zod 4's `z.discriminatedUnion` emits the portable shape (`oneOf` of typed branches with `const`-tagged literals), so this rule mainly catches hand-built schemas attached via `.meta({...})` or third-party-generated JSON Schema.
|
|
246
|
+
|
|
247
|
+
**Fix:** drop the `discriminator` meta — the `const` literals on each branch are how clients tell variants apart.
|
|
248
|
+
|
|
249
|
+
### schema-no-defs
|
|
250
|
+
|
|
251
|
+
**Severity:** warning (only when `portability: 'strict'`)
|
|
252
|
+
|
|
253
|
+
Fires when emitted output contains `$defs` or `$ref`. Gemini rejects these (`400: reference to undefined schema`). Typically caused by reused or recursive types built with `z.lazy(...)`. Opt-in because [SEP-1576](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/1576) (token-bloat mitigation) is moving the community toward more `$defs`.
|
|
254
|
+
|
|
255
|
+
**Fix:** inline the recursive type with bounded depth, or accept the Gemini limitation if you target only Anthropic clients.
|
|
256
|
+
|
|
257
|
+
### schema-dialect-tag
|
|
258
|
+
|
|
259
|
+
**Severity:** warning (only when `portability: 'strict'`)
|
|
260
|
+
|
|
261
|
+
Fires when the top-level schema is missing `$schema`. SEP-1613 makes JSON Schema 2020-12 the default dialect, but explicit tagging (`"$schema": "https://json-schema.org/draft/2020-12/schema"`) is forward-compatible — older SDK clients default to draft-07. Zod 4's `toJSONSchema` always emits `$schema`, so this rule is a no-op for Zod-only servers; it exists as forward-compat for hand-built schemas (see SEP-834).
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
191
265
|
## Name rules
|
|
192
266
|
|
|
193
267
|
### name-required
|
|
@@ -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.4"
|
|
8
8
|
audience: external
|
|
9
9
|
type: reference
|
|
10
10
|
---
|
|
@@ -49,6 +49,7 @@ Fresh scaffolds register definitions directly in the entry point as shown above.
|
|
|
49
49
|
| `resources` | `AnyResourceDefinition[]` | Resource definitions to register |
|
|
50
50
|
| `prompts` | `PromptDefinition[]` | Prompt definitions to register |
|
|
51
51
|
| `extensions` | `Record<string, object>` | SEP-2133 extensions to advertise in server capabilities |
|
|
52
|
+
| `instructions` | `string \| (env: CloudflareBindings) => string` | Server-level orientation forwarded to the model on every `initialize`. Resolver form runs inside `initializeApp(env)` so env-derived text is available (see Workers-specific warnings). Empty string treated as unset. |
|
|
52
53
|
| `setup` | `(core: CoreServices) => void \| Promise<void>` | Runs after core services are ready, during the first request (lazy init inside the fetch handler) |
|
|
53
54
|
| `extraEnvBindings` | `[bindingKey: string, processEnvKey: string][]` | Maps CF string bindings to `process.env` keys |
|
|
54
55
|
| `extraObjectBindings` | `[bindingKey: string, globalKey: string][]` | Maps CF object bindings (KV, R2, D1, AI) to `globalThis` keys |
|
|
@@ -156,6 +157,19 @@ bucket_name = "..."
|
|
|
156
157
|
|
|
157
158
|
## Workers-specific warnings
|
|
158
159
|
|
|
160
|
+
**`instructions` resolver runs after env injection.** When `instructions` is a function, it runs inside `initializeApp(env)` — after `injectEnvVars()` — so env-derived text reaches the model without fighting the Workers module-load lifecycle:
|
|
161
|
+
|
|
162
|
+
```ts
|
|
163
|
+
export default createWorkerHandler({
|
|
164
|
+
tools: [echoTool],
|
|
165
|
+
instructions: (env) =>
|
|
166
|
+
`Region: ${env.ENVIRONMENT ?? 'production'}.` +
|
|
167
|
+
(env.MAINTENANCE_MODE ? ' Read-only mode — writes disabled.' : ''),
|
|
168
|
+
});
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Plain strings work the same as on `createApp`. Type extends `Omit<CreateAppOptions, 'instructions'>`, so this is the only option whose shape differs between Node and Worker entry points.
|
|
172
|
+
|
|
159
173
|
**Lazy env parsing is mandatory.** Cloudflare injects env bindings at request time via `injectEnvVars()`, after all static module imports complete. Never parse `process.env` at module top-level in Workers:
|
|
160
174
|
|
|
161
175
|
```ts
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Design the tool surface, resources, and service layer for a new MCP server. Use when starting a new server, planning a major feature expansion, or when the user describes a domain/API they want to expose via MCP. Produces a design doc at docs/design.md that drives implementation.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "2.
|
|
7
|
+
version: "2.11"
|
|
8
8
|
audience: external
|
|
9
9
|
type: workflow
|
|
10
10
|
---
|
|
@@ -255,6 +255,7 @@ The output schema and `format` function control what the LLM reads back. Design
|
|
|
255
255
|
|
|
256
256
|
**Principles:**
|
|
257
257
|
|
|
258
|
+
- **Server reports what only the server can know; agent decides what only the agent can know.** Schema, scopes, rate limits, and raw observable state belong to the server. Semantic correctness, intent-vs-effect matching, and recovery choice belong to the agent. For mutators, this means surfacing pre/post observable state rather than throwing on synthetic deltas the server can't authoritatively classify — `file shrunk` could be deliberate truncation or a bug; only the agent knows. See `add-tool` skill's **Mutator response design**.
|
|
258
259
|
- **Include IDs and references for chaining.** If the agent might act on a result, return the identifiers it needs for follow-up tool calls.
|
|
259
260
|
- **Curate vs. pass-through depends on domain.** Medical/scientific data — don't trim fields that could alter correctness. CRUD responses — return what the agent needs, not the full API payload. Match fidelity to consequence.
|
|
260
261
|
- **Surface what was done, not just results.** After a write operation, include the post-state so the LLM can chain without an extra round trip.
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Exercise tools, resources, and prompts against a live HTTP server via MCP JSON-RPC over curl. Starts the server, surfaces the catalog, runs real and adversarial inputs, and produces a tight report with concrete findings and numbered follow-up options. Use after adding or modifying definitions, or when the user asks to test, try out, or verify their MCP surface.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "2.
|
|
7
|
+
version: "2.4"
|
|
8
8
|
audience: external
|
|
9
9
|
type: debug
|
|
10
10
|
---
|
|
@@ -244,6 +244,7 @@ Treat any hit as a `ux` finding in the report. The authoring rule lives under *T
|
|
|
244
244
|
| `cursor` / `offset` / `limit` params | Pagination: second page, end-of-list |
|
|
245
245
|
| Tool declared an `errors: [...]` contract | Error contract (tool): trigger ≥1 declared failure mode. Verify `result.structuredContent.error.code` matches the contract entry, `result.structuredContent.error.data.reason` is the declared reason (only present when the handler threw an `McpError` — `ctx.fail` always does, plain `throw new Error(...)` does not), and `content[0].text` is actionable. Reasons declared but unreachable from any input are dead contract entries. |
|
|
246
246
|
| Resource declared an `errors: [...]` contract | Error contract (resource): trigger ≥1 declared failure mode by reading a URI that exercises it. Resources re-throw errors at the JSON-RPC level — verify `error.code` matches the contract entry and `error.data.reason` is the declared reason. (Resources don't use the `result.isError` envelope — they fail the request itself.) |
|
|
247
|
+
| Mutator (write/update/delete/append/patch verbs, or `destructiveHint: true`) | Mutator response observability: run an intentionally-ambiguous input (typo path, wrong ID, already-deleted target). Confirm the response carries enough state (pre/post values, state-change discriminator) for the agent to detect intent-effect divergence without re-fetching. |
|
|
247
248
|
|
|
248
249
|
**Resources.** Happy path, not-found URI, `list` if defined, pagination if used.
|
|
249
250
|
**Prompts.** Happy path, defaults omitted, skim message quality.
|
|
@@ -4,7 +4,7 @@ description: >
|
|
|
4
4
|
Finalize documentation and project metadata for a ship-ready MCP server. Use after implementation is complete, tests pass, and devcheck is clean. Safe to run at any stage — each step checks current state and only acts on what still needs work.
|
|
5
5
|
metadata:
|
|
6
6
|
author: cyanheads
|
|
7
|
-
version: "1.
|
|
7
|
+
version: "1.8"
|
|
8
8
|
audience: external
|
|
9
9
|
type: workflow
|
|
10
10
|
---
|
|
@@ -144,7 +144,7 @@ Per-version file format:
|
|
|
144
144
|
|
|
145
145
|
```markdown
|
|
146
146
|
---
|
|
147
|
-
summary: One-line headline for the rollup index — ≤
|
|
147
|
+
summary: One-line headline for the rollup index — ≤350 chars, no markdown
|
|
148
148
|
breaking: false
|
|
149
149
|
---
|
|
150
150
|
|
|
@@ -347,7 +347,7 @@ Table of environment variables. Include framework vars only if the server uses n
|
|
|
347
347
|
| `MCP_LOG_LEVEL` | Log level (RFC 5424). | `info` |
|
|
348
348
|
| `LOGS_DIR` | Directory for log files (Node.js only). | `<project-root>/logs` |
|
|
349
349
|
| `STORAGE_PROVIDER_TYPE` | Storage backend. | `in-memory` |
|
|
350
|
-
| `OTEL_ENABLED` | Enable OpenTelemetry. | `false` |
|
|
350
|
+
| `OTEL_ENABLED` | Enable [OpenTelemetry instrumentation](https://github.com/cyanheads/mcp-ts-core/tree/main/docs/telemetry) (spans, metrics, completion logs). | `false` |
|
|
351
351
|
|
|
352
352
|
See [`.env.example`](./.env.example) for the full list of optional overrides.
|
|
353
353
|
```
|