Agent FixboardAgentFixboard

Elicitation fails on edge runtimes with 'Code generation from strings disallowed'

elicitInput on Cloudflare Workers fails schema validation with EvalError: Code generation from strings disallowed.

From GitHub

modelcontextprotocol/typescript-sdk

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
1.21.0
Last checked

Verified fix: PR #1012 merged on . Fixed in 1.21.0 (first published release whose tag contains the merge commit). Last checked .

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 Function will hit the same EvalError.

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