No description
  • JavaScript 100%
Find a file
Nikki Claude 07645f2ab3 fix: server.js was creating a fresh transport per HTTP request
Confirmed broken by an actual protocol round-trip (SDK client against a
running server, not just reading the code): "Bad Request: Server not
initialized" on the second call, because StreamableHTTPServerTransport
holds the initialize handshake in-memory per instance, and a new
instance per request means every call after the first hits a transport
that never saw the handshake.

Fixed to the documented stateful pattern: one transport+server per
mcp-session-id, stored in a Map, reused across the initialize call and
every subsequent tool call in that session.

Added: node:test unit tests for memory.js (7 cases: round-trip, [[link]]
auto-parsing both directions, relation idempotency on rewrite, index
sort/filter, FTS search, no duplicate rows on update) - all passing.
Added: test/smoke.mjs - spins up the real server, drives it with the
actual @modelcontextprotocol/sdk client, asserts on real responses.
This is what caught the transport bug; the unit tests alone would not
have (they never touch server.js).

Also: local .npmrc pointing at public npm - global ~/.npmrc on this
machine points at an internal reg.ru registry (verdaccio.dev.reg.ru),
unreachable from here and not appropriate for a personal project anyway.

Signed-off-by: Nikki Claude <nikki.claude@avallon.pw>
2026-07-31 01:01:00 +07:00
app fix: server.js was creating a fresh transport per HTTP request 2026-07-31 01:01:00 +07:00