mcp-ts-template 2.6.0 → 2.9.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 +11 -9
  2. package/dist/index.js +121822 -73743
  3. package/package.json +55 -51
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  <div align="center">
2
2
  <h1>mcp-ts-template</h1>
3
- <p><b>Production-grade TypeScript template for building Model Context Protocol (MCP) servers. Ships with declarative tools/resources, robust error handling, DI, easy auth, optional OpenTelemetry, and first-class support for both local and edge (Cloudflare Workers) runtimes.</b>
4
- <div>6 Tools • 1 Resource • 1 Prompt</div>
3
+ <p><b>TypeScript template for building Model Context Protocol (MCP) servers. Ships with declarative tools/resources, pluggable auth, multi-backend storage, OpenTelemetry observability, and first-class support for both local and edge (Cloudflare Workers) runtimes.</b>
4
+ <div>7 Tools • 2 Resources • 1 Prompt</div>
5
5
  </p>
6
6
  </div>
7
7
 
8
8
  <div align="center">
9
9
 
10
- [![Version](https://img.shields.io/badge/Version-2.6.0-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) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.24.3-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.3-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-76.12%25-brightgreen.svg?style=flat-square)](./coverage/index.html)
10
+ [![Version](https://img.shields.io/badge/Version-2.9.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.26.0-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.3-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-86.30%25-brightgreen.svg?style=flat-square)](./coverage/index.html)
11
11
 
12
12
  </div>
13
13
 
@@ -22,7 +22,7 @@
22
22
  - **Abstracted Storage**: Swap storage backends (`in-memory`, `filesystem`, `Supabase`, `SurrealDB`, `Cloudflare D1/KV/R2`) without changing business logic. Features secure opaque cursor pagination, parallel batch operations, and comprehensive validation.
23
23
  - **Graph Database Operations**: Optional graph service for relationship management, graph traversals, and pathfinding algorithms (SurrealDB provider).
24
24
  - **Full-Stack Observability**: Get deep insights with structured logging (Pino) and optional, auto-instrumented OpenTelemetry for traces and metrics.
25
- - **Dependency Injection**: Built with `tsyringe` for a clean, decoupled, and testable architecture.
25
+ - **Dependency Injection**: Custom typed DI container with `Token<T>` phantom branding zero external dependencies, fully type-safe resolution.
26
26
  - **Service Integrations**: Pluggable services for external APIs, including LLM providers (OpenRouter), text-to-speech (ElevenLabs), and graph operations (SurrealDB).
27
27
  - **Rich Built-in Utility Suite**: Helpers for parsing (PDF, YAML, CSV, frontmatter), formatting (diffs, tables, trees, markdown), scheduling, security, and more.
28
28
  - **Edge-Ready**: Write code once and run it seamlessly on your local machine or at the edge on Cloudflare Workers.
@@ -61,7 +61,7 @@ This template follows a modular, domain-driven architecture with clear separatio
61
61
  **Key Modules:**
62
62
 
63
63
  - **[MCP Server](src/mcp-server/)** - Tools, resources, prompts, and transport layer implementations
64
- - **[Container](src/container/)** - Dependency injection setup with tsyringe for clean architecture
64
+ - **[Container](src/container/)** - Typed dependency injection container with zero external dependencies
65
65
  - **[Services](src/services/)** - External service integrations (LLM, Speech, Graph) with pluggable providers
66
66
  - **[Storage](src/storage/)** - Abstracted persistence layer with multiple backend support
67
67
  - **[Utilities](src/utils/)** - Cross-cutting concerns (logging, security, parsing, telemetry)
@@ -82,12 +82,14 @@ This template includes working examples to get you started.
82
82
  | **`template_code_review_sampling`** | Uses the LLM service to perform a simulated code review. |
83
83
  | **`template_image_test`** | Returns a test image as a base64-encoded data URI. |
84
84
  | **`template_async_countdown`** | Demonstrates MCP Tasks API with an async countdown timer (experimental). |
85
+ | **`template_data_explorer`** | Generates sample sales data with an interactive explorer UI (MCP Apps). |
85
86
 
86
87
  ### Resources
87
88
 
88
- | Resource | URI | Description |
89
- | :--------- | :----------------- | :-------------------------------------------- |
90
- | **`echo`** | `echo://{message}` | A simple resource that echoes back a message. |
89
+ | Resource | URI | Description |
90
+ | :--------------------- | :------------------------------------- | :---------------------------------------------------------- |
91
+ | **`echo`** | `echo://{message}` | A simple resource that echoes back a message. |
92
+ | **`data-explorer-ui`** | `ui://template-data-explorer/app.html` | Interactive HTML app for the data explorer tool (MCP Apps). |
91
93
 
92
94
  ### Prompts
93
95
 
@@ -262,7 +264,7 @@ Each major module includes comprehensive documentation with architecture diagram
262
264
  - SDK context and client interaction
263
265
  - Response formatting and error handling
264
266
 
265
- - **[Container Guide](src/container/)** - Dependency injection with tsyringe
267
+ - **[Container Guide](src/container/)** - Typed dependency injection container
266
268
  - Understanding DI tokens and registration
267
269
  - Service lifetimes (singleton, transient, instance)
268
270
  - Constructor injection patterns