mcp-server-framework 1.0.0 → 1.0.1
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/CHANGELOG.md +39 -0
- package/build/config/env.d.ts +11 -10
- package/build/config/env.d.ts.map +1 -1
- package/build/config/env.js +29 -17
- package/build/config/env.js.map +1 -1
- package/build/config/file/loader.js +1 -1
- package/build/config/file/schema.d.ts +18 -18
- package/build/config/file/schema.d.ts.map +1 -1
- package/build/config/file/schema.js +10 -10
- package/build/config/file/schema.js.map +1 -1
- package/build/errors/categories/validation.js +6 -6
- package/build/errors/categories/validation.js.map +1 -1
- package/build/errors/factory.d.ts +1 -1
- package/build/errors/factory.d.ts.map +1 -1
- package/build/errors/factory.js +1 -1
- package/build/errors/factory.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/logger/formatters/text-formatter.d.ts +4 -3
- package/build/logger/formatters/text-formatter.d.ts.map +1 -1
- package/build/logger/formatters/text-formatter.js +4 -3
- package/build/logger/formatters/text-formatter.js.map +1 -1
- package/build/server/builder/server-builder.js +1 -1
- package/build/server/builder/server-builder.js.map +1 -1
- package/build/server/create-server.d.ts.map +1 -1
- package/build/server/create-server.js +30 -1
- package/build/server/create-server.js.map +1 -1
- package/build/server/middleware/rate-limit.d.ts.map +1 -1
- package/build/server/middleware/rate-limit.js +3 -2
- package/build/server/middleware/rate-limit.js.map +1 -1
- package/build/server/option-overrides.js +1 -1
- package/build/server/option-overrides.js.map +1 -1
- package/build/server/routes/health.d.ts.map +1 -1
- package/build/server/routes/health.js +2 -14
- package/build/server/routes/health.js.map +1 -1
- package/build/server/server-instance.d.ts.map +1 -1
- package/build/server/server-instance.js +4 -8
- package/build/server/server-instance.js.map +1 -1
- package/build/server/server-options.d.ts +6 -4
- package/build/server/server-options.d.ts.map +1 -1
- package/build/server/session/in-memory-store.d.ts.map +1 -1
- package/build/server/session/in-memory-store.js +2 -7
- package/build/server/session/in-memory-store.js.map +1 -1
- package/build/server/session/mcp-session.d.ts.map +1 -1
- package/build/server/session/mcp-session.js +10 -5
- package/build/server/session/mcp-session.js.map +1 -1
- package/build/server/session/session-factory.js +1 -1
- package/build/server/session/session-manager.d.ts +1 -1
- package/build/server/session/session-manager.d.ts.map +1 -1
- package/build/server/session/session-manager.js +15 -12
- package/build/server/session/session-manager.js.map +1 -1
- package/build/server/transport/sse/handler.js +1 -1
- package/build/server/transport/sse/handler.js.map +1 -1
- package/build/server/transport/streamable-http/stateful-handler.d.ts.map +1 -1
- package/build/server/transport/streamable-http/stateful-handler.js +21 -19
- package/build/server/transport/streamable-http/stateful-handler.js.map +1 -1
- package/build/server/types.d.ts +9 -6
- package/build/server/types.d.ts.map +1 -1
- package/build/telemetry/core/constants.d.ts +6 -4
- package/build/telemetry/core/constants.d.ts.map +1 -1
- package/build/telemetry/core/constants.js +6 -4
- package/build/telemetry/core/constants.js.map +1 -1
- package/build/telemetry/core/types.d.ts +1 -1
- package/build/telemetry/core/types.d.ts.map +1 -1
- package/build/telemetry/sdk.d.ts.map +1 -1
- package/build/telemetry/sdk.js +30 -6
- package/build/telemetry/sdk.js.map +1 -1
- package/build/utils/index.d.ts +2 -2
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +2 -2
- package/build/utils/index.js.map +1 -1
- package/build/utils/string-helpers.d.ts +69 -0
- package/build/utils/string-helpers.d.ts.map +1 -1
- package/build/utils/string-helpers.js +116 -0
- package/build/utils/string-helpers.js.map +1 -1
- package/build/utils/zod-helpers.d.ts +18 -0
- package/build/utils/zod-helpers.d.ts.map +1 -1
- package/build/utils/zod-helpers.js +27 -1
- package/build/utils/zod-helpers.js.map +1 -1
- package/package.json +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## [1.0.1] - fix: session lifecycle, logging, config & OTEL improvements
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `parseDuration()` utility for parsing human-readable durations (`"15m"`, `"1.5h"`, `"500ms"`, `"2d"`, `"1w"`) into milliseconds — analogous to `parseByteSize()`
|
|
17
|
+
- `formatDuration()` utility for converting milliseconds to human-readable durations (`"15m"`, `"1h 30m"`, `"2d"`) — inverse of `parseDuration()`
|
|
18
|
+
- `durationSchema()` Zod helper for duration environment variables with human-readable defaults — analogous to `byteSizeSchema()`
|
|
19
|
+
- `DURATION_REGEX` pattern for validating duration strings in config file schemas
|
|
20
|
+
- Export `interpolate()` and `MessageParams` type from the main barrel (`mcp-server-framework`) for consumer use
|
|
21
|
+
- `ignoreOutgoingRequestHook` on `HttpInstrumentation` to prevent recursive instrumentation of outgoing OTLP export HTTP calls — eliminates ECONNREFUSED feedback loop when no collector is running
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **BREAKING**: Rename `MCP_CONFIG_FILE` environment variable to `MCP_CONFIG_FILE_PATH` for clarity
|
|
26
|
+
- **TextFormatter defaults**: `includeTimestamp` and `includeComponent` now default to `false`, matching the framework's env schema defaults (`LOG_TIMESTAMP=false`, `LOG_COMPONENT=false`). Previously the TextFormatter itself defaulted to `true`, causing timestamps and component tags to appear in early startup logs before `applyLoggerConfig()` runs
|
|
27
|
+
- **OTEL DiagLogLevel default**: Changed from `INFO` to `WARN` to reduce baseline OTEL SDK diagnostic noise. Users can opt in to verbose output via `OTEL_LOG_LEVEL=DEBUG`
|
|
28
|
+
- **Optional transport config**: `CreateServerOptions.transport` and `ServerOptions.transport` are now optional — when omitted, transport mode is resolved from the config cascade (`MCP_TRANSPORT`, `MCP_TLS_CERT_PATH`, `MCP_TLS_KEY_PATH`). Host and port continue to flow through `MCP_BIND_HOST` and `MCP_PORT`
|
|
29
|
+
- **OTEL init message**: Now shows active exporter types (`traces`, `metrics`); OTLP endpoint is only displayed when an OTLP exporter is actually configured. Removed duplicate `Starting transport` and redundant `OpenTelemetry initialized` DEBUG log lines. `Server started` promoted from DEBUG to INFO
|
|
30
|
+
- Config file field `security.rate_limit_window_ms` renamed to `security.rate_limit_window` — now accepts both numeric milliseconds and human-readable durations (e.g. `"15m"`)
|
|
31
|
+
- Config file field `telemetry.metric_export_interval` now accepts both numeric milliseconds and human-readable durations (e.g. `"60s"`)
|
|
32
|
+
- `MCP_RATE_LIMIT_WINDOW_MS` env var now accepts human-readable durations (e.g. `"15m"`) in addition to plain millisecond counts
|
|
33
|
+
- `OTEL_METRIC_EXPORT_INTERVAL` env var now accepts human-readable durations (e.g. `"60s"`) in addition to plain millisecond counts
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- **OTEL metrics default**: `OTEL_METRICS_EXPORTER` default changed to `"prometheus"` only, removing `"otlp"` — reduces instrumentation overhead when no OTLP collector is configured
|
|
38
|
+
- **Session limits**: Per-transport limits (`MCP_MAX_STREAMABLE_HTTP_SESSIONS`, `MCP_MAX_SSE_SESSIONS`) are now independent caps within the global `MCP_MAX_SESSIONS` pool (first-come-first-served). Previously the constraint checked `HTTP + SSE <= MAX` (additive), which artificially restricted valid configurations.
|
|
39
|
+
- **Session limits**: `MCP_MAX_STREAMABLE_HTTP_SESSIONS` default changed from `100` to `200` to match the global default — no artificial restriction out of the box
|
|
40
|
+
- **Session limits**: `hasCapacityForTransport()` now checks the global limit first before per-transport caps, preventing edge cases where the store rejects silently
|
|
41
|
+
- **Health endpoint**: `/health` now returns minimal liveness data (`status`, `version`, `uptime`) only — session counts moved to `/ready` where they belong for orchestration probes
|
|
42
|
+
- **Session logging**: `InMemorySessionStore` logs (create, close, shutdown) demoted from INFO to TRACE — the store is an internal data layer. `SessionManagerImpl` logs (create, closeAll, dispose) promoted from DEBUG to INFO — the manager is the authoritative public facade. Eliminates confusing duplicate log lines at default log levels. Redundant shutdown logs removed from `removeAll()` — the manager's `closeAll()` already covers the shutdown sequence.
|
|
43
|
+
- **Session logging**: Removed redundant TRACE and WARN logs from `McpSession.dispose()` — `sdk.close()` triggers `onclose`/`onerror` callbacks which are the canonical logging source. SSE transport handler `closeOnce` demoted from DEBUG to TRACE to match Streamable HTTP handler pattern.
|
|
44
|
+
- **Shutdown log ordering**: `closeAll()` now logs "Closing all sessions..." BEFORE removing sessions from the store, fixing inverted log sequence where store TRACE appeared before manager INFO announcement
|
|
45
|
+
- **ESLint**: Removed unnecessary `if (req.query)` guard in `StatefulHandler.resolveSessionId()` — Express `req.query` is always truthy
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
10
49
|
## [1.0.0] - Framework Release
|
|
11
50
|
|
|
12
51
|
Initial public release. Extracted and generalized from [Komodo MCP Server](https://github.com/MP-Tool/komodo-mcp-server) v1.2.2 into a standalone, client-agnostic framework for building production-ready Model Context Protocol servers.
|
package/build/config/env.d.ts
CHANGED
|
@@ -73,8 +73,8 @@ export declare const frameworkEnvSchema: z.ZodEffects<z.ZodObject<{
|
|
|
73
73
|
MCP_TLS_CA_PATH: z.ZodOptional<z.ZodString>;
|
|
74
74
|
/** Allowed hosts for DNS rebinding protection (comma-separated) */
|
|
75
75
|
MCP_ALLOWED_HOSTS: z.ZodOptional<z.ZodEffects<z.ZodString, string[] | undefined, string>>;
|
|
76
|
-
/** Rate limit window
|
|
77
|
-
MCP_RATE_LIMIT_WINDOW_MS: z.ZodDefault<z.ZodNumber>;
|
|
76
|
+
/** Rate limit window duration (default: '15m' = 900000ms). Accepts human-readable durations like '15m', '1h', '30s'. */
|
|
77
|
+
MCP_RATE_LIMIT_WINDOW_MS: z.ZodPipeline<z.ZodDefault<z.ZodEffects<z.ZodString, number, string>>, z.ZodNumber>;
|
|
78
78
|
/** Maximum requests per rate limit window (default: 1000) */
|
|
79
79
|
MCP_RATE_LIMIT_MAX: z.ZodDefault<z.ZodNumber>;
|
|
80
80
|
/**
|
|
@@ -178,7 +178,7 @@ export declare const frameworkEnvSchema: z.ZodEffects<z.ZodObject<{
|
|
|
178
178
|
MCP_AUTH_RESOURCE_METADATA_URL: z.ZodOptional<z.ZodString>;
|
|
179
179
|
/** Maximum total concurrent sessions across all transports (default: 200) */
|
|
180
180
|
MCP_MAX_SESSIONS: z.ZodDefault<z.ZodNumber>;
|
|
181
|
-
/** Maximum concurrent Streamable HTTP sessions (default:
|
|
181
|
+
/** Maximum concurrent Streamable HTTP sessions (default: 200) */
|
|
182
182
|
MCP_MAX_STREAMABLE_HTTP_SESSIONS: z.ZodDefault<z.ZodNumber>;
|
|
183
183
|
/** Maximum concurrent SSE sessions (default: 50) */
|
|
184
184
|
MCP_MAX_SSE_SESSIONS: z.ZodDefault<z.ZodNumber>;
|
|
@@ -252,12 +252,13 @@ export declare const frameworkEnvSchema: z.ZodEffects<z.ZodObject<{
|
|
|
252
252
|
*/
|
|
253
253
|
OTEL_LOG_LEVEL: z.ZodOptional<z.ZodString>;
|
|
254
254
|
/**
|
|
255
|
-
* Periodic metric export interval
|
|
255
|
+
* Periodic metric export interval.
|
|
256
256
|
*
|
|
257
257
|
* Standard OTEL env var name. Controls how often PeriodicExportingMetricReader
|
|
258
258
|
* pushes metrics to the OTLP endpoint or console.
|
|
259
|
+
* Accepts human-readable durations like '60s', '5m', or plain millisecond counts.
|
|
259
260
|
*/
|
|
260
|
-
OTEL_METRIC_EXPORT_INTERVAL: z.ZodOptional<z.ZodNumber
|
|
261
|
+
OTEL_METRIC_EXPORT_INTERVAL: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodString, number, string>, z.ZodNumber>>;
|
|
261
262
|
/**
|
|
262
263
|
* Metric exporters to activate (comma-separated).
|
|
263
264
|
*
|
|
@@ -267,7 +268,7 @@ export declare const frameworkEnvSchema: z.ZodEffects<z.ZodObject<{
|
|
|
267
268
|
* - `console` — Log metrics to console (useful for debugging)
|
|
268
269
|
* - `none` — Disable all metric export
|
|
269
270
|
*
|
|
270
|
-
* Default: '
|
|
271
|
+
* Default: 'prometheus' (Prometheus scrape endpoint)
|
|
271
272
|
*/
|
|
272
273
|
OTEL_METRICS_EXPORTER: z.ZodDefault<z.ZodEffects<z.ZodString, string[], string>>;
|
|
273
274
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -331,7 +332,7 @@ export declare const frameworkEnvSchema: z.ZodEffects<z.ZodObject<{
|
|
|
331
332
|
OTEL_TRACES_EXPORTER?: string | undefined;
|
|
332
333
|
OTEL_LOGS_EXPORTER?: string | undefined;
|
|
333
334
|
OTEL_LOG_LEVEL?: string | undefined;
|
|
334
|
-
OTEL_METRIC_EXPORT_INTERVAL?:
|
|
335
|
+
OTEL_METRIC_EXPORT_INTERVAL?: string | undefined;
|
|
335
336
|
VERSION?: string | undefined;
|
|
336
337
|
MCP_BIND_HOST?: string | undefined;
|
|
337
338
|
MCP_PORT?: number | undefined;
|
|
@@ -342,7 +343,7 @@ export declare const frameworkEnvSchema: z.ZodEffects<z.ZodObject<{
|
|
|
342
343
|
MCP_TLS_KEY_PATH?: string | undefined;
|
|
343
344
|
MCP_TLS_CA_PATH?: string | undefined;
|
|
344
345
|
MCP_ALLOWED_HOSTS?: string | undefined;
|
|
345
|
-
MCP_RATE_LIMIT_WINDOW_MS?:
|
|
346
|
+
MCP_RATE_LIMIT_WINDOW_MS?: string | undefined;
|
|
346
347
|
MCP_RATE_LIMIT_MAX?: number | undefined;
|
|
347
348
|
MCP_BODY_SIZE_LIMIT?: string | undefined;
|
|
348
349
|
MCP_TRUST_PROXY?: string | undefined;
|
|
@@ -417,7 +418,7 @@ export declare const frameworkEnvSchema: z.ZodEffects<z.ZodObject<{
|
|
|
417
418
|
OTEL_TRACES_EXPORTER?: string | undefined;
|
|
418
419
|
OTEL_LOGS_EXPORTER?: string | undefined;
|
|
419
420
|
OTEL_LOG_LEVEL?: string | undefined;
|
|
420
|
-
OTEL_METRIC_EXPORT_INTERVAL?:
|
|
421
|
+
OTEL_METRIC_EXPORT_INTERVAL?: string | undefined;
|
|
421
422
|
VERSION?: string | undefined;
|
|
422
423
|
MCP_BIND_HOST?: string | undefined;
|
|
423
424
|
MCP_PORT?: number | undefined;
|
|
@@ -428,7 +429,7 @@ export declare const frameworkEnvSchema: z.ZodEffects<z.ZodObject<{
|
|
|
428
429
|
MCP_TLS_KEY_PATH?: string | undefined;
|
|
429
430
|
MCP_TLS_CA_PATH?: string | undefined;
|
|
430
431
|
MCP_ALLOWED_HOSTS?: string | undefined;
|
|
431
|
-
MCP_RATE_LIMIT_WINDOW_MS?:
|
|
432
|
+
MCP_RATE_LIMIT_WINDOW_MS?: string | undefined;
|
|
432
433
|
MCP_RATE_LIMIT_MAX?: number | undefined;
|
|
433
434
|
MCP_BODY_SIZE_LIMIT?: string | undefined;
|
|
434
435
|
MCP_TRUST_PROXY?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkDxB;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB;IAM3B;;;;;;OAMG;;IAGH,uDAAuD;;IAOvD,0DAA0D;;IAG1D,wCAAwC;;IAGxC,mGAAmG;;IAGnG;;;;OAIG;;IAGH;;;;;;;OAOG;;IAGH;;;;;;;;;;;;;OAaG;;IAOH,sFAAsF;;IAGtF,sFAAsF;;IAGtF,+EAA+E;;IAO/E,mEAAmE;;IAGnE,wHAAwH;;IAGxH,6DAA6D;;IAG7D;;;;;;;;;;OAUG;;IASH;;;;;;;;;;;;;;;;;;OAkBG;;IAGH;;;;;;;;;OASG;;IAGH;;;;;;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,GAAG,kBAAkB,CAEjH"}
|
package/build/config/env.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @module config/env
|
|
9
9
|
*/
|
|
10
10
|
import { z } from "zod";
|
|
11
|
-
import { booleanFromEnv, optionalCommaSeparatedList, commaSeparatedList, byteSizeSchema, } from "../utils/zod-helpers.js";
|
|
12
|
-
import { BYTE_SIZE_REGEX } from "../utils/string-helpers.js";
|
|
11
|
+
import { booleanFromEnv, optionalCommaSeparatedList, commaSeparatedList, byteSizeSchema, durationSchema, } from "../utils/zod-helpers.js";
|
|
12
|
+
import { BYTE_SIZE_REGEX, parseDuration } from "../utils/string-helpers.js";
|
|
13
13
|
import { readFileSync, accessSync, constants as fsConstants } from "node:fs";
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
15
|
import { dirname, join } from "node:path";
|
|
@@ -123,8 +123,8 @@ export const frameworkEnvSchema = z
|
|
|
123
123
|
// ==========================================================================
|
|
124
124
|
/** Allowed hosts for DNS rebinding protection (comma-separated) */
|
|
125
125
|
MCP_ALLOWED_HOSTS: optionalCommaSeparatedList(),
|
|
126
|
-
/** Rate limit window
|
|
127
|
-
MCP_RATE_LIMIT_WINDOW_MS: z.
|
|
126
|
+
/** Rate limit window duration (default: '15m' = 900000ms). Accepts human-readable durations like '15m', '1h', '30s'. */
|
|
127
|
+
MCP_RATE_LIMIT_WINDOW_MS: durationSchema("15m").pipe(z.number().int().min(1000)),
|
|
128
128
|
/** Maximum requests per rate limit window (default: 1000) */
|
|
129
129
|
MCP_RATE_LIMIT_MAX: z.coerce.number().int().min(100).default(1000),
|
|
130
130
|
/**
|
|
@@ -237,8 +237,8 @@ export const frameworkEnvSchema = z
|
|
|
237
237
|
// ==========================================================================
|
|
238
238
|
/** Maximum total concurrent sessions across all transports (default: 200) */
|
|
239
239
|
MCP_MAX_SESSIONS: z.coerce.number().int().min(1).default(200),
|
|
240
|
-
/** Maximum concurrent Streamable HTTP sessions (default:
|
|
241
|
-
MCP_MAX_STREAMABLE_HTTP_SESSIONS: z.coerce.number().int().min(1).default(
|
|
240
|
+
/** Maximum concurrent Streamable HTTP sessions (default: 200) */
|
|
241
|
+
MCP_MAX_STREAMABLE_HTTP_SESSIONS: z.coerce.number().int().min(1).default(200),
|
|
242
242
|
/** Maximum concurrent SSE sessions (default: 50) */
|
|
243
243
|
MCP_MAX_SSE_SESSIONS: z.coerce.number().int().min(1).default(50),
|
|
244
244
|
// ==========================================================================
|
|
@@ -323,12 +323,17 @@ export const frameworkEnvSchema = z
|
|
|
323
323
|
*/
|
|
324
324
|
OTEL_LOG_LEVEL: z.string().min(1).optional(),
|
|
325
325
|
/**
|
|
326
|
-
* Periodic metric export interval
|
|
326
|
+
* Periodic metric export interval.
|
|
327
327
|
*
|
|
328
328
|
* Standard OTEL env var name. Controls how often PeriodicExportingMetricReader
|
|
329
329
|
* pushes metrics to the OTLP endpoint or console.
|
|
330
|
+
* Accepts human-readable durations like '60s', '5m', or plain millisecond counts.
|
|
330
331
|
*/
|
|
331
|
-
OTEL_METRIC_EXPORT_INTERVAL: z
|
|
332
|
+
OTEL_METRIC_EXPORT_INTERVAL: z
|
|
333
|
+
.string()
|
|
334
|
+
.transform((val) => parseDuration(val))
|
|
335
|
+
.pipe(z.number().int().positive())
|
|
336
|
+
.optional(),
|
|
332
337
|
/**
|
|
333
338
|
* Metric exporters to activate (comma-separated).
|
|
334
339
|
*
|
|
@@ -338,9 +343,9 @@ export const frameworkEnvSchema = z
|
|
|
338
343
|
* - `console` — Log metrics to console (useful for debugging)
|
|
339
344
|
* - `none` — Disable all metric export
|
|
340
345
|
*
|
|
341
|
-
* Default: '
|
|
346
|
+
* Default: 'prometheus' (Prometheus scrape endpoint)
|
|
342
347
|
*/
|
|
343
|
-
OTEL_METRICS_EXPORTER: commaSeparatedList({ lowercase: true }).default("
|
|
348
|
+
OTEL_METRICS_EXPORTER: commaSeparatedList({ lowercase: true }).default("prometheus"),
|
|
344
349
|
})
|
|
345
350
|
.superRefine((data, ctx) => {
|
|
346
351
|
// Validate TLS configuration when HTTPS mode is selected
|
|
@@ -416,14 +421,21 @@ export function validateConfigConstraints(config) {
|
|
|
416
421
|
}
|
|
417
422
|
}
|
|
418
423
|
}
|
|
419
|
-
// Session
|
|
420
|
-
|
|
421
|
-
|
|
424
|
+
// Session limits: per-transport caps must not exceed the global cap.
|
|
425
|
+
// Limits are independent — global MCP_MAX_SESSIONS is a first-come-first-served hard cap,
|
|
426
|
+
// while per-transport limits are independent ceilings within that global pool.
|
|
427
|
+
if (config.MCP_MAX_STREAMABLE_HTTP_SESSIONS > config.MCP_MAX_SESSIONS) {
|
|
428
|
+
violations.push({
|
|
429
|
+
message: `MCP_MAX_STREAMABLE_HTTP_SESSIONS (${config.MCP_MAX_STREAMABLE_HTTP_SESSIONS}) ` +
|
|
430
|
+
`exceeds MCP_MAX_SESSIONS (${config.MCP_MAX_SESSIONS})`,
|
|
431
|
+
path: ["MCP_MAX_SESSIONS", "MCP_MAX_STREAMABLE_HTTP_SESSIONS"],
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
if (config.MCP_MAX_SSE_SESSIONS > config.MCP_MAX_SESSIONS) {
|
|
422
435
|
violations.push({
|
|
423
|
-
message: `
|
|
424
|
-
`
|
|
425
|
-
|
|
426
|
-
path: ["MCP_MAX_SESSIONS", "MCP_MAX_STREAMABLE_HTTP_SESSIONS", "MCP_MAX_SSE_SESSIONS"],
|
|
436
|
+
message: `MCP_MAX_SSE_SESSIONS (${config.MCP_MAX_SSE_SESSIONS}) ` +
|
|
437
|
+
`exceeds MCP_MAX_SESSIONS (${config.MCP_MAX_SESSIONS})`,
|
|
438
|
+
path: ["MCP_MAX_SESSIONS", "MCP_MAX_SSE_SESSIONS"],
|
|
427
439
|
});
|
|
428
440
|
}
|
|
429
441
|
return violations;
|
package/build/config/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[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C;IAED,qEAAqE;IACrE,0FAA0F;IAC1F,+EAA+E;IAC/E,IAAI,MAAM,CAAC,gCAAgC,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACtE,UAAU,CAAC,IAAI,CAAC;YACd,OAAO,EACL,qCAAqC,MAAM,CAAC,gCAAgC,IAAI;gBAChF,6BAA6B,MAAM,CAAC,gBAAgB,GAAG;YACzD,IAAI,EAAE,CAAC,kBAAkB,EAAE,kCAAkC,CAAC;SAC/D,CAAC,CAAC;IACL,CAAC;IACD,IAAI,MAAM,CAAC,oBAAoB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QAC1D,UAAU,CAAC,IAAI,CAAC;YACd,OAAO,EACL,yBAAyB,MAAM,CAAC,oBAAoB,IAAI;gBACxD,6BAA6B,MAAM,CAAC,gBAAgB,GAAG;YACzD,IAAI,EAAE,CAAC,kBAAkB,EAAE,sBAAsB,CAAC;SACnD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAWD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,YAAgD,OAAO,CAAC,GAAG;IAC3F,OAAO,kBAAkB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -66,7 +66,7 @@ export function loadConfigFile() {
|
|
|
66
66
|
* Discover the config file path.
|
|
67
67
|
*
|
|
68
68
|
* Resolution order:
|
|
69
|
-
* 1. `
|
|
69
|
+
* 1. `MCP_CONFIG_FILE_PATH` env var — explicit path (must exist, must be supported format)
|
|
70
70
|
* 2. Auto-discovery in `process.cwd()` — first match from {@link DISCOVERY_FILENAMES}
|
|
71
71
|
*
|
|
72
72
|
* @returns Absolute path to the config file, or `undefined` if none found
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* All fields are optional — you only configure what you need.
|
|
15
15
|
*
|
|
16
16
|
* Intentionally excluded from config file support:
|
|
17
|
-
* - `
|
|
17
|
+
* - `MCP_CONFIG_FILE_PATH` — meta-config (chicken-egg problem)
|
|
18
18
|
* - `NODE_ENV` — runtime concern, not file-config
|
|
19
19
|
* - `VERSION` — build/deployment concern
|
|
20
20
|
*
|
|
@@ -40,7 +40,7 @@ export declare const DISCOVERY_FILENAMES: readonly ["config.toml", "config.yaml"
|
|
|
40
40
|
*
|
|
41
41
|
* This is a meta-config variable and intentionally NOT part of `FrameworkEnvConfig`.
|
|
42
42
|
*/
|
|
43
|
-
export declare const CONFIG_FILE_ENV_VAR: "
|
|
43
|
+
export declare const CONFIG_FILE_ENV_VAR: "MCP_CONFIG_FILE_PATH";
|
|
44
44
|
/**
|
|
45
45
|
* Maps file extensions to their format.
|
|
46
46
|
*
|
|
@@ -138,7 +138,7 @@ export declare const CONFIG_FILE_SECTIONS: Readonly<{
|
|
|
138
138
|
security: z.ZodObject<{
|
|
139
139
|
allowed_hosts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
140
140
|
rate_limit_max: z.ZodOptional<z.ZodNumber>;
|
|
141
|
-
|
|
141
|
+
rate_limit_window: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
142
142
|
trust_proxy: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
143
143
|
cors_origin: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
144
144
|
cors_credentials: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -149,7 +149,7 @@ export declare const CONFIG_FILE_SECTIONS: Readonly<{
|
|
|
149
149
|
}, "strip", z.ZodTypeAny, {
|
|
150
150
|
allowed_hosts?: string[] | undefined;
|
|
151
151
|
rate_limit_max?: number | undefined;
|
|
152
|
-
|
|
152
|
+
rate_limit_window?: string | number | undefined;
|
|
153
153
|
trust_proxy?: string | number | undefined;
|
|
154
154
|
cors_origin?: string[] | undefined;
|
|
155
155
|
cors_credentials?: boolean | undefined;
|
|
@@ -160,7 +160,7 @@ export declare const CONFIG_FILE_SECTIONS: Readonly<{
|
|
|
160
160
|
}, {
|
|
161
161
|
allowed_hosts?: string[] | undefined;
|
|
162
162
|
rate_limit_max?: number | undefined;
|
|
163
|
-
|
|
163
|
+
rate_limit_window?: string | number | undefined;
|
|
164
164
|
trust_proxy?: string | number | undefined;
|
|
165
165
|
cors_origin?: string[] | undefined;
|
|
166
166
|
cors_credentials?: boolean | undefined;
|
|
@@ -217,7 +217,7 @@ export declare const CONFIG_FILE_SECTIONS: Readonly<{
|
|
|
217
217
|
traces_exporter: z.ZodOptional<z.ZodString>;
|
|
218
218
|
logs_exporter: z.ZodOptional<z.ZodString>;
|
|
219
219
|
log_level: z.ZodOptional<z.ZodString>;
|
|
220
|
-
metric_export_interval: z.ZodOptional<z.ZodNumber
|
|
220
|
+
metric_export_interval: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
221
221
|
metrics_exporter: z.ZodOptional<z.ZodString>;
|
|
222
222
|
}, "strip", z.ZodTypeAny, {
|
|
223
223
|
enabled?: boolean | undefined;
|
|
@@ -226,7 +226,7 @@ export declare const CONFIG_FILE_SECTIONS: Readonly<{
|
|
|
226
226
|
traces_exporter?: string | undefined;
|
|
227
227
|
logs_exporter?: string | undefined;
|
|
228
228
|
log_level?: string | undefined;
|
|
229
|
-
metric_export_interval?: number | undefined;
|
|
229
|
+
metric_export_interval?: string | number | undefined;
|
|
230
230
|
metrics_exporter?: string | undefined;
|
|
231
231
|
}, {
|
|
232
232
|
enabled?: boolean | undefined;
|
|
@@ -235,7 +235,7 @@ export declare const CONFIG_FILE_SECTIONS: Readonly<{
|
|
|
235
235
|
traces_exporter?: string | undefined;
|
|
236
236
|
logs_exporter?: string | undefined;
|
|
237
237
|
log_level?: string | undefined;
|
|
238
|
-
metric_export_interval?: number | undefined;
|
|
238
|
+
metric_export_interval?: string | number | undefined;
|
|
239
239
|
metrics_exporter?: string | undefined;
|
|
240
240
|
}>;
|
|
241
241
|
auth: z.ZodObject<{
|
|
@@ -329,7 +329,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
329
329
|
readonly security: z.ZodOptional<z.ZodObject<{
|
|
330
330
|
allowed_hosts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
331
331
|
rate_limit_max: z.ZodOptional<z.ZodNumber>;
|
|
332
|
-
|
|
332
|
+
rate_limit_window: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
333
333
|
trust_proxy: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
334
334
|
cors_origin: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
335
335
|
cors_credentials: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -340,7 +340,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
340
340
|
}, "strip", z.ZodTypeAny, {
|
|
341
341
|
allowed_hosts?: string[] | undefined;
|
|
342
342
|
rate_limit_max?: number | undefined;
|
|
343
|
-
|
|
343
|
+
rate_limit_window?: string | number | undefined;
|
|
344
344
|
trust_proxy?: string | number | undefined;
|
|
345
345
|
cors_origin?: string[] | undefined;
|
|
346
346
|
cors_credentials?: boolean | undefined;
|
|
@@ -351,7 +351,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
351
351
|
}, {
|
|
352
352
|
allowed_hosts?: string[] | undefined;
|
|
353
353
|
rate_limit_max?: number | undefined;
|
|
354
|
-
|
|
354
|
+
rate_limit_window?: string | number | undefined;
|
|
355
355
|
trust_proxy?: string | number | undefined;
|
|
356
356
|
cors_origin?: string[] | undefined;
|
|
357
357
|
cors_credentials?: boolean | undefined;
|
|
@@ -408,7 +408,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
408
408
|
traces_exporter: z.ZodOptional<z.ZodString>;
|
|
409
409
|
logs_exporter: z.ZodOptional<z.ZodString>;
|
|
410
410
|
log_level: z.ZodOptional<z.ZodString>;
|
|
411
|
-
metric_export_interval: z.ZodOptional<z.ZodNumber
|
|
411
|
+
metric_export_interval: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString]>>;
|
|
412
412
|
metrics_exporter: z.ZodOptional<z.ZodString>;
|
|
413
413
|
}, "strip", z.ZodTypeAny, {
|
|
414
414
|
enabled?: boolean | undefined;
|
|
@@ -417,7 +417,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
417
417
|
traces_exporter?: string | undefined;
|
|
418
418
|
logs_exporter?: string | undefined;
|
|
419
419
|
log_level?: string | undefined;
|
|
420
|
-
metric_export_interval?: number | undefined;
|
|
420
|
+
metric_export_interval?: string | number | undefined;
|
|
421
421
|
metrics_exporter?: string | undefined;
|
|
422
422
|
}, {
|
|
423
423
|
enabled?: boolean | undefined;
|
|
@@ -426,7 +426,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
426
426
|
traces_exporter?: string | undefined;
|
|
427
427
|
logs_exporter?: string | undefined;
|
|
428
428
|
log_level?: string | undefined;
|
|
429
|
-
metric_export_interval?: number | undefined;
|
|
429
|
+
metric_export_interval?: string | number | undefined;
|
|
430
430
|
metrics_exporter?: string | undefined;
|
|
431
431
|
}>>;
|
|
432
432
|
readonly auth: z.ZodOptional<z.ZodObject<{
|
|
@@ -471,7 +471,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
471
471
|
security?: {
|
|
472
472
|
allowed_hosts?: string[] | undefined;
|
|
473
473
|
rate_limit_max?: number | undefined;
|
|
474
|
-
|
|
474
|
+
rate_limit_window?: string | number | undefined;
|
|
475
475
|
trust_proxy?: string | number | undefined;
|
|
476
476
|
cors_origin?: string[] | undefined;
|
|
477
477
|
cors_credentials?: boolean | undefined;
|
|
@@ -487,7 +487,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
487
487
|
traces_exporter?: string | undefined;
|
|
488
488
|
logs_exporter?: string | undefined;
|
|
489
489
|
log_level?: string | undefined;
|
|
490
|
-
metric_export_interval?: number | undefined;
|
|
490
|
+
metric_export_interval?: string | number | undefined;
|
|
491
491
|
metrics_exporter?: string | undefined;
|
|
492
492
|
} | undefined;
|
|
493
493
|
auth?: {
|
|
@@ -526,7 +526,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
526
526
|
security?: {
|
|
527
527
|
allowed_hosts?: string[] | undefined;
|
|
528
528
|
rate_limit_max?: number | undefined;
|
|
529
|
-
|
|
529
|
+
rate_limit_window?: string | number | undefined;
|
|
530
530
|
trust_proxy?: string | number | undefined;
|
|
531
531
|
cors_origin?: string[] | undefined;
|
|
532
532
|
cors_credentials?: boolean | undefined;
|
|
@@ -542,7 +542,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
542
542
|
traces_exporter?: string | undefined;
|
|
543
543
|
logs_exporter?: string | undefined;
|
|
544
544
|
log_level?: string | undefined;
|
|
545
|
-
metric_export_interval?: number | undefined;
|
|
545
|
+
metric_export_interval?: string | number | undefined;
|
|
546
546
|
metrics_exporter?: string | undefined;
|
|
547
547
|
} | undefined;
|
|
548
548
|
auth?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/config/file/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/config/file/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAapD,oCAAoC;AACpC,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,sEAAuE,CAAC;AAExG;;;;;;;GAOG;AACH,eAAO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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2C,CAAC;AAEzE,iCAAiC;AACjC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAM9D;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAmFxF;AAMD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,OAAO,CAAC,kBAAkB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgBjG"}
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
* All fields are optional — you only configure what you need.
|
|
15
15
|
*
|
|
16
16
|
* Intentionally excluded from config file support:
|
|
17
|
-
* - `
|
|
17
|
+
* - `MCP_CONFIG_FILE_PATH` — meta-config (chicken-egg problem)
|
|
18
18
|
* - `NODE_ENV` — runtime concern, not file-config
|
|
19
19
|
* - `VERSION` — build/deployment concern
|
|
20
20
|
*
|
|
21
21
|
* @module config/file/schema
|
|
22
22
|
*/
|
|
23
23
|
import { z } from "zod";
|
|
24
|
-
import { splitCommaSeparated, BYTE_SIZE_REGEX, parseByteSize } from "../../utils/string-helpers.js";
|
|
24
|
+
import { splitCommaSeparated, BYTE_SIZE_REGEX, parseByteSize, parseDuration, DURATION_REGEX, } from "../../utils/string-helpers.js";
|
|
25
25
|
/**
|
|
26
26
|
* Config file names for auto-discovery (ordered by priority).
|
|
27
27
|
*
|
|
@@ -38,7 +38,7 @@ export const DISCOVERY_FILENAMES = ["config.toml", "config.yaml", "config.yml",
|
|
|
38
38
|
*
|
|
39
39
|
* This is a meta-config variable and intentionally NOT part of `FrameworkEnvConfig`.
|
|
40
40
|
*/
|
|
41
|
-
export const CONFIG_FILE_ENV_VAR = "
|
|
41
|
+
export const CONFIG_FILE_ENV_VAR = "MCP_CONFIG_FILE_PATH";
|
|
42
42
|
/**
|
|
43
43
|
* Maps file extensions to their format.
|
|
44
44
|
*
|
|
@@ -88,8 +88,8 @@ const securitySection = z
|
|
|
88
88
|
allowed_hosts: z.array(z.string().min(1)),
|
|
89
89
|
/** Maximum requests per rate limit window */
|
|
90
90
|
rate_limit_max: z.number().int().min(100),
|
|
91
|
-
/** Rate limit window
|
|
92
|
-
|
|
91
|
+
/** Rate limit window as duration (e.g. '15m', '1h') or milliseconds (number) */
|
|
92
|
+
rate_limit_window: z.union([z.number().int().min(1000), z.string().regex(DURATION_REGEX)]),
|
|
93
93
|
/**
|
|
94
94
|
* Trust proxy setting for Express.
|
|
95
95
|
* Values: hop count (number ≥ 1), or string (IP/CIDR/keyword/hostname).
|
|
@@ -154,8 +154,8 @@ const telemetrySection = z
|
|
|
154
154
|
logs_exporter: z.string().min(1),
|
|
155
155
|
/** SDK diagnostic log level: NONE, ERROR, WARN, INFO, DEBUG, VERBOSE, ALL */
|
|
156
156
|
log_level: z.string().min(1),
|
|
157
|
-
/** Periodic metric export interval
|
|
158
|
-
metric_export_interval: z.number().int().positive(),
|
|
157
|
+
/** Periodic metric export interval as duration (e.g. '60s', '5m') or milliseconds (number) */
|
|
158
|
+
metric_export_interval: z.union([z.number().int().positive(), z.string().regex(DURATION_REGEX)]),
|
|
159
159
|
/**
|
|
160
160
|
* Metric exporters (comma-separated): otlp, prometheus, console, none.
|
|
161
161
|
* Default: 'otlp,prometheus'
|
|
@@ -273,8 +273,8 @@ export function mapConfigToOverrides(config) {
|
|
|
273
273
|
overrides.MCP_ALLOWED_HOSTS = s.allowed_hosts;
|
|
274
274
|
if (s.rate_limit_max !== undefined)
|
|
275
275
|
overrides.MCP_RATE_LIMIT_MAX = s.rate_limit_max;
|
|
276
|
-
if (s.
|
|
277
|
-
overrides.MCP_RATE_LIMIT_WINDOW_MS = s.
|
|
276
|
+
if (s.rate_limit_window !== undefined)
|
|
277
|
+
overrides.MCP_RATE_LIMIT_WINDOW_MS = parseDuration(String(s.rate_limit_window));
|
|
278
278
|
if (s.trust_proxy !== undefined)
|
|
279
279
|
overrides.MCP_TRUST_PROXY = String(s.trust_proxy);
|
|
280
280
|
if (s.cors_origin !== undefined)
|
|
@@ -336,7 +336,7 @@ export function mapConfigToOverrides(config) {
|
|
|
336
336
|
if (o.log_level !== undefined)
|
|
337
337
|
overrides.OTEL_LOG_LEVEL = o.log_level;
|
|
338
338
|
if (o.metric_export_interval !== undefined)
|
|
339
|
-
overrides.OTEL_METRIC_EXPORT_INTERVAL = o.metric_export_interval;
|
|
339
|
+
overrides.OTEL_METRIC_EXPORT_INTERVAL = parseDuration(String(o.metric_export_interval));
|
|
340
340
|
if (o.metrics_exporter !== undefined) {
|
|
341
341
|
// Config file stores single string, env.ts expects string[] after transform
|
|
342
342
|
overrides.OTEL_METRICS_EXPORTER = splitCommaSeparated(o.metrics_exporter, { lowercase: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/config/file/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/config/file/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,+BAA+B,CAAC;AASvC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,CAAU,CAAC;AAExG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,m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8 @@ export class ConfigurationError extends AppError {
|
|
|
247
247
|
*/
|
|
248
248
|
static fileNotFound(filePath) {
|
|
249
249
|
return new ConfigurationError(`Config file not found: ${filePath}`, {
|
|
250
|
-
configKey: "
|
|
251
|
-
recoveryHint: `Ensure the file '${filePath}' exists or remove the
|
|
250
|
+
configKey: "MCP_CONFIG_FILE_PATH",
|
|
251
|
+
recoveryHint: `Ensure the file '${filePath}' exists or remove the MCP_CONFIG_FILE_PATH environment variable.`,
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
@@ -256,7 +256,7 @@ export class ConfigurationError extends AppError {
|
|
|
256
256
|
*/
|
|
257
257
|
static fileReadFailed(filePath, cause) {
|
|
258
258
|
return new ConfigurationError(`Failed to read config file: ${filePath}`, {
|
|
259
|
-
configKey: "
|
|
259
|
+
configKey: "MCP_CONFIG_FILE_PATH",
|
|
260
260
|
cause,
|
|
261
261
|
recoveryHint: `Check file permissions and path for '${filePath}'.`,
|
|
262
262
|
});
|
|
@@ -266,7 +266,7 @@ export class ConfigurationError extends AppError {
|
|
|
266
266
|
*/
|
|
267
267
|
static fileParseFailed(filePath, cause) {
|
|
268
268
|
return new ConfigurationError(`Failed to parse config file: ${filePath}`, {
|
|
269
|
-
configKey: "
|
|
269
|
+
configKey: "MCP_CONFIG_FILE_PATH",
|
|
270
270
|
cause,
|
|
271
271
|
recoveryHint: `Check the syntax of '${filePath}' — ensure it is valid TOML or YAML.`,
|
|
272
272
|
});
|
|
@@ -281,7 +281,7 @@ export class ConfigurationError extends AppError {
|
|
|
281
281
|
const issues = zodError.issues.map((i) => ` - ${i.path.join(".")}: ${i.message}`).join("\n");
|
|
282
282
|
const detail = `Validation failed for '${filePath}':\n${issues}`;
|
|
283
283
|
return new ConfigurationError(detail, {
|
|
284
|
-
configKey: "
|
|
284
|
+
configKey: "MCP_CONFIG_FILE_PATH",
|
|
285
285
|
cause: zodError,
|
|
286
286
|
recoveryHint: "Fix the listed issues in your config file. Use `.strict()` sections to catch typos.",
|
|
287
287
|
});
|
|
@@ -291,7 +291,7 @@ export class ConfigurationError extends AppError {
|
|
|
291
291
|
*/
|
|
292
292
|
static unsupportedFormat(extension) {
|
|
293
293
|
return new ConfigurationError(`Unsupported config file format: ${extension}. Supported: .toml, .yaml, .yml`, {
|
|
294
|
-
configKey: "
|
|
294
|
+
configKey: "MCP_CONFIG_FILE_PATH",
|
|
295
295
|
recoveryHint: `Supported formats: .toml, .yaml, .yml`,
|
|
296
296
|
});
|
|
297
297
|
}
|