mcp-ts-template 3.0.0 → 3.0.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/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-3.0.0-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.27.1-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE)
10
+ [![Version](https://img.shields.io/badge/Version-3.0.1-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.27.1-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE)
11
11
 
12
12
  [![Status](https://img.shields.io/badge/Status-Stable-brightgreen.svg?style=flat-square)](https://github.com/cyanheads/mcp-ts-template/issues) [![TypeScript](https://img.shields.io/badge/TypeScript-^5.9.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/) [![Code Coverage](https://img.shields.io/badge/Coverage-86.30%25-brightgreen.svg?style=flat-square)](./coverage/index.html)
13
13
 
package/dist/index.js CHANGED
@@ -144586,7 +144586,7 @@ config(en_default());
144586
144586
  // package.json
144587
144587
  var package_default = {
144588
144588
  name: "mcp-ts-template",
144589
- version: "3.0.0",
144589
+ version: "3.0.1",
144590
144590
  mcpName: "io.github.cyanheads/mcp-ts-template",
144591
144591
  description: "TypeScript template for MCP servers with declarative tools/resources, pluggable auth, multi-backend storage, OpenTelemetry observability, and Cloudflare Workers support.",
144592
144592
  main: "dist/index.js",
@@ -144889,7 +144889,12 @@ var ConfigSchema = exports_external.object({
144889
144889
  oauthJwksCooldownMs: exports_external.coerce.number().default(300000),
144890
144890
  oauthJwksTimeoutMs: exports_external.coerce.number().default(5000),
144891
144891
  mcpServerResourceIdentifier: exports_external.string().url().optional(),
144892
- devMcpAuthBypass: exports_external.coerce.boolean().default(false),
144892
+ devMcpAuthBypass: exports_external.preprocess((val) => {
144893
+ if (val === undefined || val === null || val === "")
144894
+ return false;
144895
+ const str = String(val).toLowerCase().trim();
144896
+ return str === "true" || str === "1";
144897
+ }, exports_external.boolean()).default(false),
144893
144898
  devMcpClientId: exports_external.string().optional(),
144894
144899
  devMcpScopes: exports_external.array(exports_external.string()).optional(),
144895
144900
  openrouterAppUrl: exports_external.string().default("http://localhost:3000"),
@@ -152566,7 +152571,8 @@ async function fetchWithTimeout(url2, timeoutMs, context, options) {
152566
152571
  fetchInit.redirect = "manual";
152567
152572
  }
152568
152573
  const controller = new AbortController;
152569
- const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
152574
+ const timeoutSentinel = "FETCH_TIMEOUT";
152575
+ const timeoutId = setTimeout(() => controller.abort(timeoutSentinel), timeoutMs);
152570
152576
  if (externalSignal) {
152571
152577
  if (externalSignal.aborted) {
152572
152578
  controller.abort(externalSignal.reason);
@@ -152622,14 +152628,26 @@ async function fetchWithTimeout(url2, timeoutMs, context, options) {
152622
152628
  }
152623
152629
  } catch (error49) {
152624
152630
  if (error49 instanceof Error && (error49.name === "TimeoutError" || error49.name === "AbortError")) {
152625
- logger.error(`${operationDescription} timed out after ${timeoutMs}ms.`, {
152631
+ const isTimeout = error49.name === "TimeoutError" || controller.signal.reason === timeoutSentinel;
152632
+ if (isTimeout) {
152633
+ logger.error(`${operationDescription} timed out after ${timeoutMs}ms.`, {
152634
+ ...context,
152635
+ errorSource: "FetchTimeout"
152636
+ });
152637
+ throw new McpError(-32004 /* Timeout */, `${operationDescription} timed out.`, {
152638
+ requestId: context.requestId,
152639
+ operation: context.operation,
152640
+ errorSource: "FetchTimeout"
152641
+ });
152642
+ }
152643
+ logger.info(`${operationDescription} aborted by caller.`, {
152626
152644
  ...context,
152627
- errorSource: "FetchTimeout"
152645
+ errorSource: "FetchAborted"
152628
152646
  });
152629
- throw new McpError(-32004 /* Timeout */, `${operationDescription} timed out.`, {
152647
+ throw new McpError(-32603 /* InternalError */, `${operationDescription} was aborted.`, {
152630
152648
  requestId: context.requestId,
152631
152649
  operation: context.operation,
152632
- errorSource: "FetchTimeout"
152650
+ errorSource: "FetchAborted"
152633
152651
  });
152634
152652
  }
152635
152653
  const errorMessage = error49 instanceof Error ? error49.message : String(error49);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-ts-template",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "mcpName": "io.github.cyanheads/mcp-ts-template",
5
5
  "description": "TypeScript template for MCP servers with declarative tools/resources, pluggable auth, multi-backend storage, OpenTelemetry observability, and Cloudflare Workers support.",
6
6
  "main": "dist/index.js",