@cyanheads/mcp-ts-core 0.8.6 → 0.8.8
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 +1 -1
- package/README.md +1 -1
- package/changelog/0.8.x/0.8.7.md +16 -0
- package/changelog/0.8.x/0.8.8.md +11 -0
- package/dist/logs/combined.log +4 -4
- package/dist/logs/error.log +4 -4
- package/dist/storage/core/storageValidation.d.ts.map +1 -1
- package/dist/storage/core/storageValidation.js +7 -1
- package/dist/storage/core/storageValidation.js.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.d.ts.map +1 -1
- package/dist/utils/internal/error-handler/errorHandler.js +2 -1
- package/dist/utils/internal/error-handler/errorHandler.js.map +1 -1
- package/package.json +8 -8
- package/skills/field-test/SKILL.md +24 -17
package/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Agent Protocol
|
|
2
2
|
|
|
3
|
-
**Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.8.
|
|
3
|
+
**Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.8.7
|
|
4
4
|
**npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) · **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
|
|
5
5
|
|
|
6
6
|
> **Developer note:** Never assume. Read related files and docs before making changes. Read full file content for context. Never edit a file before reading it.
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<div align="center">
|
|
7
7
|
|
|
8
|
-
[](./CHANGELOG.md) [](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [](https://modelcontextprotocol.io/) [](./LICENSE)
|
|
9
9
|
|
|
10
10
|
[](https://www.typescriptlang.org/) [](https://bun.sh/)
|
|
11
11
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "Remove `dev` watch script (finishes 0.8.6 dev-vs-prod cleanup); fix field-test helper state collision when concurrent sessions run from different project directories."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.8.7 — 2026-04-29
|
|
7
|
+
|
|
8
|
+
Follow-up to 0.8.6 plus a field-test helper bug fix. The `dev` script was the last watch-mode entry point producing the same dev-vs-prod split 0.8.6 closed for `dev:stdio`/`dev:http`; removing it standardizes every developer and smoke-test path on `bun run rebuild && bun run start:stdio` (or `start:http`).
|
|
9
|
+
|
|
10
|
+
## Removed
|
|
11
|
+
|
|
12
|
+
- **`package.json`** — `dev` script (`bun --watch src/index.ts`). Use `bun run rebuild && bun run start:stdio` (or `start:http`) instead.
|
|
13
|
+
|
|
14
|
+
## Fixed
|
|
15
|
+
|
|
16
|
+
- **`skills/field-test/SKILL.md` v2.2 → v2.3** ([#90](https://github.com/cyanheads/mcp-ts-core/issues/90)) — Helper state and logs lived at fixed `/tmp/mcp-field-test.{env,build.log,server.log,init-*,call-body}` paths. Concurrent field-tests across different project trees silently overwrote each other's state, causing `mcp_call` to route JSON-RPC traffic to the wrong server and return another project's tool output. Helper now namespaces every per-session file under `/tmp/mcp-field-test-<8charPWDhash>` (state file, build log, server log, init/call scratch files), so parallel sessions in different directories no longer collide. Helper file path itself stays singleton (content is identical across projects).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
summary: "ErrorHandler stops double-writing ended OTel spans (recordException/setStatus); storage decodeCursor no longer leaks server stack traces through McpError.data on malformed cursors."
|
|
3
|
+
breaking: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 0.8.8 — 2026-05-01
|
|
7
|
+
|
|
8
|
+
## Fixed
|
|
9
|
+
|
|
10
|
+
- **`src/utils/internal/error-handler/errorHandler.ts`** ([#93](https://github.com/cyanheads/mcp-ts-core/issues/93)) — `handleError` now guards its OTel block with `activeSpan.isRecording()`, eliminating two `Cannot execute the operation on ended Span` warnings per tool failure under HTTP+OTel (`measureToolExecution` already records and ends the span before re-throwing). Same fix covers the prompt path; resource path was already clean (uses `classifyOnly`).
|
|
11
|
+
- **`src/storage/core/storageValidation.ts`** ([#71](https://github.com/cyanheads/mcp-ts-core/issues/71)) — `decodeCursor` no longer attaches `error.stack` to `McpError.data.rawError` — the stack goes to `logger.warning`, the thrown error carries only `operation` + request context. `McpError.data` is wire-visible (`structuredContent.error.data`/JSON-RPC `error.data`), so a forged cursor against `ctx.state.list(...)` previously leaked framework paths and version markers. Mirrors the pattern in `src/utils/pagination/pagination.ts`.
|
package/dist/logs/combined.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{"level":50,"time":
|
|
2
|
-
{"level":50,"time":
|
|
3
|
-
{"level":50,"time":
|
|
4
|
-
{"level":50,"time":
|
|
1
|
+
{"level":50,"time":1777663445975,"env":"testing","version":"0.0.0-test","pid":67824,"requestId":"RYJCX-Q0J4P","timestamp":"2026-05-01T19:24:05.974Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"7fb38561bec888996110493dd39221ce27c410a75d432ef4bbae5359cd40a9b1","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"7fb38561bec888996110493dd39221ce27c410a75d432ef4bbae5359cd40a9b1","toolName":"scoped_echo","requestId":"RYJCX-Q0J4P","timestamp":"2026-05-01T19:24:05.974Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:133:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:168:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
2
|
+
{"level":50,"time":1777663447118,"env":"testing","version":"0.8.8","pid":67830,"requestId":"CAZVI-BHCFP","timestamp":"2026-05-01T19:24:07.117Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"CAZVI-BHCFP","timestamp":"2026-05-01T19:24:07.117Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
|
|
3
|
+
{"level":50,"time":1777663447131,"env":"testing","version":"0.8.8","pid":67830,"requestId":"XCNUP-PVNIZ","timestamp":"2026-05-01T19:24:07.131Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"XCNUP-PVNIZ","timestamp":"2026-05-01T19:24:07.131Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
|
|
4
|
+
{"level":50,"time":1777663447134,"env":"testing","version":"0.8.8","pid":67830,"requestId":"JOERB-K2CUG","timestamp":"2026-05-01T19:24:07.134Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"JOERB-K2CUG","timestamp":"2026-05-01T19:24:07.134Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
|
package/dist/logs/error.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{"level":50,"time":
|
|
2
|
-
{"level":50,"time":
|
|
3
|
-
{"level":50,"time":
|
|
4
|
-
{"level":50,"time":
|
|
1
|
+
{"level":50,"time":1777663445975,"env":"testing","version":"0.0.0-test","pid":67824,"requestId":"RYJCX-Q0J4P","timestamp":"2026-05-01T19:24:05.974Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"7fb38561bec888996110493dd39221ce27c410a75d432ef4bbae5359cd40a9b1","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"7fb38561bec888996110493dd39221ce27c410a75d432ef4bbae5359cd40a9b1","toolName":"scoped_echo","requestId":"RYJCX-Q0J4P","timestamp":"2026-05-01T19:24:05.974Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:133:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:168:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
|
|
2
|
+
{"level":50,"time":1777663447118,"env":"testing","version":"0.8.8","pid":67830,"requestId":"CAZVI-BHCFP","timestamp":"2026-05-01T19:24:07.117Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"CAZVI-BHCFP","timestamp":"2026-05-01T19:24:07.117Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
|
|
3
|
+
{"level":50,"time":1777663447131,"env":"testing","version":"0.8.8","pid":67830,"requestId":"XCNUP-PVNIZ","timestamp":"2026-05-01T19:24:07.131Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"XCNUP-PVNIZ","timestamp":"2026-05-01T19:24:07.131Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
|
|
4
|
+
{"level":50,"time":1777663447134,"env":"testing","version":"0.8.8","pid":67830,"requestId":"JOERB-K2CUG","timestamp":"2026-05-01T19:24:07.134Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"JOERB-K2CUG","timestamp":"2026-05-01T19:24:07.134Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageValidation.d.ts","sourceRoot":"","sources":["../../../src/storage/core/storageValidation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storageValidation.d.ts","sourceRoot":"","sources":["../../../src/storage/core/storageValidation.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA0CzE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAqChF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CA4BtE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAyC5E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,cAAc,GAAG,SAAS,EACnC,OAAO,EAAE,cAAc,GACtB,IAAI,CA2BN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,GAAG,SAAS,EAChC,OAAO,EAAE,cAAc,GACtB,IAAI,CA+DN;AAyCD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKtE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,CAwD9F"}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
22
22
|
import { invalidParams, McpError, validationError } from '../../types-global/errors.js';
|
|
23
23
|
import { base64ToString, stringToBase64 } from '../../utils/internal/encoding.js';
|
|
24
|
+
import { logger } from '../../utils/internal/logger.js';
|
|
24
25
|
/**
|
|
25
26
|
* Per-process HMAC key for cursor integrity. Generated once at module load.
|
|
26
27
|
* Does not need to survive restarts — cursors are ephemeral pagination tokens.
|
|
@@ -363,10 +364,15 @@ export function decodeCursor(cursor, tenantId, context) {
|
|
|
363
364
|
if (error instanceof McpError) {
|
|
364
365
|
throw error;
|
|
365
366
|
}
|
|
367
|
+
// Stack stays in the server log; McpError.data is wire-visible.
|
|
368
|
+
logger.warning('Failed to decode cursor', {
|
|
369
|
+
...context,
|
|
370
|
+
operation: 'decodeCursor',
|
|
371
|
+
error: error instanceof Error ? error.stack : String(error),
|
|
372
|
+
});
|
|
366
373
|
throw invalidParams('Failed to decode cursor. Cursor may be corrupted or invalid.', {
|
|
367
374
|
...context,
|
|
368
375
|
operation: 'decodeCursor',
|
|
369
|
-
rawError: error instanceof Error ? error.stack : String(error),
|
|
370
376
|
});
|
|
371
377
|
}
|
|
372
378
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storageValidation.js","sourceRoot":"","sources":["../../../src/storage/core/storageValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"storageValidation.js","sourceRoot":"","sources":["../../../src/storage/core/storageValidation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIpD;;;GAGG;AACH,MAAM,eAAe,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;AAExC;;;;;;;;;GASG;AACH,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EAAY,MAAM,0BAA0B,CAAC;AActE,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAapE,0FAA0F;AAC1F,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;GAEG;AAEH,qBAAa,YAAY;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;WACW,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB;IAuClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;WACW,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,KAAK;
|
|
1
|
+
{"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../../../src/utils/internal/error-handler/errorHandler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,gBAAgB,EAAY,MAAM,0BAA0B,CAAC;AActE,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAapE,0FAA0F;AAC1F,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;GAEG;AAEH,qBAAa,YAAY;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;WACW,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB;IAuClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;WACW,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,KAAK;IAyI9E;;;;;;;;;;OAUG;WACW,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG;QAC1C,IAAI,EAAE,gBAAgB,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC;IAiBD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;WACW,QAAQ,CAAC,CAAC,SAAS,KAAK,EACpC,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EACxC,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GACxE,CAAC,GAAG,KAAK;IAkBZ;;;;;;;;;;;;;;;;;;OAkBG;WACW,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAwBlE;;;;;;;;;;;;;;;;;;;;;OAqBG;WACiB,QAAQ,CAAC,CAAC,EAC5B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EACxB,OAAO,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,GAC5C,OAAO,CAAC,CAAC,CAAC;CAWd"}
|
|
@@ -117,8 +117,9 @@ export class ErrorHandler {
|
|
|
117
117
|
*/
|
|
118
118
|
static handleError(error, options) {
|
|
119
119
|
// --- OpenTelemetry Integration ---
|
|
120
|
+
// Skip ended/no-op spans — measure*Execution paths already record + end the span before re-throwing.
|
|
120
121
|
const activeSpan = trace.getActiveSpan();
|
|
121
|
-
if (activeSpan) {
|
|
122
|
+
if (activeSpan?.isRecording()) {
|
|
122
123
|
if (error instanceof Error) {
|
|
123
124
|
activeSpan.recordException(error);
|
|
124
125
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../../../src/utils/internal/error-handler/errorHandler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA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WAAW,EAAE,CAAC;YACrB,MAAM,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,WAAW,EAAE;gBACpD,GAAG,OAAO;gBACV,OAAO,EAAE,KAAK;aACf,CAAC,CAAC;YACH,MAAM,OAAO,CAAC;QAChB,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyanheads/mcp-ts-core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.8",
|
|
4
4
|
"mcpName": "io.github.cyanheads/mcp-ts-core",
|
|
5
5
|
"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",
|
|
@@ -121,7 +121,6 @@
|
|
|
121
121
|
"start": "bun ./dist/index.js",
|
|
122
122
|
"start:stdio": "MCP_TRANSPORT_TYPE=stdio bun ./dist/index.js",
|
|
123
123
|
"start:http": "MCP_TRANSPORT_TYPE=http bun ./dist/index.js",
|
|
124
|
-
"dev": "bun --watch src/index.ts",
|
|
125
124
|
"devdocs": "bun run scripts/devdocs.ts",
|
|
126
125
|
"devcheck": "bun run scripts/devcheck.ts",
|
|
127
126
|
"rebuild": "bun run scripts/clean.ts && bun run build",
|
|
@@ -157,11 +156,12 @@
|
|
|
157
156
|
"path-to-regexp": "8.4.2",
|
|
158
157
|
"picomatch": "2.3.2",
|
|
159
158
|
"protobufjs": "7.5.5",
|
|
160
|
-
"yaml": "1.10.3"
|
|
159
|
+
"yaml": "1.10.3",
|
|
160
|
+
"zod": "4.4.1"
|
|
161
161
|
},
|
|
162
162
|
"devDependencies": {
|
|
163
163
|
"@biomejs/biome": "2.4.13",
|
|
164
|
-
"@cloudflare/workers-types": "^4.
|
|
164
|
+
"@cloudflare/workers-types": "^4.20260501.1",
|
|
165
165
|
"@hono/otel": "^1.1.1",
|
|
166
166
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.216.0",
|
|
167
167
|
"@opentelemetry/exporter-trace-otlp-http": "^0.216.0",
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
"pino-pretty": "^13.1.3",
|
|
201
201
|
"repomix": "^1.14.0",
|
|
202
202
|
"sanitize-html": "^2.17.3",
|
|
203
|
-
"tsc-alias": "^1.8.
|
|
203
|
+
"tsc-alias": "^1.8.17",
|
|
204
204
|
"typedoc": "^0.28.19",
|
|
205
205
|
"typescript": "^6.0.3",
|
|
206
206
|
"unpdf": "^1.6.2",
|
|
@@ -258,15 +258,15 @@
|
|
|
258
258
|
},
|
|
259
259
|
"dependencies": {
|
|
260
260
|
"@hono/mcp": "^0.2.5",
|
|
261
|
-
"@hono/node-server": "^2.0.
|
|
261
|
+
"@hono/node-server": "^2.0.1",
|
|
262
262
|
"@modelcontextprotocol/ext-apps": "^1.7.1",
|
|
263
263
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
264
264
|
"@opentelemetry/api": "^1.9.1",
|
|
265
265
|
"dotenv": "^17.4.2",
|
|
266
|
-
"hono": "^4.12.
|
|
266
|
+
"hono": "^4.12.16",
|
|
267
267
|
"jose": "^6.2.3",
|
|
268
268
|
"pino": "^10.3.1",
|
|
269
|
-
"zod": "^4.
|
|
269
|
+
"zod": "^4.4.1"
|
|
270
270
|
},
|
|
271
271
|
"peerDependencies": {
|
|
272
272
|
"@hono/otel": "^1.1.1",
|
|
@@ -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.3"
|
|
8
8
|
audience: external
|
|
9
9
|
type: debug
|
|
10
10
|
---
|
|
@@ -27,7 +27,7 @@ This skill drives an HTTP server because curl + JSON-RPC is the most reliable ha
|
|
|
27
27
|
|
|
28
28
|
### 1. Start the server
|
|
29
29
|
|
|
30
|
-
Write the helper to `/tmp/mcp-field-test.sh` once, then source it in every subsequent Bash call. Helper keeps PID / URL / session id in `/tmp/mcp-field-test
|
|
30
|
+
Write the helper to `/tmp/mcp-field-test.sh` once, then source it in every subsequent Bash call. Helper keeps PID / URL / session id in a per-`$PWD` state file (`/tmp/mcp-field-test-<hash>.env`) so state survives across tool invocations and concurrent field-tests in different project trees don't clobber each other.
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
cat > /tmp/mcp-field-test.sh <<'HELPER_EOF'
|
|
@@ -36,29 +36,36 @@ cat > /tmp/mcp-field-test.sh <<'HELPER_EOF'
|
|
|
36
36
|
# Surfaces failures aggressively — field test is for finding things that fail,
|
|
37
37
|
# so the helper auto-tails logs and prints HTTP status/body on errors instead
|
|
38
38
|
# of swallowing them.
|
|
39
|
-
|
|
39
|
+
#
|
|
40
|
+
# State and log paths are namespaced by an 8-char hash of $PWD so concurrent
|
|
41
|
+
# field-tests across different project trees don't clobber each other (see
|
|
42
|
+
# https://github.com/cyanheads/mcp-ts-core/issues/90).
|
|
43
|
+
PREFIX="/tmp/mcp-field-test-$(printf '%s' "$PWD" | shasum | cut -c1-8)"
|
|
44
|
+
STATE_FILE="${PREFIX}.env"
|
|
45
|
+
BUILD_LOG="${PREFIX}-build.log"
|
|
46
|
+
SERVER_LOG="${PREFIX}-server.log"
|
|
40
47
|
[ -f "$STATE_FILE" ] && . "$STATE_FILE"
|
|
41
48
|
|
|
42
49
|
mcp_start() {
|
|
43
50
|
local dir="${1:-$PWD}"
|
|
44
51
|
echo "building $dir ..."
|
|
45
|
-
if ! (cd "$dir" && bun run rebuild)
|
|
46
|
-
echo "BUILD FAILED — last 30 lines of
|
|
47
|
-
tail -30
|
|
52
|
+
if ! (cd "$dir" && bun run rebuild) >"$BUILD_LOG" 2>&1; then
|
|
53
|
+
echo "BUILD FAILED — last 30 lines of $BUILD_LOG:"
|
|
54
|
+
tail -30 "$BUILD_LOG"
|
|
48
55
|
return 1
|
|
49
56
|
fi
|
|
50
57
|
echo "starting server ..."
|
|
51
|
-
(cd "$dir" && bun run start:http)
|
|
58
|
+
(cd "$dir" && bun run start:http) >"$SERVER_LOG" 2>&1 &
|
|
52
59
|
local pid=$!
|
|
53
60
|
local line=""
|
|
54
61
|
for _ in $(seq 1 40); do
|
|
55
|
-
line=$(grep -Eo 'listening at http://[^" ]+/mcp'
|
|
62
|
+
line=$(grep -Eo 'listening at http://[^" ]+/mcp' "$SERVER_LOG" | head -1)
|
|
56
63
|
[ -n "$line" ] && break
|
|
57
64
|
sleep 0.25
|
|
58
65
|
done
|
|
59
66
|
if [ -z "$line" ]; then
|
|
60
|
-
echo "server failed to start within 10s — last 30 lines of
|
|
61
|
-
tail -30
|
|
67
|
+
echo "server failed to start within 10s — last 30 lines of $SERVER_LOG:"
|
|
68
|
+
tail -30 "$SERVER_LOG"
|
|
62
69
|
kill "$pid" 2>/dev/null
|
|
63
70
|
return 1
|
|
64
71
|
fi
|
|
@@ -75,13 +82,13 @@ EOF
|
|
|
75
82
|
|
|
76
83
|
mcp_init() {
|
|
77
84
|
[ -z "$MCP_URL" ] && { echo "run mcp_start first"; return 1; }
|
|
78
|
-
local hdr="
|
|
79
|
-
local body_file="
|
|
85
|
+
local hdr="${PREFIX}-init-headers.txt"
|
|
86
|
+
local body_file="${PREFIX}-init-body.txt"
|
|
80
87
|
local status
|
|
81
88
|
status=$(curl -sS -D "$hdr" -o "$body_file" -w '%{http_code}' -X POST "$MCP_URL" \
|
|
82
89
|
-H "Content-Type: application/json" \
|
|
83
90
|
-H "Accept: application/json, text/event-stream" \
|
|
84
|
-
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"field-test","version":"2.
|
|
91
|
+
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"field-test","version":"2.3"}}}')
|
|
85
92
|
local sid; sid=$(grep -i '^mcp-session-id:' "$hdr" | awk '{print $2}' | tr -d '\r\n')
|
|
86
93
|
if [ -z "$sid" ]; then
|
|
87
94
|
echo "init failed — HTTP $status, no Mcp-Session-Id header returned"
|
|
@@ -119,7 +126,7 @@ mcp_call() {
|
|
|
119
126
|
else
|
|
120
127
|
body=$(printf '{"jsonrpc":"2.0","id":%d,"method":"%s","params":%s}' "$RANDOM" "$method" "$params")
|
|
121
128
|
fi
|
|
122
|
-
local resp_file="
|
|
129
|
+
local resp_file="${PREFIX}-call-body.txt"
|
|
123
130
|
local status
|
|
124
131
|
status=$(curl -sS -o "$resp_file" -w '%{http_code}' -X POST "$MCP_URL" \
|
|
125
132
|
-H "Content-Type: application/json" \
|
|
@@ -141,11 +148,11 @@ mcp_call() {
|
|
|
141
148
|
|
|
142
149
|
# Tail the server log. Useful when a call surprises you — pino startup banner,
|
|
143
150
|
# definition lint diagnostics, request handler errors, upstream calls, and
|
|
144
|
-
# rate-limit warnings live in
|
|
151
|
+
# rate-limit warnings live in the per-session server log.
|
|
145
152
|
# Usage: mcp_log [N] (default: 50 lines)
|
|
146
153
|
mcp_log() {
|
|
147
154
|
local n="${1:-50}"
|
|
148
|
-
tail -n "$n"
|
|
155
|
+
tail -n "$n" "$SERVER_LOG"
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
mcp_stop() {
|
|
@@ -254,7 +261,7 @@ Use `TaskCreate` — one task per definition. Mark complete as you go. Don't bat
|
|
|
254
261
|
|
|
255
262
|
For each call, capture: input sent, response (trim huge payloads to files), whether `isError: true` appeared, anything surprising (slow response, parity drift, unhelpful text, crash).
|
|
256
263
|
|
|
257
|
-
When a call surprises you — slow, hangs, returns terse output, surfaces an unhelpful error — run `. /tmp/mcp-field-test.sh && mcp_log` to tail the server log. The pino startup banner, request handler errors, upstream API call traces, and rate-limit warnings all land in
|
|
264
|
+
When a call surprises you — slow, hangs, returns terse output, surfaces an unhelpful error — run `. /tmp/mcp-field-test.sh && mcp_log` to tail the server log. The pino startup banner, request handler errors, upstream API call traces, and rate-limit warnings all land in the per-session server log (read via `mcp_log`) rather than coming back through `mcp_call`. Don't guess at runtime behavior from response text alone.
|
|
258
265
|
|
|
259
266
|
**Interpreting responses**
|
|
260
267
|
|