Skip to content

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 }.

execute(code, bridge, limits): Promise<CodeExecutionResult>

Defined in: mcp-code/src/lib/types.ts:67

string

CodeBridge

CodeLimits

Promise<CodeExecutionResult>