Symptom
elicitInput on Cloudflare Workers fails schema validation with EvalError: Code generation from strings disallowed.
Evidence what you'll see
- The report says AJV v6 builds validators with
new Function, which Workers disallow. - The failure shows up after the elicitation response is submitted, not when the method is first called.
Why it happens
The SDK's default JSON Schema validator generates code from strings. An edge runtime rejects that, so the elicitation schema never validates.
Affected versions
@modelcontextprotocol/sdk on Cloudflare Workers. The linked issue does not name an SDK version number.
Fix steps
0 of 2 done
Your check marks stay in this browser only.
How to check it worked
- Submitting an elicitation response on Workers no longer raises
EvalError: Code generation from strings disallowed.
If it still fails
- The linked issue does not describe a Workers failure on 1.21.0. A validator that still calls
new Functionwill hit the sameEvalError.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it