mcp-ts-template 3.0.1 → 3.0.2

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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +18 -21
  3. package/package.json +1 -1
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.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)
10
+ [![Version](https://img.shields.io/badge/Version-3.0.2-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.1",
144589
+ version: "3.0.2",
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",
@@ -178657,32 +178657,29 @@ function createHttpApp(serverFactory, parentContext) {
178657
178657
  const handleRpc = async () => {
178658
178658
  const server2 = await serverFactory();
178659
178659
  await server2.connect(transport);
178660
- try {
178661
- const response = await transport.handleRequest(c);
178662
- if (response && config2.mcpSessionMode === "stateful") {
178663
- response.headers.set("Mcp-Session-Id", sessionId);
178664
- logger.debug("Added Mcp-Session-Id header to response", {
178665
- ...transportContext,
178666
- sessionId
178667
- });
178668
- }
178669
- if (response) {
178670
- return response;
178671
- }
178672
- return c.body(null, 204);
178673
- } finally {
178674
- await server2.close().catch((closeErr) => {
178675
- logger.debug("Failed to close per-request server", {
178676
- ...transportContext,
178677
- sessionId,
178678
- error: closeErr instanceof Error ? closeErr.message : String(closeErr)
178679
- });
178660
+ const response = await transport.handleRequest(c);
178661
+ if (response && config2.mcpSessionMode === "stateful") {
178662
+ response.headers.set("Mcp-Session-Id", sessionId);
178663
+ logger.debug("Added Mcp-Session-Id header to response", {
178664
+ ...transportContext,
178665
+ sessionId
178680
178666
  });
178681
178667
  }
178668
+ if (response) {
178669
+ return response;
178670
+ }
178671
+ return c.body(null, 204);
178682
178672
  };
178683
178673
  try {
178684
178674
  return await handleRpc();
178685
178675
  } catch (err) {
178676
+ await transport.close?.().catch((closeErr) => {
178677
+ logger.debug("Failed to close transport after error", {
178678
+ ...transportContext,
178679
+ sessionId,
178680
+ error: closeErr instanceof Error ? closeErr.message : String(closeErr)
178681
+ });
178682
+ });
178686
178683
  throw err instanceof Error ? err : new Error(String(err));
178687
178684
  }
178688
178685
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-ts-template",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
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",