Draft: Remove SDK private validation override and canonicalize inventory checks#54
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
validateToolInputoverride per the post-merge audit and rely on the SDK for schema-level validation while retaining handler-level ZodsafeParseas defense-in-depth.Description
server.validateToolInput = ...assignment fromlib/mcp-server.jsand preserved the handler-boundtoolSchemas.get(tool.id).safeParse(args)path that returns anisErrorcorrective result on schema failures.tests/worker.vitest.mjsto check semantic failure signals (e.g.,isError: trueand meaningful mention of field/tool) instead of exact prose, added an enum-invalid test, and preserved exact-message assertions for TrailGenic-controlled business-rule failures.19(tools) and35(resources) expectations with comparisons derived fromDATA_TOOLS,mcpTools(),resourceInventory()and root-discovery equivalence intests/worker.vitest.mjs,tests/registry.test.mjs,scripts/validate-registry.mjs, andscripts/live-acceptance.mjs.tests/worker.vitest.mjsthat asserts the Worker runtime bundle contains no Ajv import and no SDK-private assignments matchingserver.<identifier> =or._<identifier> =.BUILD.versionand package metadata from1.4.2to1.4.3inlib/registry.js,package.json, andpackage-lock.json, while leaving@modelcontextprotocol/sdkpinned at1.29.0.lib/mcp-server.js,lib/registry.js,package.json,package-lock.json,scripts/live-acceptance.mjs,scripts/validate-registry.mjs,tests/registry.test.mjs, andtests/worker.vitest.mjs.Testing
npm ciand the install completed successfully.npm run lint,npm test,npm run test:workers,npm run validate:json,npm run validate:registry, andnpm run wrangler:dry-run, and all completed successfully in the container.node scripts/live-acceptance.mjsbut it failed due to outbound networkENETUNREACHso full live acceptance could not be executed from this environment.originremote, so CI status on the PR head could not be confirmed here.Codex Task