inspector/core/mcp
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall 6cacfa3ec5 fix(core): carry the in-progress SSE frame across chunk boundaries (#2134)
parseSSE declared currentEvent/currentData inside the read loop, so an SSE
frame whose data: line arrived in one chunk and whose terminating blank
line arrived in the next was discarded. buffer already carried a partial
LINE across reads; nothing carried a partial FRAME.

Because this is the web client's transport, the dropped frame is a
JSON-RPC response that never settles: the request hangs forever with no
rejection, no console message, and nothing in the Network tab. The
payload does not arrive corrupted, it does not arrive at all, which is
why it presents as a hang rather than an error.

It has not bitten us because Chromium and Firefox happen to deliver whole
frames at the payload sizes this transport currently sees. That is luck,
not a guarantee: chunk boundaries depend on payload size, TCP
segmentation, and any intermediary. The exposure grows with payload size,
so a large resources/read is the most likely first victim.

The fix hoists both out of the loop and adds an end-of-stream flush — a
server that closes without a final blank line has still delivered a
complete frame, and dropping it would lose the last message of every such
stream.

parseSSE is now exported, solely so the test can reach it. That is the
only way to hit this deterministically: driving a real transport cannot
steer where a chunk boundary lands, but a test that supplies the reader
can put it exactly on the terminator.

The test keeps the two PASSING cases (whole frame, split mid-payload)
alongside the three that failed, because they are what make the diagnosis
precise. This is not "SSE parsing is broken" — mid-payload splits are
handled correctly today, and only the frame-terminator boundary loses
data. Verified against the unfixed code: 3 of 5 fail, all 5 pass after.

Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-25 23:59:37 -04:00
..
__tests__ feat: allow complex JSON values in request _meta 2026-08-23 12:23:40 -04:00
import chore(deps): migrate to eslint 10 to clear the brace-expansion DoS advisory (#1900) 2026-08-01 20:13:30 -04:00
node Merge remote-tracking branch 'origin/v2/main' into v2/fix/2071-oauth-resource-metadata 2026-08-24 21:26:59 -04:00
remote fix(core): carry the in-progress SSE frame across chunk boundaries (#2134) 2026-08-25 23:59:37 -04:00
state feat: allow complex JSON values in request _meta 2026-08-23 12:23:40 -04:00
appElicitation.ts fix(apps): address review of app-rendered elicitations 2026-08-22 19:43:44 -04:00
apps.ts SDK v2 migration (behavior-neutral, versionNegotiation: 'legacy') (#1624) 2026-07-15 10:44:24 -04:00
config.ts chore: close quality-gate coverage gaps (#1689) (#1766) 2026-07-24 17:20:12 -04:00
elicitationCreateMessage.ts fix(core): register peer-request handlers before connect (#1797) (#1798) 2026-07-27 11:32:23 -04:00
extensions.ts feat(apps): negotiated app-rendered form elicitations 2026-08-22 19:05:33 -04:00
fetchTracking.ts Network: modern Mcp-* headers, new error codes, cancellation-as-abort (#1628) (#1722) 2026-07-18 17:32:05 -04:00
index.ts fix: salvage a list result's valid entries when one is malformed (#1909) 2026-08-15 16:52:11 -04:00
inspectorClient.ts Merge branch 'v2/main' into v2/feat/2068-refresh-token-toggle 2026-08-24 22:55:00 -04:00
inspectorClientEventTarget.ts feat: allow complex JSON values in request _meta 2026-08-23 12:23:40 -04:00
inspectorClientProtocol.ts feat: allow complex JSON values in request _meta 2026-08-23 12:23:40 -04:00
listSalvage.ts fix: return the era-parsed tool, and hide aggregate reports in paginated mode (#1909) 2026-08-15 20:08:03 -04:00
messageTrackingTransport.ts Tasks: io.modelcontextprotocol/tasks extension on modern servers (era fork) (#1731) 2026-07-21 19:17:04 -04:00
modernTaskSchemas.ts Tasks: io.modelcontextprotocol/tasks extension on modern servers (era fork) (#1731) 2026-07-21 19:17:04 -04:00
oauthManager.ts Merge branch 'v2/main' into v2/fix/2117-persist-requested-scope 2026-08-25 08:51:45 -04:00
samplingCreateMessage.ts fix(core): register peer-request handlers before connect (#1797) (#1798) 2026-07-27 11:32:23 -04:00
serverList.ts Merge branch 'v2/main' into v2/fix/2096-stdio-env-cwd-revert 2026-08-25 08:55:35 -04:00
sessionStorage.ts feat(core): port v1.5 hook layer (#1243) (#1300) 2026-05-13 17:43:07 -04:00
taskNotificationSchemas.ts SDK v2 migration (behavior-neutral, versionNegotiation: 'legacy') (#1624) 2026-07-15 10:44:24 -04:00
toolCallCancelledError.ts fix(web): send a cancellation notification when cancelling an ordinary tool call (#1458) (#1463) 2026-06-13 22:23:02 -04:00
toolOutputValidation.ts Refactor / justify codebase-wide 'as unknown as' casts (#1690) (#1756) 2026-07-24 09:34:32 -04:00
typedEventTarget.ts Test/1396 harden managed state connect tests (#1508) 2026-06-24 10:46:09 -04:00
types.ts Merge branch 'v2/main' into v2/feat/2068-refresh-token-toggle 2026-08-24 22:55:00 -04:00
uriTemplate.ts fix: scope the value ceiling to the names a template references 2026-08-17 01:54:37 -04:00
urlElicitation.ts Address @claude review: format core/, typed output-validation error, document progress heuristic 2026-07-15 11:08:54 -04:00