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.
- package/README.md +11 -9
- package/dist/index.js +121822 -73743
- 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>
|
|
4
|
-
<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
|
-
[](./CHANGELOG.md) [](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [](https://modelcontextprotocol.io/) [](./LICENSE) [](https://github.com/cyanheads/mcp-ts-template/issues) [](https://www.typescriptlang.org/) [](https://bun.sh/) [](./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**:
|
|
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/)** -
|
|
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
|
|
89
|
-
|
|
|
90
|
-
| **`echo`**
|
|
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/)** -
|
|
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
|