mcp-use TypeScript API
    Preparing search index...

    Class E2BCodeExecutor

    E2B-based code executor using remote sandboxes. Executes code in an E2B sandbox with tool calls proxied back to the host.

    Hierarchy (View Summary)

    Index
    • Clean up the E2B sandbox. Should be called when the executor is no longer needed.

      Returns Promise<void>

    • Create a search function for discovering available MCP tools. Used by code execution environments to find tools at runtime.

      Returns SearchToolsFunction

    • Execute JavaScript/TypeScript code in an E2B sandbox with MCP tool access. Tool calls are proxied back to the host via the bridge pattern.

      Parameters

      • code: string

        Code to execute

      • timeout: number = 30000

        Execution timeout in milliseconds (default: 30000)

      Returns Promise<ExecutionResult>