e2b-cookbook
e2b-cookbook copied to clipboard
Remove useless sandbox kill
Sandboxes should be removed automatically, not with explicit kill().
This breaks especially the research-agent use-case where you want to open the generated page after the agent is run, or the mcp client ones where you want to connect the gateway to claude etc.
[!NOTE] Remove explicit sandbox.kill() from MCP example scripts, keeping sandboxes alive while still closing MCP connections where used.
- Examples:
- Remove explicit
sandbox.kill()cleanup across MCP examples to keep sandboxes available post-run:
examples/mcp-browserbase-js/index.ts— remove sandbox kill; closeMCPServerStreamableHttpon completion.examples/mcp-research-agent-js/index.ts— remove sandbox kill; closeMCPServerStreamableHttpon completion.examples/mcp-claude-code-js/index.ts,examples/mcp-client-js/index.ts,examples/mcp-custom-server-js/index.ts,examples/mcp-custom-template-js/index.ts,examples/mcp-groq-exa-js/index.ts— remove sandbox kill lines only.Written by Cursor Bugbot for commit 3c6a0131bb2e0ba1110e1d6f6103d0212eb65d10. This will update automatically on new commits. Configure here.