1a51777cc0
Previously the gateway was just fire and forget which lead to a race condition when you immediately tried to access the mcp server, changed the template to launch a daemon with healthcheck. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Start MCP gateway synchronously with error checks and bump default MCP template to `mcp-gateway-v0-2` across JS and Python SDKs. > > - **MCP Gateway startup**: > - JS (`packages/js-sdk/src/sandbox/index.ts`): Start `mcp-gateway` without background mode; validate exit code and throw on failure. > - Python Async (`packages/python-sdk/e2b/sandbox_async/main.py`): Await `mcp-gateway` start, remove background/timeout flags; raise on non-zero exit. > - Python Sync (`packages/python-sdk/e2b/sandbox_sync/main.py`): Run `mcp-gateway` synchronously; check exit code and raise on failure. > - **Defaults**: > - Update `default_mcp_template` from `mcp-gateway-v0-1` to `mcp-gateway-v0-2` in JS and Python SDKs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 79e431c78bf384c970a5b1fede55071116a089c5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
What is E2B?
E2B is an open-source infrastructure that allows you to run AI-generated code in secure isolated sandboxes in the cloud. To start and control sandboxes, use our JavaScript SDK or Python SDK.
Run your first Sandbox
1. Install SDK
npm i @e2b/code-interpreter
2. Get your E2B API key
E2B_API_KEY=e2b_***
3. Execute code with code interpreter inside Sandbox
import { Sandbox } from '@e2b/code-interpreter'
const sbx = await Sandbox.create()
await sbx.runCode('x = 1')
const execution = await sbx.runCode('x+=1; x')
console.log(execution.text) // outputs 2
4. Check docs
Visit E2B documentation.
5. E2B cookbook
Visit our Cookbook to get inspired by examples with different LLMs and AI frameworks.
