Add default JSON schema validator to MCP client#665
Conversation
Introduces CfWorkerJsonSchemaValidator as the default jsonSchemaValidator in MCP client options. Ensures that client instantiation includes schema validation by default, improving reliability and consistency.
🦋 Changeset detectedLatest commit: 998252c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Claude Code ReviewPotential Issue: Validator Instance Sharing The change creates a single shared CfWorkerJsonSchemaValidator instance at module level (line 30-31) that will be reused across all MCP client instances. Depending on the validator's implementation, this could cause issues if:
Recommendation: Consider creating a new validator instance per client to avoid potential state/concurrency issues, OR verify that CfWorkerJsonSchemaValidator is stateless/thread-safe and document this assumption. Otherwise: The change looks reasonable - adds validation by default while allowing overrides, includes proper changeset. |
Adds documentation for the CfWorkerJsonSchemaValidator that is now included by default in MCP client connections. This improves transparency about the default validation behavior and helps users understand that tool parameters are automatically validated. Synced from cloudflare/agents#665 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
📚 Documentation sync in progress A documentation PR has been created to reflect the changes from this PR: Documentation PR: cloudflare/cloudflare-docs#26620 The documentation updates include:
The docs PR is ready for review and will be merged once this PR is approved and merged. 🤖 Generated with Claude Code |
Introduces CfWorkerJsonSchemaValidator as the default jsonSchemaValidator in MCP client options. Ensures that client instantiation includes schema validation by default, improving reliability and consistency.
Adds documentation for the CfWorkerJsonSchemaValidator that is now included by default in MCP client connections. This improves transparency about the default validation behavior and helps users understand that tool parameters are automatically validated. Synced from cloudflare/agents#665 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
Introduces CfWorkerJsonSchemaValidator as the default jsonSchemaValidator in MCP client options. Ensures that client instantiation includes schema validation by default, improving reliability and consistency.