mcp-ts-template 1.1.8 → 1.1.9

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
@@ -3,7 +3,7 @@
3
3
  [![TypeScript](https://img.shields.io/badge/TypeScript-^5.8.3-blue.svg)](https://www.typescriptlang.org/)
4
4
  [![Model Context Protocol SDK](https://img.shields.io/badge/MCP%20SDK-1.11.0-green.svg)](https://github.com/modelcontextprotocol/typescript-sdk)
5
5
  [![MCP Spec Version](https://img.shields.io/badge/MCP%20Spec-2025--03--26-lightgrey.svg)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-03-26/changelog.mdx)
6
- [![Version](https://img.shields.io/badge/Version-1.1.8-blue.svg)](./CHANGELOG.md)
6
+ [![Version](https://img.shields.io/badge/Version-1.1.9-blue.svg)](./CHANGELOG.md)
7
7
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
8
8
  [![Status](https://img.shields.io/badge/Status-Stable-green.svg)](https://github.com/cyanheads/mcp-ts-template/issues)
9
9
  [![GitHub](https://img.shields.io/github/stars/cyanheads/mcp-ts-template?style=social)](https://github.com/cyanheads/mcp-ts-template)
@@ -90,26 +90,26 @@ Get the example server running in minutes:
90
90
 
91
91
  Configure the MCP server's behavior using these environment variables:
92
92
 
93
- | Variable | Description | Default |
94
- | :------------------------ | :-------------------------------------------------------------------------------------------------- | :------------------------------------- |
95
- | `MCP_TRANSPORT_TYPE` | Server transport: `stdio` or `http`. | `stdio` |
96
- | `MCP_HTTP_PORT` | Port for the HTTP server (if `MCP_TRANSPORT_TYPE=http`). | `3010` |
97
- | `MCP_HTTP_HOST` | Host address for the HTTP server (if `MCP_TRANSPORT_TYPE=http`). | `127.0.0.1` |
98
- | `MCP_ALLOWED_ORIGINS` | Comma-separated allowed origins for CORS (if `MCP_TRANSPORT_TYPE=http`). | (none) |
99
- | `MCP_SERVER_NAME` | Optional server name (used in MCP initialization). | (from package.json) |
100
- | `MCP_SERVER_VERSION` | Optional server version (used in MCP initialization). | (from package.json) |
101
- | `MCP_LOG_LEVEL` | Server logging level (`debug`, `info`, `warning`, `error`, etc.). | `info` |
102
- | `NODE_ENV` | Runtime environment (`development`, `production`). | `development` |
103
- | `MCP_AUTH_SECRET_KEY` | **Required for HTTP transport.** Secret key (min 32 chars) for signing/verifying auth tokens (JWT). | (none - **MUST be set in production**) |
104
- | `APP_URL` | URL of the application (used by OpenRouter service for HTTP Referer). | `http://localhost:3000` |
105
- | `APP_NAME` | Name of the application (used by OpenRouter service for X-Title header). | (from package.json or 'MCP TS App') |
106
- | `OPENROUTER_API_KEY` | API key for OpenRouter.ai service. Optional, but service will be unconfigured without it. | (none) |
107
- | `LLM_DEFAULT_MODEL` | Default model to use for LLM calls via OpenRouter. | `openrouter/auto` |
108
- | `LLM_DEFAULT_TEMPERATURE` | Default temperature for LLM calls (0-2). Optional. | (none) |
109
- | `LLM_DEFAULT_TOP_P` | Default top_p for LLM calls (0-1). Optional. | (none) |
110
- | `LLM_DEFAULT_MAX_TOKENS` | Default max_tokens for LLM calls. Optional. | (none) |
111
- | `LLM_DEFAULT_TOP_K` | Default top_k for LLM calls (non-negative integer). Optional. | (none) |
112
- | `LLM_DEFAULT_MIN_P` | Default min_p for LLM calls (0-1). Optional. | (none) |
93
+ | Variable | Description | Default |
94
+ | :------------------------ | :-------------------------------------------------------------------------------------------------- | :----------------------------------------- |
95
+ | `MCP_TRANSPORT_TYPE` | Server transport: `stdio` or `http`. | `stdio` |
96
+ | `MCP_HTTP_PORT` | Port for the HTTP server (if `MCP_TRANSPORT_TYPE=http`). | `3010` |
97
+ | `MCP_HTTP_HOST` | Host address for the HTTP server (if `MCP_TRANSPORT_TYPE=http`). | `127.0.0.1` |
98
+ | `MCP_ALLOWED_ORIGINS` | Comma-separated allowed origins for CORS (if `MCP_TRANSPORT_TYPE=http`). | (none) |
99
+ | `MCP_SERVER_NAME` | Optional server name (used in MCP initialization). | (from package.json) |
100
+ | `MCP_SERVER_VERSION` | Optional server version (used in MCP initialization). | (from package.json) |
101
+ | `MCP_LOG_LEVEL` | Server logging level (`debug`, `info`, `warning`, `error`, etc.). | `info` |
102
+ | `NODE_ENV` | Runtime environment (`development`, `production`). | `development` |
103
+ | `MCP_AUTH_SECRET_KEY` | **Required for HTTP transport.** Secret key (min 32 chars) for signing/verifying auth tokens (JWT). | (none - **MUST be set in production**) |
104
+ | `OPENROUTER_APP_URL` | URL of the application (used by OpenRouter service for HTTP Referer). | `https://caseyjhand.com` |
105
+ | `OPENROUTER_APP_NAME` | Name of the application (used by OpenRouter service for X-Title header). | 'mcp-ts-template' |
106
+ | `OPENROUTER_API_KEY` | API key for OpenRouter.ai service. Optional, but service will be unconfigured without it. | (none) |
107
+ | `LLM_DEFAULT_MODEL` | Default model to use for LLM calls via OpenRouter. | `google/gemini-2.5-flash-preview:thinking` |
108
+ | `LLM_DEFAULT_TEMPERATURE` | Default temperature for LLM calls (0-2). Optional. | (none) |
109
+ | `LLM_DEFAULT_TOP_P` | Default top_p for LLM calls (0-1). Optional. | (none) |
110
+ | `LLM_DEFAULT_MAX_TOKENS` | Default max_tokens for LLM calls. Optional. | (none) |
111
+ | `LLM_DEFAULT_TOP_K` | Default top_k for LLM calls (non-negative integer). Optional. | (none) |
112
+ | `LLM_DEFAULT_MIN_P` | Default min_p for LLM calls (0-1). Optional. | (none) |
113
113
 
114
114
  **Note on HTTP Port Retries:** If the `MCP_HTTP_PORT` is busy, the server automatically tries the next port (up to 15 times).
115
115
 
@@ -58,8 +58,8 @@ export declare const config: {
58
58
  * Default: undefined (Auth middleware should throw error if not set in production)
59
59
  */
60
60
  mcpAuthSecretKey: string | undefined;
61
- appUrl: string;
62
- appName: string;
61
+ openrouterAppUrl: string;
62
+ openrouterAppName: string;
63
63
  openrouterApiKey: string | undefined;
64
64
  llmDefaultModel: string;
65
65
  llmDefaultTemperature: number | undefined;
@@ -33,10 +33,10 @@ const EnvSchema = z.object({
33
33
  MCP_ALLOWED_ORIGINS: z.string().optional(), // Comma-separated string
34
34
  MCP_AUTH_SECRET_KEY: z.string().min(32, "MCP_AUTH_SECRET_KEY must be at least 32 characters long for security").optional(), // Secret for signing/verifying tokens
35
35
  // OpenRouter and LLM specific configurations
36
- APP_URL: z.string().url("APP_URL must be a valid URL").optional(),
37
- APP_NAME: z.string().optional(),
36
+ OPENROUTER_APP_URL: z.string().url("OPENROUTER_APP_URL must be a valid URL").optional(),
37
+ OPENROUTER_APP_NAME: z.string().optional(),
38
38
  OPENROUTER_API_KEY: z.string().optional(),
39
- LLM_DEFAULT_MODEL: z.string().default('openrouter/auto'),
39
+ LLM_DEFAULT_MODEL: z.string().default('google/gemini-2.5-flash-preview:thinking'),
40
40
  LLM_DEFAULT_TEMPERATURE: z.coerce.number().min(0).max(2).optional(),
41
41
  LLM_DEFAULT_TOP_P: z.coerce.number().min(0).max(1).optional(),
42
42
  LLM_DEFAULT_MAX_TOKENS: z.coerce.number().int().positive().optional(),
@@ -116,8 +116,8 @@ export const config = {
116
116
  */
117
117
  mcpAuthSecretKey: env.MCP_AUTH_SECRET_KEY,
118
118
  // OpenRouter and LLM specific properties
119
- appUrl: env.APP_URL || 'http://localhost:3000', // Default if not set
120
- appName: env.APP_NAME || pkg.name || 'MCP TS App', // Default if not set
119
+ openrouterAppUrl: env.OPENROUTER_APP_URL || 'http://localhost:3000', // Default if not set
120
+ openrouterAppName: env.OPENROUTER_APP_NAME || pkg.name || 'MCP TS App', // Default if not set
121
121
  openrouterApiKey: env.OPENROUTER_API_KEY, // No default, service handles if missing
122
122
  llmDefaultModel: env.LLM_DEFAULT_MODEL,
123
123
  llmDefaultTemperature: env.LLM_DEFAULT_TEMPERATURE,
@@ -6,8 +6,8 @@ import { logger } from '../utils/internal/logger.js';
6
6
  import { sanitization } from '../utils/security/sanitization.js';
7
7
  import { rateLimiter } from '../utils/security/rateLimiter.js';
8
8
  // Use the updated config properties
9
- const YOUR_SITE_URL = config.appUrl;
10
- const YOUR_SITE_NAME = config.appName;
9
+ const YOUR_SITE_URL = config.openrouterAppUrl;
10
+ const YOUR_SITE_NAME = config.openrouterAppName;
11
11
  /**
12
12
  * Service class for interacting with the OpenRouter API using the OpenAI SDK compatibility.
13
13
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-ts-template",
3
- "version": "1.1.8",
3
+ "version": "1.1.9",
4
4
  "description": "TypeScript template for building Model Context Protocol (MCP) servers & clients. Features production-ready utilities, stdio/HTTP transports (with JWT auth), examples, and type safety. Ideal starting point for creating MCP-based applications.",
5
5
  "main": "dist/index.js",
6
6
  "files": [