test: MCP verification harness + bump SDK floor to ^1.29.0 (#202) - #205
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughBumps ChangesSDK bump and RC-readiness verification
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…ce#202) Bump the declared @modelcontextprotocol/sdk floor from ^1.25.3 to ^1.29.0 to match the version the lockfile already resolved, readying the server for the upcoming MCP RC protocol revision. McpServer construction, tool registration, and the stdio transport use current SDK APIs and are unchanged. Add an end-to-end verification harness that drives the real server over an in-memory transport with the SDK client: initialize + protocol negotiation, the full registered tool surface (core + Alliance), and a round-trip tool call. The protocol assertions key off the SDK's LATEST_PROTOCOL_VERSION, so pinning the RC SDK re-runs the check with no test edits. Sync the SDK version references in README, PACKAGE_SPLIT_EVAL, and CHANGELOG.
6b1e5b1 to
6672e8e
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/__tests__/mcp-rc-readiness.test.ts (1)
62-71: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider typing the raw message instead of
any.The SDK already exports JSON-RPC message types from
@modelcontextprotocol/sdk/types.js(already imported forLATEST_PROTOCOL_VERSIONon line 4). Typingmessagethere would let TypeScript check the.id/.error/.resultaccess instead of suppressing the rule.Optional typing tweak
- // eslint-disable-next-line `@typescript-eslint/no-explicit-any` - clientTransport.onmessage = (message: any) => { + clientTransport.onmessage = (message: JSONRPCMessage) => { + if (!('id' in message) || message.id !== 1) return;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/__tests__/mcp-rc-readiness.test.ts` around lines 62 - 71, The test callback in mcp-rc-readiness.test.ts is using an explicit any for the raw JSON-RPC message, which bypasses type checking. Replace the any on clientTransport.onmessage with the exported JSON-RPC message type from `@modelcontextprotocol/sdk/types.js`, using the existing import pattern already used for LATEST_PROTOCOL_VERSION, so TypeScript can validate the .id, .error, and .result access. Keep the Promise handling in the test the same, just tighten the message typing in the onmessage handler.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/__tests__/mcp-rc-readiness.test.ts`:
- Around line 62-71: The test callback in mcp-rc-readiness.test.ts is using an
explicit any for the raw JSON-RPC message, which bypasses type checking. Replace
the any on clientTransport.onmessage with the exported JSON-RPC message type
from `@modelcontextprotocol/sdk/types.js`, using the existing import pattern
already used for LATEST_PROTOCOL_VERSION, so TypeScript can validate the .id,
.error, and .result access. Keep the Promise handling in the test the same, just
tighten the message typing in the onmessage handler.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2cfa7973-9ed6-43d6-971b-20a877b7ee4e
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
CHANGELOG.mdREADME.mddocs/PACKAGE_SPLIT_EVAL.mdpackage.jsonsrc/__tests__/mcp-rc-readiness.test.ts
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
=======================================
Coverage ? 85.07%
=======================================
Files ? 46
Lines ? 2399
Branches ? 826
=======================================
Hits ? 2041
Misses ? 357
Partials ? 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…-202 # Conflicts: # CHANGELOG.md
…n raw probe - CHANGELOG: the harness verifies McpServer construction and tool registration via server.connect() over the in-memory transport; the production StdioServerTransport wiring is unchanged and reviewed, not exercised (drop the overclaim that stdio is re-verified). - Raw initialize probe closes its client transport in a finally, and its onmessage handler is typed with the SDK JSONRPCMessage instead of any.
The raw-probe rework tripped the format:check gate; apply prettier --write.
Readies the server for the upcoming MCP 2026-07-28 RC protocol revision. The RC SDK is not published yet (latest is 1.29.0, no rc/next tag), so this takes the fallback path from the issue: move to the newest stable and land a harness that re-verifies the moment an RC SDK is pinned.
@modelcontextprotocol/sdkfloor from^1.25.3to^1.29.0to match what the lockfile already resolved.McpServerconstruction, tool registration, and the stdio transport use current SDK APIs and needed no changes.suggest_query_params), and a round-trip tool call that asserts seeded data comes back. A raw initialize also checks the server negotiatesLATEST_PROTOCOL_VERSIONand falls back for an unknown version.LATEST_PROTOCOL_VERSION, so pinning the RC SDK re-runs the check with no test edits.Verified locally: typecheck and
eslint src/clean, full suite green (344 tests including the five new), build passes.Closes #202.
Summary by CodeRabbit
v1.29+with aligned guidance across the project.tools/listresponses, and round-trip tool calls via in-memory transport.