fix(cloudflare): use Worker-safe validation for MCP - #236
Merged
l1shen merged 1 commit intoJul 30, 2026
Conversation
Summary by CodeRabbit
WalkthroughThe Cloudflare MCP executor now configures its MCP client with Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
CfWorkerJsonSchemaValidatorRoot cause
The MCP SDK client defaults to AJV for JSON Schema validation. When Cloudflare's MCP server advertises tool
outputSchemavalues, AJV compiles them withnew Function(...). Cloudflare Workers disallow runtime code generation from strings, so credential validation and MCP requests fail with:The SDK's Cloudflare-specific validator uses
@cfworker/json-schemaand performs validation withoutevalornew Function.Impact
Cloudflare-hosted Open Connector deployments can validate Cloudflare MCP credentials and invoke its tools. Node deployments retain the same behavior.
Because the provider is currently broken on Cloudflare in v1.3.3, could this be included in a patch release after review?
Validation
node scripts/typecheck.ts src scripts-all examplesvitest run(61 files, 590 tests)Functiondisabled and MCPoutputSchemavalues present