/v1/sandbox/{sandbox_id}/fs. All operations take a sandbox_id and, where they act on a path, a path query parameter.
Read and write bodies are raw bytes (
application/octet-stream) — not tar archives, not multipart form data. Each call moves exactly one file’s contents.Reading a file
string
required
Path to the file.
200 with the raw file contents as application/octet-stream.
fs_read returns the file’s contents as a UTF-8 string, since MCP tool calls carry inline text rather than binary bytes.
Writing a file
string
required
Path to write to.
application/octet-stream). Returns 204 on success — no response body.
fs_write takes UTF-8 text content and creates or overwrites the file, returning { ok: true, path, bytes }.
Uploading and downloading a local file
There’s no dedicated REST endpoint for upload/download — the CLI and SDKs implement it as a local file streamed through the same raw-bytesfs/read and fs/write endpoints above.
fs upload/download tool — MCP tool calls carry inline UTF-8 text, not binary file transfers, so fs_read/fs_write are the only way to move file contents through MCP.
Listing a directory
string
required
Directory path to list.
FsListResponse: { "files": [ ...FsFileInfo ] }.
fs_list returns { files: [{ path, name, kind, size, mode, modified_at_unix_nanos }, ...] }.
Getting file metadata
string
required
Path to stat.
FsStatResponse: { "file": { ...FsFileInfo } }.
fs_stat returns { file: { path, name, kind, size, mode, modified_at_unix_nanos } }.
FsFileInfo fields
string
required
Full path.
string
required
Base name.
string
required
One of
UNSPECIFIED, FILE, DIRECTORY, SYMLINK, OTHER.integer
required
Size in bytes.
integer
required
Permission bits as reported by the guest, 0–4095.
integer
required
Last-modified time.
Creating a directory
FsMkdirRequest):
string
required
Directory path to create.
201 on success.
fs_mkdir creates the directory (and any missing parents), returning { ok: true, path }.
Renaming or moving
FsRenameRequest):
string
required
Source path.
string
required
Destination path.
200 on success.
fs_rename covers this, returning { ok: true, from, to }.
Deleting
string
required
Path to remove.
boolean
default:"false"
Whether to remove a non-empty directory recursively.
204 on success.
fs_delete covers this — pass recursive: true to delete a non-empty directory. Returns { ok: true, deleted: path }.