mcp-ts-template 2.5.0 → 2.5.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 +28 -28
  2. package/dist/index.js +64318 -4101
  3. package/package.json +11 -10
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-2.5.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.20.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) [![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.23-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.5.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) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.20.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) [![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.23-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)
11
11
 
12
12
  </div>
13
13
 
@@ -19,7 +19,7 @@
19
19
  - **Elicitation Support**: Tools can interactively prompt the user for missing parameters during execution, streamlining user workflows.
20
20
  - **Robust Error Handling**: A unified `McpError` system ensures consistent, structured error responses across the server.
21
21
  - **Pluggable Authentication**: Secure your server with zero-fuss support for `none`, `jwt`, or `oauth` modes.
22
- - **Abstracted Storage**: Swap storage backends (`in-memory`, `filesystem`, `Supabase`, `SurrealDB`, `Cloudflare KV/R2`) without changing business logic. Features secure opaque cursor pagination, parallel batch operations, and comprehensive validation.
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
25
  - **Dependency Injection**: Built with `tsyringe` for a clean, decoupled, and testable architecture.
@@ -33,13 +33,13 @@ This template follows a modular, domain-driven architecture with clear separatio
33
33
 
34
34
  ```
35
35
  ┌─────────────────────────────────────────────────────────┐
36
- │ MCP Client (Claude Code, ChatGPT, etc.)
36
+ │ MCP Client (Claude Code, ChatGPT, etc.)
37
37
  └────────────────────┬────────────────────────────────────┘
38
38
  │ JSON-RPC 2.0
39
39
 
40
40
  ┌─────────────────────────────────────────────────────────┐
41
41
  │ MCP Server (Tools, Resources) │
42
- 📖 [MCP Server Guide](src/mcp-server/)
42
+ 📖 [MCP Server Guide](src/mcp-server/)
43
43
  └────────────────────┬────────────────────────────────────┘
44
44
  │ Dependency Injection
45
45
 
@@ -50,10 +50,10 @@ This template follows a modular, domain-driven architecture with clear separatio
50
50
 
51
51
  ┌────────────┼────────────┐
52
52
  ▼ ▼ ▼
53
- ┌──────────┐ ┌──────────┐ ┌──────────┐
54
- │ Services │ │ Storage │ │ Utilities│
55
- │ 🔌 [→] │ │ 💾 [→] │ │ 🛠️ [→] │
56
- └──────────┘ └──────────┘ └──────────┘
53
+ ┌──────────┐ ┌──────────┐ ┌──────────┐
54
+ │ Services │ │ Storage │ │ Utilities│
55
+ │ 🔌 [→] │ │ 💾 [→] │ │ 🛠️ [→] │
56
+ └──────────┘ └──────────┘ └──────────┘
57
57
 
58
58
  [→]: src/services/ [→]: src/storage/ [→]: src/utils/
59
59
  ```
@@ -146,26 +146,26 @@ bun install
146
146
 
147
147
  All configuration is centralized and validated at startup in `src/config/index.ts`. Key environment variables in your `.env` file include:
148
148
 
149
- | Variable | Description | Default |
150
- | :-------------------------- | :------------------------------------------------------------------------------------------------ | :---------- |
151
- | `MCP_TRANSPORT_TYPE` | The transport to use: `stdio` or `http`. | `http` |
152
- | `MCP_HTTP_PORT` | The port for the HTTP server. | `3010` |
153
- | `MCP_HTTP_HOST` | The hostname for the HTTP server. | `127.0.0.1` |
154
- | `MCP_AUTH_MODE` | Authentication mode: `none`, `jwt`, or `oauth`. | `none` |
155
- | `MCP_AUTH_SECRET_KEY` | **Required for `jwt` auth mode.** A 32+ character secret. | `(none)` |
156
- | `OAUTH_ISSUER_URL` | **Required for `oauth` auth mode.** URL of the OIDC provider. | `(none)` |
157
- | `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `surrealdb`, `cloudflare-kv`, `r2`. | `in-memory` |
158
- | `STORAGE_FILESYSTEM_PATH` | **Required for `filesystem` storage.** Path to the storage directory. | `(none)` |
159
- | `SUPABASE_URL` | **Required for `supabase` storage.** Your Supabase project URL. | `(none)` |
160
- | `SUPABASE_SERVICE_ROLE_KEY` | **Required for `supabase` storage.** Your Supabase service role key. | `(none)` |
161
- | `SURREALDB_URL` | **Required for `surrealdb` storage.** SurrealDB endpoint (e.g., `wss://cloud.surrealdb.com/rpc`). | `(none)` |
162
- | `SURREALDB_NAMESPACE` | **Required for `surrealdb` storage.** SurrealDB namespace. | `(none)` |
163
- | `SURREALDB_DATABASE` | **Required for `surrealdb` storage.** SurrealDB database name. | `(none)` |
164
- | `SURREALDB_USERNAME` | **Optional for `surrealdb` storage.** Database username for authentication. | `(none)` |
165
- | `SURREALDB_PASSWORD` | **Optional for `surrealdb` storage.** Database password for authentication. | `(none)` |
166
- | `OTEL_ENABLED` | Set to `true` to enable OpenTelemetry. | `false` |
167
- | `LOG_LEVEL` | The minimum level for logging (`debug`, `info`, `warn`, `error`). | `info` |
168
- | `OPENROUTER_API_KEY` | API key for OpenRouter LLM service. | `(none)` |
149
+ | Variable | Description | Default |
150
+ | :-------------------------- | :---------------------------------------------------------------------------------------------------------------------- | :---------- |
151
+ | `MCP_TRANSPORT_TYPE` | The transport to use: `stdio` or `http`. | `http` |
152
+ | `MCP_HTTP_PORT` | The port for the HTTP server. | `3010` |
153
+ | `MCP_HTTP_HOST` | The hostname for the HTTP server. | `127.0.0.1` |
154
+ | `MCP_AUTH_MODE` | Authentication mode: `none`, `jwt`, or `oauth`. | `none` |
155
+ | `MCP_AUTH_SECRET_KEY` | **Required for `jwt` auth mode.** A 32+ character secret. | `(none)` |
156
+ | `OAUTH_ISSUER_URL` | **Required for `oauth` auth mode.** URL of the OIDC provider. | `(none)` |
157
+ | `STORAGE_PROVIDER_TYPE` | Storage backend: `in-memory`, `filesystem`, `supabase`, `surrealdb`, `cloudflare-d1`, `cloudflare-kv`, `cloudflare-r2`. | `in-memory` |
158
+ | `STORAGE_FILESYSTEM_PATH` | **Required for `filesystem` storage.** Path to the storage directory. | `(none)` |
159
+ | `SUPABASE_URL` | **Required for `supabase` storage.** Your Supabase project URL. | `(none)` |
160
+ | `SUPABASE_SERVICE_ROLE_KEY` | **Required for `supabase` storage.** Your Supabase service role key. | `(none)` |
161
+ | `SURREALDB_URL` | **Required for `surrealdb` storage.** SurrealDB endpoint (e.g., `wss://cloud.surrealdb.com/rpc`). | `(none)` |
162
+ | `SURREALDB_NAMESPACE` | **Required for `surrealdb` storage.** SurrealDB namespace. | `(none)` |
163
+ | `SURREALDB_DATABASE` | **Required for `surrealdb` storage.** SurrealDB database name. | `(none)` |
164
+ | `SURREALDB_USERNAME` | **Optional for `surrealdb` storage.** Database username for authentication. | `(none)` |
165
+ | `SURREALDB_PASSWORD` | **Optional for `surrealdb` storage.** Database password for authentication. | `(none)` |
166
+ | `OTEL_ENABLED` | Set to `true` to enable OpenTelemetry. | `false` |
167
+ | `LOG_LEVEL` | The minimum level for logging (`debug`, `info`, `warn`, `error`). | `info` |
168
+ | `OPENROUTER_API_KEY` | API key for OpenRouter LLM service. | `(none)` |
169
169
 
170
170
  ### Authentication & Authorization
171
171