context-saver-mcp 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 +10 -0
- package/context-saver-mcp.js +18 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres to [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [1.0.1] — 2026-11-03
|
|
6
|
+
|
|
7
|
+
Patch release — hardening found by the CI matrix on real GitHub runners (every fix demonstrated with a failing test first).
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
- **Windows / all platforms**: transport-level upstream failures (`McpError` `ConnectionClosed`/`RequestTimeout` — e.g. an upstream that dies before the MCP handshake) are now normalized into the gateway's JSON error envelope instead of surfacing as raw protocol text.
|
|
11
|
+
- **Node 18**: shimmed `globalThis.crypto` (WebCrypto is only default-global since Node 19) — required by the SDK's Streamable HTTP core for SSE stream ids; without it every HTTP-transport POST failed on Node 18 with `ReferenceError: crypto is not defined`.
|
|
12
|
+
- **Cross-version CI**: `npm test` now enumerates test files itself (`tests/run-all.mjs`) — `node --test` glob expansion is a Node-22+ feature, so the glob form broke on Node 18/20 (and cmd.exe never expands globs).
|
|
13
|
+
- **Release workflow**: every job now carries an explicit version-tag guard so Dependabot branch pushes that modify the workflow file can no longer create phantom red runs, and a manual dispatch from a branch can never create a GitHub Release.
|
|
14
|
+
|
|
5
15
|
## [1.0.0] — 2026-11-03
|
|
6
16
|
|
|
7
17
|
First public release. One gateway connection instead of dozens; lazy tool schemas kill the 15k–20k token upfront burn.
|
package/context-saver-mcp.js
CHANGED
|
@@ -92,6 +92,16 @@ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/
|
|
|
92
92
|
import { ErrorCode, McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
93
93
|
import { z } from 'zod';
|
|
94
94
|
|
|
95
|
+
// Node 18 support guard: Node exposes globalThis.crypto (WebCrypto) by default
|
|
96
|
+
// only since v19 — on 18.19 it requires --experimental-global-webcrypto. The
|
|
97
|
+
// SDK's Streamable HTTP core uses the global crypto.randomUUID() for SSE
|
|
98
|
+
// response stream ids, so without this shim every /mcp POST on Node 18 dies
|
|
99
|
+
// with 'ReferenceError: crypto is not defined' (observed in CI run #8/#11).
|
|
100
|
+
if (typeof globalThis.crypto === 'undefined') {
|
|
101
|
+
const { webcrypto } = await import('node:crypto');
|
|
102
|
+
globalThis.crypto = webcrypto;
|
|
103
|
+
}
|
|
104
|
+
|
|
95
105
|
export const NAME = 'context-saver-mcp';
|
|
96
106
|
export const VERSION = '1.0.0';
|
|
97
107
|
|
|
@@ -1168,7 +1178,14 @@ export function buildGatewayServer(runtime) {
|
|
|
1168
1178
|
}
|
|
1169
1179
|
return { content, isError: result?.isError === true };
|
|
1170
1180
|
} catch (err) {
|
|
1171
|
-
|
|
1181
|
+
// Parameter-level errors (e.g. upstream InvalidParams for wrong args) are
|
|
1182
|
+
// protocol errors and must pass through. TRANSPORT-level McpErrors —
|
|
1183
|
+
// ConnectionClosed when an upstream dies at boot, RequestTimeout when the
|
|
1184
|
+
// wire times out — are availability problems: normalize them into the
|
|
1185
|
+
// JSON error envelope so the host model sees one consistent shape.
|
|
1186
|
+
const transportLevel = err instanceof McpError
|
|
1187
|
+
&& (err.code === ErrorCode.ConnectionClosed || err.code === ErrorCode.RequestTimeout);
|
|
1188
|
+
if (err instanceof McpError && !transportLevel) throw err;
|
|
1172
1189
|
return errorResult(`call_tool ${server}/${tool} failed: ${err.message}`, {
|
|
1173
1190
|
server,
|
|
1174
1191
|
tool,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-saver-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "The Context-Saver: Multi-Server Multiplexer (Aggregator) MCP Server. One gateway connection instead of dozens — lazy tool schemas cut MCP context burn by ~90%.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"start": "node context-saver-mcp.js",
|
|
25
|
-
"test": "node
|
|
26
|
-
"test:unit": "node
|
|
27
|
-
"test:integration": "node
|
|
28
|
-
"test:http": "node
|
|
25
|
+
"test": "node tests/run-all.mjs",
|
|
26
|
+
"test:unit": "node tests/run-all.mjs tests/unit",
|
|
27
|
+
"test:integration": "node tests/run-all.mjs tests/integration",
|
|
28
|
+
"test:http": "node tests/run-all.mjs tests/http",
|
|
29
29
|
"lint": "eslint .",
|
|
30
30
|
"smoke": "node tests/smoke/smoke.mjs",
|
|
31
|
-
"bundle": "esbuild context-saver-mcp.js --bundle --platform=node --format=esm --outfile=dist/context-saver-mcp.bundle.js --banner:js=\"
|
|
31
|
+
"bundle": "esbuild context-saver-mcp.js --bundle --platform=node --format=esm --outfile=dist/context-saver-mcp.bundle.js --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\""
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"mcp",
|