CodeExecutor
Defined in: mcp-code/src/lib/types.ts:66
Runs untrusted JavaScript (the body of an async function — return sends the result back,
top-level await works) against a bridge. Contract, checked by CODE_EXECUTOR_CONFORMANCE_CASES:
fresh state per execution, JSON-only values across the boundary, no host capabilities beyond
mantle and console, every limit enforced with a typed error, and execute never rejects —
failures are { ok: false, error }.
Methods
Section titled “Methods”execute()
Section titled “execute()”execute(
code,bridge,limits):Promise<CodeExecutionResult>
Defined in: mcp-code/src/lib/types.ts:67
Parameters
Section titled “Parameters”string
bridge
Section titled “bridge”limits
Section titled “limits”Returns
Section titled “Returns”Promise<CodeExecutionResult>