fix(mcp): accept case-variant SSE media types - #7748
Conversation
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
📝 WalkthroughWalkthroughUpdates the MCP SDK, adds case-variant SSE discovery coverage, refreshes runtime bundle verification, and stages the new test file in the sandbox build context with matching fixture expectations. ChangesMCP SDK update and validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Test as streamable-http-client.test.ts
participant Discovery as runMcpToolDiscoverySession
participant Transport as StreamableHTTPClientTransport
participant Server as MCP HTTP server
Test->>Discovery: Start discovery session
Discovery->>Transport: Send MCP requests
Transport->>Server: initialize, tools/list, notification, DELETE
Server-->>Transport: Return SSE-formatted responses
Transport-->>Discovery: Provide parsed discovery result
Discovery-->>Test: Publish discovered tool
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
PR Review Advisor — No blocking findings reportedAdvisor assessment: No blocking advisor findings reported Model lanes
Nemotron output stays in workflow artifacts and does not change the assessment above. E2E guidanceAdvisory only. E2E / PR Gate selects and runs jobs independently. Recommended E2E: None 1 optional E2E recommendation
This automated review informs maintainers. Warnings and suggestions do not require a response. A maintainer decides whether to merge. |
|
Superseded by #7760, which preserves this exact patch on current main with a fresh GitHub-verified branch because repository rules prohibit force-pushing this published branch. |
<!-- markdownlint-disable MD041 --> ## Summary Fix managed MCP tool discovery when a compliant Streamable HTTP server returns an SSE response media type with case variation or parameters. Upgrade the official MCP SDK to its parsed media-type implementation and make the regression session part of every reviewed runtime image build. This replaces #7748 with the same patch on current `main`; the published branch could not be rebased because repository rules forbid force-pushes. ## Related Issue Fixes #7726 ## Changes - Pin `@modelcontextprotocol/sdk` to `1.30.0`, refresh the exact lock, and record the adjacent-release, provenance, vulnerability, bundle, and license review. - Add a real `initialize` → `notifications/initialized` → `tools/list` → session cleanup fixture using `Text/Event-Stream; Charset=UTF-8`. - Stage and run that fixture in the shared reviewed runtime installer used by all agent image builds. This restores the generic Streamable HTTP/SSE contract accepted in #6901 and implemented in #7591. It does not add a provider-specific integration or compatibility layer. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Quality Gates - [x] Tests added or updated for changed behavior - [ ] Existing tests cover changed behavior — justification: - [ ] Tests not applicable — justification: - [ ] Docs updated for user-facing behavior changes - [x] Docs not applicable — justification: This restores the existing documented Streamable HTTP discovery lifecycle without changing commands, flags, configuration, schemas, or supported integrations. - [x] Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging) - [x] Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification: Codex security review passed all nine repository categories; the credential placeholder, authorization, SSRF, policy, and final-image boundaries are unchanged, and the exact dependency pin is signature-, attestation-, license-, and audit-verified. - [ ] Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue: ## Documentation Writer Review - [x] Documentation writer subagent reviewed the completed changes - Result: `no-docs-needed` - Evidence: Existing docs already describe Streamable HTTP discovery generically. This restores standards-compliant handling of a valid response media type and changes no command, flag, configuration, workflow, supported protocol, or documented user contract. Changelog work remains part of separate pre-tag release preparation. - Agent: Codex Desktop `/root/replacement_docs_review` <!-- docs-review-head-sha: 646d377 --> <!-- docs-review-agents-blob-sha: be20a09 --> ## DGX Station Hardware Evidence - [ ] Tested on DGX Station - Tested commit: - Station profile/scenario: - Result: - Supporting evidence: ## Verification - [x] PR description includes a `Signed-off-by:` line and every commit appears as `Verified` in GitHub - [x] Normal `pre-commit`, `commit-msg`, and `pre-push` hooks passed, or `npm run check:diff` passed when hooks were skipped or unavailable - [x] Targeted behavior tests pass for the current change set, or tests are marked not applicable above — reviewed-runtime session test (1 passed), CLI runtime tests (12 passed), build-context/image-contract tests (15 passed), runtime and CLI typechecks, bundle allowlist/license generation, zero-vulnerability production audit, 98 verified registry signatures, and 11 verified attestations. - [ ] Applicable broad gate passed — `npm test` for broad runtime/test-harness changes; `npm run check` for repo-wide validation/coverage changes — command/result: - [x] Quality Gates section completed with required justifications or waivers - [x] No secrets, API keys, or credentials committed - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Charan Jagwani <cjagwani@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved MCP tool discovery compatibility with case-variant SSE response media types. * Preserved session and protocol headers during tool discovery requests. * **Bug Fixes** * Updated the MCP runtime to ensure supported bundled content is included correctly. * **Tests** * Added coverage for SSE discovery, authentication, session cleanup, and request headers. * Runtime installation now runs its test suite as part of verification. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Charan Jagwani <cjagwani@nvidia.com>
Summary
Fix managed MCP tool discovery when a compliant Streamable HTTP server returns an SSE response media type with case variation or parameters. Upgrade the official MCP SDK to its parsed media-type implementation and make the regression session part of every reviewed runtime image build.
Related Issue
Fixes #7726
Changes
@modelcontextprotocol/sdkto1.30.0, refresh the exact lock, and record the adjacent-release, provenance, vulnerability, bundle, and license review.initialize→notifications/initialized→tools/list→ session cleanup fixture usingText/Event-Stream; Charset=UTF-8.This restores the generic Streamable HTTP/SSE contract accepted in #6901 and implemented in #7591. It does not add a provider-specific integration or compatibility layer.
Type of Change
Quality Gates
Documentation Writer Review
no-docs-neededdocs/orfern/files changed.DGX Station Hardware Evidence
Verification
Signed-off-by:line and every commit appears asVerifiedin GitHubpre-commit,commit-msg, andpre-pushhooks passed, ornpm run check:diffpassed when hooks were skipped or unavailablenpm --prefix tools/mcp-tool-discovery-runtime test; runtime typecheck/bundle/audit; 12 CLI runtime unit tests; 15 build-context and image-contract integration tests.npm testfor broad runtime/test-harness changes;npm run checkfor repo-wide validation/coverage changes — command/result:npm run docsbuilds without warnings (doc changes only)Signed-off-by: Charan Jagwani cjagwani@nvidia.com