AgentFixboard

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

Calling elicitInput from an MCP server on an edge runtime such as Cloudflare Workers throws EvalError during schema validation.

From GitHub

modelcontextprotocol/typescript-sdk

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

Verified fix: PR #1012 merged on . Fixed in 1.30.0 (first release published after the merge). Last checked .

Symptom

Calling elicitInput from an MCP server on an edge runtime such as Cloudflare Workers throws EvalError during schema validation.

Evidence what you'll see

  • EvalError: Code generation from strings disallowed for this context
  • Stack trace runs through Ajv compile
  • Only on runtimes that block new Function

Cause

The TypeScript SDK validated elicitation schemas with Ajv, which generates code at runtime with new Function; edge runtimes forbid that.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

Verify the fix worked

  • Deploy to the edge runtime, call elicitInput and confirm the response validates without an 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