mcp-server-framework 1.0.0 → 1.0.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/CHANGELOG.md +47 -0
- package/LICENSE-GPL.txt +675 -0
- package/LICENSE.txt +165 -0
- package/README.md +3 -5
- 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/mcp/capabilities/registry/tool-registry.d.ts.map +1 -1
- package/build/mcp/capabilities/registry/tool-registry.js +7 -2
- package/build/mcp/capabilities/registry/tool-registry.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.d.ts.map +1 -1
- package/build/server/transport/sse/handler.js +2 -4
- 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 +24 -22
- 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 +5 -7
- package/LICENSE-GPL.md +0 -219
- package/LICENSE.md +0 -187
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,53 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.2] - fix: license format, logging improvements, session-not-found response
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **License** updated license files to .txt format for further compatibility and fixed GitHub license auto detection
|
|
15
|
+
- **Tool error logging**: Expected tool errors (`statusCode < 500`, e.g. invalid input, not found, auth failures) now logged at WARN with message-only instead of full error object with stack trace. Real errors (`>= 500`) retain full stack trace at ERROR level
|
|
16
|
+
- **Session-not-found response**: HTTP 404 responses for expired/unknown sessions now send plain text instead of JSON-RPC body. The MCP SDK reads non-2xx response bodies as raw text, so the previous JSON-RPC envelope appeared as an ugly nested string in client error messages. Affects Streamable HTTP (POST, GET, DELETE) and SSE legacy transport
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## [1.0.1] - fix: session lifecycle, logging, config & OTEL improvements
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- `parseDuration()` utility for parsing human-readable durations (`"15m"`, `"1.5h"`, `"500ms"`, `"2d"`, `"1w"`) into milliseconds — analogous to `parseByteSize()`
|
|
25
|
+
- `formatDuration()` utility for converting milliseconds to human-readable durations (`"15m"`, `"1h 30m"`, `"2d"`) — inverse of `parseDuration()`
|
|
26
|
+
- `durationSchema()` Zod helper for duration environment variables with human-readable defaults — analogous to `byteSizeSchema()`
|
|
27
|
+
- `DURATION_REGEX` pattern for validating duration strings in config file schemas
|
|
28
|
+
- Export `interpolate()` and `MessageParams` type from the main barrel (`mcp-server-framework`) for consumer use
|
|
29
|
+
- `ignoreOutgoingRequestHook` on `HttpInstrumentation` to prevent recursive instrumentation of outgoing OTLP export HTTP calls — eliminates ECONNREFUSED feedback loop when no collector is running
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- **BREAKING**: Rename `MCP_CONFIG_FILE` environment variable to `MCP_CONFIG_FILE_PATH` for clarity
|
|
34
|
+
- **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
|
|
35
|
+
- **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`
|
|
36
|
+
- **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`
|
|
37
|
+
- **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
|
|
38
|
+
- 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"`)
|
|
39
|
+
- Config file field `telemetry.metric_export_interval` now accepts both numeric milliseconds and human-readable durations (e.g. `"60s"`)
|
|
40
|
+
- `MCP_RATE_LIMIT_WINDOW_MS` env var now accepts human-readable durations (e.g. `"15m"`) in addition to plain millisecond counts
|
|
41
|
+
- `OTEL_METRIC_EXPORT_INTERVAL` env var now accepts human-readable durations (e.g. `"60s"`) in addition to plain millisecond counts
|
|
42
|
+
|
|
43
|
+
### Fixed
|
|
44
|
+
|
|
45
|
+
- **OTEL metrics default**: `OTEL_METRICS_EXPORTER` default changed to `"prometheus"` only, removing `"otlp"` — reduces instrumentation overhead when no OTLP collector is configured
|
|
46
|
+
- **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.
|
|
47
|
+
- **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
|
|
48
|
+
- **Session limits**: `hasCapacityForTransport()` now checks the global limit first before per-transport caps, preventing edge cases where the store rejects silently
|
|
49
|
+
- **Health endpoint**: `/health` now returns minimal liveness data (`status`, `version`, `uptime`) only — session counts moved to `/ready` where they belong for orchestration probes
|
|
50
|
+
- **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.
|
|
51
|
+
- **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.
|
|
52
|
+
- **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
|
|
53
|
+
- **ESLint**: Removed unnecessary `if (req.query)` guard in `StatefulHandler.resolveSessionId()` — Express `req.query` is always truthy
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
10
57
|
## [1.0.0] - Framework Release
|
|
11
58
|
|
|
12
59
|
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.
|