mcp-ts-template 2.1.2 → 2.1.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  <h1>mcp-ts-template</h1>
3
3
  <p><b>The definitive, production-grade template for building powerful and scalable Model Context Protocol (MCP) servers with TypeScript, featuring built-in observability (OpenTelemetry), declarative tooling, robust error handling, and a modular, DI-driven architecture.</b></p>
4
4
 
5
- [![Version](https://img.shields.io/badge/Version-2.1.2-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--06--18-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-06-18/changelog.mdx) [![Model Context Protocol](https://img.shields.io/badge/MCP%20SDK-^1.18.2-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![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-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.2.21-blueviolet.svg?style=flat-square)](https://bun.sh/) [![Code Coverage](https://img.shields.io/badge/Coverage-88.52%25-brightgreen.svg?style=flat-square)](./coverage/lcov-report/)
5
+ [![Version](https://img.shields.io/badge/Version-2.1.3-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--06--18-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-06-18/changelog.mdx) [![Model Context Protocol](https://img.shields.io/badge/MCP%20SDK-^1.18.2-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE) [![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-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.2.22-blueviolet.svg?style=flat-square)](https://bun.sh/) [![Code Coverage](https://img.shields.io/badge/Coverage-88.52%25-brightgreen.svg?style=flat-square)](./coverage/lcov-report/)
6
6
 
7
7
  </div>
8
8
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  **`mcp-ts-template`** is more than just a template; it's a feature-rich, production-ready framework for building robust, observable, and secure MCP servers, providing a solid architectural foundation so you can focus entirely on creating powerful tools and resources for AI agents.
12
12
 
13
- This project is designed to be **AI-agent-friendly**, providing an LLM-optimized **[AGENTS.md](./AGENTS.md)** and detailed rules in **[.clinerules/clinerules.md](./.clinerules/clinerules.md)** to ensure your coding agents adhere to best practices from the start.
13
+ This project is designed to be **AI-agent-friendly**, providing an LLM-optimized **[AGENTS.md](./AGENTS.md)** to ensure your coding agents adhere to best practices from the start.
14
14
 
15
15
  ## ✨ Core Features
16
16
 
package/dist/index.js CHANGED
@@ -120718,6 +120718,7 @@ var package_default = {
120718
120718
  "@vitest/coverage-v8": "3.2.4",
120719
120719
  ajv: "^8.17.1",
120720
120720
  "ajv-formats": "^3.0.1",
120721
+ "bun-types": "^1.2.22",
120721
120722
  depcheck: "^1.4.7",
120722
120723
  eslint: "^9.36.0",
120723
120724
  "eslint-import-resolver-typescript": "^4.4.4",
@@ -121616,7 +121617,7 @@ class Logger {
121616
121617
  const { default: path } = await import("path");
121617
121618
  const transports = [];
121618
121619
  const isDevelopment = config.environment === "development";
121619
- const isTest = config.environment === "test";
121620
+ const isTest = config.environment === "testing";
121620
121621
  if (isDevelopment && !isServerless2) {
121621
121622
  try {
121622
121623
  const { createRequire: createRequire2 } = await import("node:module");
@@ -131875,6 +131876,15 @@ function ensureResourceContents(contents, handlerContext, resourceName, uri) {
131875
131876
  uri: uri.href
131876
131877
  });
131877
131878
  }
131879
+ for (const item of contents) {
131880
+ if (typeof item !== "object" || item === null || !("uri" in item)) {
131881
+ throw new McpError(-32603 /* InternalError */, "Invalid content block found in resource formatter output. Each item must be an object with a `uri` property.", {
131882
+ requestId: handlerContext.requestId,
131883
+ resourceName,
131884
+ uri: uri.href
131885
+ });
131886
+ }
131887
+ }
131878
131888
  return contents;
131879
131889
  }
131880
131890
  async function registerResource(server, def) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-ts-template",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "mcpName": "io.github.cyanheads/mcp-ts-template",
5
5
  "description": "The definitive, production-grade template for building powerful and scalable Model Context Protocol (MCP) servers with TypeScript, featuring built-in observability (OpenTelemetry), declarative tooling, robust error handling, and a modular, DI-driven architecture.",
6
6
  "main": "dist/index.js",
@@ -114,6 +114,7 @@
114
114
  "@vitest/coverage-v8": "3.2.4",
115
115
  "ajv": "^8.17.1",
116
116
  "ajv-formats": "^3.0.1",
117
+ "bun-types": "^1.2.22",
117
118
  "depcheck": "^1.4.7",
118
119
  "eslint": "^9.36.0",
119
120
  "eslint-import-resolver-typescript": "^4.4.4",