mcp-ts-template 3.0.1 → 3.0.3

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 +16 -1
  2. package/dist/index.js +23 -24
  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
 
@@ -15,6 +15,8 @@
15
15
 
16
16
  ---
17
17
 
18
+ > **Try it live** — A public demo instance is running at `https://mcp-ts-template.caseyjhand.com/mcp`. Connect any MCP client to test the template's tools and resources without installing anything.
19
+
18
20
  ## Features
19
21
 
20
22
  - Define tools and resources in single, self-contained files. The framework handles registration.
@@ -120,6 +122,19 @@ Add the following to your MCP client configuration file.
120
122
  }
121
123
  ```
122
124
 
125
+ Or connect to the public demo server over HTTP — no installation required:
126
+
127
+ ```json
128
+ {
129
+ "mcpServers": {
130
+ "mcp-ts-template": {
131
+ "type": "streamable-http",
132
+ "url": "https://mcp-ts-template.caseyjhand.com/mcp"
133
+ }
134
+ }
135
+ }
136
+ ```
137
+
123
138
  ### Prerequisites
124
139
 
125
140
  - [Bun v1.2.0](https://bun.sh/) or higher.
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",
@@ -169300,6 +169300,7 @@ var Pe = g.object({ method: g.literal("ui/notifications/host-context-changed"),
169300
169300
  var M6 = g.object({ method: g.literal("ui/update-model-context"), params: g.object({ content: g.array(ContentBlockSchema).optional().describe("Context content blocks (text, image, etc.)."), structuredContent: g.record(g.string(), g.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.") }) });
169301
169301
  var R6 = g.object({ method: g.literal("ui/initialize"), params: g.object({ appInfo: ImplementationSchema.describe("App identification (name and version)."), appCapabilities: XI.describe("Features and capabilities this app provides."), protocolVersion: g.string().describe("Protocol version this app supports.") }) });
169302
169302
  var je = g.object({ protocolVersion: g.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'), hostInfo: ImplementationSchema.describe("Host application identification and version."), hostCapabilities: VI.describe("Features and capabilities provided by the host."), hostContext: Se.describe("Rich context about the host environment.") }).passthrough();
169303
+ var Je = "ui/resourceUri";
169303
169304
  var AI = "text/html;profile=mcp-app";
169304
169305
 
169305
169306
  class h6 extends Protocol {
@@ -171909,7 +171910,7 @@ class TaskManager {
171909
171910
  // src/mcp-server/tools/definitions/template-async-countdown.task-tool.ts
171910
171911
  var TOOL_NAME = "template_async_countdown";
171911
171912
  var TOOL_TITLE = "Async Countdown (Task Demo)";
171912
- var TOOL_DESCRIPTION = "Demonstrates the MCP Tasks API with a countdown timer. The tool returns immediately with a task handle. Poll the task status to track progress, then retrieve the final result when complete.";
171913
+ var TOOL_DESCRIPTION = "Demonstrates the MCP Tasks API with a countdown timer. When the client supports tasks, returns immediately with a task handle for polling. Otherwise, runs synchronously and returns the result directly.";
171913
171914
  var InputSchema = exports_external.object({
171914
171915
  seconds: exports_external.number().int().min(1).max(60).describe("Number of seconds to count down (1-60)"),
171915
171916
  message: exports_external.string().optional().describe("Optional message to include in the final result"),
@@ -172016,7 +172017,7 @@ var asyncCountdownTaskTool = {
172016
172017
  openWorldHint: false
172017
172018
  },
172018
172019
  execution: {
172019
- taskSupport: "required"
172020
+ taskSupport: "optional"
172020
172021
  },
172021
172022
  taskHandlers: {
172022
172023
  createTask: async (args, extra) => {
@@ -172323,7 +172324,8 @@ var dataExplorerAppTool = {
172323
172324
  logic: withToolAuth(["tool:data-explorer:read"], dataExplorerLogic),
172324
172325
  responseFormatter: responseFormatter3,
172325
172326
  _meta: {
172326
- ui: { resourceUri: UI_RESOURCE_URI }
172327
+ ui: { resourceUri: UI_RESOURCE_URI },
172328
+ [Je]: UI_RESOURCE_URI
172327
172329
  }
172328
172330
  };
172329
172331
 
@@ -178657,32 +178659,29 @@ function createHttpApp(serverFactory, parentContext) {
178657
178659
  const handleRpc = async () => {
178658
178660
  const server2 = await serverFactory();
178659
178661
  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
- });
178662
+ const response = await transport.handleRequest(c);
178663
+ if (response && config2.mcpSessionMode === "stateful") {
178664
+ response.headers.set("Mcp-Session-Id", sessionId);
178665
+ logger.debug("Added Mcp-Session-Id header to response", {
178666
+ ...transportContext,
178667
+ sessionId
178680
178668
  });
178681
178669
  }
178670
+ if (response) {
178671
+ return response;
178672
+ }
178673
+ return c.body(null, 204);
178682
178674
  };
178683
178675
  try {
178684
178676
  return await handleRpc();
178685
178677
  } catch (err) {
178678
+ await transport.close?.().catch((closeErr) => {
178679
+ logger.debug("Failed to close transport after error", {
178680
+ ...transportContext,
178681
+ sessionId,
178682
+ error: closeErr instanceof Error ? closeErr.message : String(closeErr)
178683
+ });
178684
+ });
178686
178685
  throw err instanceof Error ? err : new Error(String(err));
178687
178686
  }
178688
178687
  });
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.3",
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",