Integration tests will fail until the feature is deployed in E2B Cloud
production.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Enables checking template alias availability from both SDKs.
>
> - JS: Implements `checkAliasExists` in `template/buildApi.ts`, exposes
`Template.aliasExists` in `template/index.ts`, adds `AliasExistsOptions`
type and tests
> - Python: Adds `Template.alias_exists` and
`AsyncTemplate.alias_exists` wired to generated
`get_templates_aliases_{alias}` client; includes sync/async tests
> - API: Regenerates schemas/clients to include `GET
/templates/aliases/{alias}`, template build logs endpoint and
parameters, and supporting models (e.g., `TemplateAliasResponse`)
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4e577fd77888478ac83b66db7537cd2355ea050b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This adds (experimantal) support to add arbitrary MCP server from
Github.
```python
sbx = await AsyncSandbox.beta_create(timeout=600, mcp={
"github/modelcontextprotocol/servers": {
"install_cmd": "npm install",
"run_cmd": "sudo npx -y @modelcontextprotocol/server-filesystem /root",
},
})
```
or in TS with better typing:
```typescript
const sandbox = await Sandbox.betaCreate({
mcp: {
duckduckgo: {},
'github/modelcontextprotocol/servers': {
installCmd: 'npm install',
runCmd: `sudo npx -y @modelcontextprotocol/server-filesystem /root`,
},
},
timeoutMs: 600_000,
});
```
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds beta support to launch custom MCP servers (including
GitHub-defined ones) and updates MCP schemas/types; also switches
default MCP template to `mcp-gateway`.
>
> - **SDK (JS & Python)**:
> - Add beta support for `mcp` config, including dynamic GitHub-based
servers with custom `runCmd/installCmd/envs` and automatic `mcp-gateway`
startup with token.
> - Send `UNSET`/omit when `mcp` not provided to avoid API noise.
> - Change default MCP template from `mcp-gateway-v0-2` to
`mcp-gateway`.
> - **Types/Schema**:
> - Extend `McpServer` typings (JS `mcp.d.ts`, Python type hints) to
include many servers and descriptive metadata.
> - Introduce GitHub MCP types (TS `GitHubMcpServer`, Python
`GitHubMcpServerConfig`) and export in SDK surfaces.
> - Regenerate and enrich `spec/mcp-server.json` with
titles/descriptions and new server entries.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f3139b8fc2f1246c72734d8048ba277a13e3949d. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds `mcp` config support for sandbox creation across API, JS, and
Python SDKs, and updates timeout tests to use explicit request timeouts.
>
> - **API/OpenAPI**:
> - Add `McpConfig` schema and `mcp` field to `NewSandbox` in
`spec/openapi.yml` and generated TS `schema.gen.ts`.
> - **JS SDK**:
> - `SandboxApi.createSandbox` sends `mcp` in POST body
(`packages/js-sdk/src/sandbox/sandboxApi.ts`).
> - Types updated to include `components["schemas"]["McpConfig"]`.
> - **Python SDK**:
> - Extend `NewSandbox` model and sandbox create flow to accept/pass
`mcp`; async/sync APIs propagate `mcp` to POST `/sandboxes`.
> - **Tests**:
> - Increase `is_running` request timeouts in timeout tests to reduce
flakiness (JS and Python).
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
04ad4e6d4947e33523b74aba2f703fa1e9c05e72. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds beta MCP support to JS/Python SDKs with template auto-selection,
config POST, MCP URL helpers, and codegen for MCP types/schemas.
>
> - **SDKs (Beta MCP support)**:
> - **JS SDK**:
> - Add `McpServer` types and export; extend `Sandbox.betaCreate` with
`mcp` option that auto-selects `mcp-gateway-v0`, configures MCP via POST
`/config` on port `50005` with retries, and expose `betaGetMcpUrl()`.
> - Add `wait(ms)` util; generate MCP types from `spec/mcp-server.json`;
new `generate:mcp` script and dev dep `json-schema-to-typescript`.
> - **Python SDK**:
> - Generate and export `McpServer` (TypedDict); extend sync/async
`beta_create` with `mcp` option, auto-select default MCP template, POST
MCP config with retries, and add `beta_get_mcp_url()`; define `mcp_port`
and `default_mcp_template`.
> - Makefile: add `generate-mcp` target; include
`datamodel-code-generator` in tooling; update lockfile/pyproject deps.
> - **Tooling**:
> - Add `spec/mcp-server.json` schema; update codegen Dockerfile to
install `datamodel-code-generator`.
> -
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
cf3f175d310d4c242cd2e867efd801f5c04f2099. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Jonas Scholz <Jonas.Scholz@bbscholz.de>
Disable stdin (setting it to `/dev/null` for `command.run()`, but enable
to setting it to pipe, which you can send the input via
`command.sendStdin()`
This fixes issues with tools checking for stdin and then hanging
indefinitely
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Disables stdin by default and introduces a new `StartRequest.stdin`
flag to opt-in to stdin piping, updating JS/Python SDKs, version gating,
and tests.
>
> - **Spec/Protobuf**:
> - Add `optional bool stdin` to `process.StartRequest` in
`spec/envd/process/process.proto` and regenerate JS/Python protos.
> - **JS SDK**:
> - Add `ENVD_COMMANDS_STDIN = '0.3.0'` and version check; error if
`stdin === false` on older envd.
> - Extend `CommandStartOpts` with `stdin` (default `false`); pass
`stdin` to `rpc.start`.
> - **Python SDK**:
> - Add `ENVD_COMMANDS_STDIN = Version("0.3.0")` and version check
mirroring JS.
> - Extend async/sync `commands.run()` with `stdin` (default `False`);
pass to `StartRequest`.
> - Update generated `process_pb2`/`.pyi` with `StartRequest.stdin`.
> - **Tests**:
> - Update send-stdin tests to run commands with `stdin:
true`/`stdin=True`.
> - **Changeset**:
> - Minor bump for `@e2b/python-sdk` and `e2b`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
458a15187e6eadccd43540e6b8972c4d45e1bb78. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
# Description
We can simplify typing and return only SandboxInfo in SDKs as the types
are very similar (there are some extra fields in detail, which we don't
want to expose but we need them e.g. for connect)
**Changelog**
- Adds `files.getInfo`, `files.get_info` methods to the SDKs.
- Adds tests for the new methods
- Adds documentation for the above.
**Examples**
JavaScript
```js
import { Sandbox } from '@e2b/code-interpreter'
const sandbox = await Sandbox.create()
// Create a new file
await sandbox.files.write('test_file.txt', 'Hello, world!')
// Get information about the file
const info = await sandbox.files.getInfo('test_file.txt')
console.log(info)
// {
// name: 'test_file.txt',
// type: 'file',
// path: '/home/user/test_file.txt'
// }
```
Python
```py
from e2b_code_interpreter import Sandbox
sandbox = Sandbox()
# Create a new file
sandbox.files.write('test_file', 'Hello, world!')
# Get information about the file
info = sandbox.files.get_info('test_file')
print(info)
# EntryInfo(name='test_file.txt', type=<FileType.FILE: 'file'>, path='/home/user/test_file.txt')
```
---------
Co-authored-by: Jakub Novak <jakub@e2b.dev>
# Description
Fixes an issue in generating files in Docker. There has been an
incompatibility of `buf` (version `29.5`) and `protoc-gen-es` (version
`2.2.2`).
I updated `protoc-gen-es@` to `2.6.2`
Also refactored the code a little so it's easier to read
Added a CI pipeline job to check all files are properly generated
# Description
This PR allows to codegen without worrying about your environment and
dependencies for consistent outcomes in what code is generated from
openapi and envd protobuf spec. Will generate files for `js-sdk` and
`python-sdk`
- [x] create Docker image with all the pinned deps needed to codegen
- [x] create codegen script using this container with mapped volumes
- [x] adapt Makefiles to this new approach
- [x] adapt where we install the connect-python protobuf binary for this
to work
# Test
```sh
make codegen # this command is similar to `make generate` but w/o the hassle
Generating SDK code from openapi and envd spec
cd packages/js-sdk && pnpm generate
> e2b@1.2.1 generate /workspace/packages/js-sdk
> python ./../../spec/remove_extra_tags.py sandboxes templates && openapi-typescript ../../spec/openapi_generated.yml -x api_key --arr
ay-length --alphabetize --output src/api/schema.gen.ts
✨ openapi-typescript 7.6.1
🚀 ../../spec/openapi_generated.yml → src/api/schema.gen.ts [44.2ms]
cd packages/js-sdk && pnpm generate-envd-api
> e2b@1.2.1 generate-envd-api /workspace/packages/js-sdk
> openapi-typescript ../../spec/envd/envd.yaml -x api_key --array-length --alphabetize --output src/envd/schema.gen.ts
✨ openapi-typescript 7.6.1
🚀 ../../spec/envd/envd.yaml → src/envd/schema.gen.ts [22.7ms]
[...]
cd packages/python-sdk && make generate-api
All done! ✨🍰✨
```
---------
Co-authored-by: Jiri Sveceny <jiri.sveceny@icloud.com>