capsulate

v0.7.1
io.github.capsulatedev/capsulate Checked 3 days ago Published 20 days ago

Real Linux and Windows desktop VMs for AI agents: exec, files, computer-use and snapshots via MCP.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

capsulate_launch Launch a capsule

Launch a new isolated cloud sandbox (capsule) and (by default) wait until it is ready. Returns the capsule id and connection info. Use the returned sessionId for exec/files/etc. With skill, the capsule is the skill's environment (its saved template with the software set up) and the skill's setup procedure has run, so you can use its procedures right away.

ParameterTypeDescription
bundlestringSoftware bundle (Bucket B) id to launch from
envobjectEnvironment variables to inject
regionstringRegion hint; omit for automatic placement
sizestringResource size, e.g. '2c4g' (default, or the skill's)
skillstringLaunch a skill's environment and run its setup (a skill name from capsulate_skills)
skillVersionintegerWith skill: launch this version (default the current one)
snapshotstringSnapshot/template id to restore from
templatestringTemplate / OS / bundle id, e.g. 'ubuntu-22.04-headless' (not needed with skill)
waitbooleanWait until ACTIVE (default true)

capsulate_list List capsules

List the team's active capsules.

capsulate_get Get a capsule

Fetch a capsule's full details by id.

ParameterTypeDescription
sessionId *string

capsulate_destroy Destroy a capsule

Terminate a capsule and release its resources.

ParameterTypeDescription
sessionId *string

capsulate_exec Run a command

Execute a command inside a capsule and return stdout, stderr, and the exit code. Provide the command as an argv array, e.g. ['ls','-la','/workspace']. Commands first: files, installs, settings, scripts and data are one call here, a fraction of a second, where the screen takes many steps. On a Linux desktop capsule it runs as the desktop user 'capsulate' (home folder, DISPLAY :1, so apps open on the shared screen); prefix 'sudo' for root. On Windows pass ['powershell.exe', '-Command', '<script>']: it runs in the desktop session's PowerShell, about 0.3 s. It works while a person holds the screen…

ParameterTypeDescription
command *arrayCommand as an argv array
sessionId *string
cwdstring
timeoutSecnumber

capsulate_run_code Run code

Run a snippet of code inside a capsule: python, node or bash on Linux, powershell on Windows (about 0.3 s). Returns stdout/stderr/exit. Faster than doing the same on the screen.

ParameterTypeDescription
code *string
sessionId *string
langstring
timeoutSecnumber

capsulate_write_file Write a file

Write a UTF-8 text file inside a capsule (the folder is created). One call, far faster than typing it into an editor on the screen; open it afterwards with capsulate_open if the person should see it.

ParameterTypeDescription
content *string
path *string
sessionId *string

capsulate_read_file Read a file

Read a UTF-8 text file from inside a capsule. One call, no screen needed.

ParameterTypeDescription
path *string
sessionId *string

capsulate_set_env Set environment variables

Set environment variables inside a running capsule.

ParameterTypeDescription
sessionId *string
vars *object
secretboolean

capsulate_screenshot Take a screenshot

Capture a screenshot of a desktop capsule. Returns the image so you can see the screen. For a smaller, faster image ask for format 'jpeg', a scale such as 0.5, or only a region (x, y, w, h) of the screen; the text after the image says how its points map back to screen pixels, which click and the other tools take.

ParameterTypeDescription
sessionId *string
formatstringpng (default) or jpeg (smaller)
hnumberRegion: height
qualitynumberJPEG quality, 1 to 100 (default 75)
scalenumberShrink the image to this fraction of the screen, 0.1 to 1
wnumberRegion: width
xnumberRegion: left edge, in screen pixels
ynumberRegion: top edge

capsulate_click Click

Click at pixel (x, y) in a desktop capsule. Pass screenshot:true to see the screen after the click.

ParameterTypeDescription
sessionId *string
x *number
y *number
buttonstring
countnumber
screenshotbooleanCapture a screenshot after the action and return it
screenshotDelayMsnumberSettle delay (ms) before that screenshot so it reflects the result (max 10000)

capsulate_type Type text

Type text into the focused field of a desktop capsule.

ParameterTypeDescription
sessionId *string
text *string
screenshotbooleanCapture a screenshot after the action and return it
screenshotDelayMsnumberSettle delay (ms) before that screenshot so it reflects the result (max 10000)

capsulate_key Press keys

Press keys in a desktop capsule, in order. Each entry is one key or a '+'-joined chord (xdotool names): ['ctrl+c'] copies, ['ctrl+l', 'Return'] focuses then submits, ['alt+F4'] closes a window. A bare modifier followed by a key is joined into a chord, so ['ctrl','v'] also pastes.

ParameterTypeDescription
keys *arrayKeys or chords, e.g. ['ctrl+s'] or ['Escape']
sessionId *string
screenshotbooleanCapture a screenshot after the action and return it
screenshotDelayMsnumberSettle delay (ms) before that screenshot so it reflects the result (max 10000)

capsulate_snapshot Snapshot a capsule

Capture a snapshot of a capsule's current state (restorable later).

ParameterTypeDescription
sessionId *string
namestring

capsulate_catalog List templates & bundles

List the operating systems / base templates and marketplace bundles you can launch.

capsulate_move Move the pointer

Move the mouse pointer of a desktop capsule to (x, y) in screen pixels.

ParameterTypeDescription
sessionId *string
x *number
y *number
screenshotbooleanCapture a screenshot after the action and return it
screenshotDelayMsnumberSettle delay (ms) before that screenshot so it reflects the result (max 10000)

capsulate_scroll Scroll

Scroll at (x, y) in a desktop capsule. dy > 0 scrolls down, dy < 0 up; dx scrolls sideways. Units are wheel clicks.

ParameterTypeDescription
sessionId *string
x *number
y *number
dxnumber
dynumber
screenshotbooleanCapture a screenshot after the action and return it
screenshotDelayMsnumberSettle delay (ms) before that screenshot so it reflects the result (max 10000)

capsulate_drag Drag

Press at (x1, y1), drag to (x2, y2) and release, in a desktop capsule. Or draw along a path: path is a list of [x, y] points (at most 1000), pressed at the first and released at the last, for curves, circles, signatures and any shape a hand draws. smooth draws a curve through the points instead of straight lines; closed returns to the first point (eight points on a circle with smooth and closed make a round circle); stepMs is the pause between points (8 ms by default; apps such as Paint need about that to see every point). The button is honoured (right paints with Paint's second color).

ParameterTypeDescription
sessionId *string
buttonstring
closedboolean
patharray[[x, y], ...] in screen pixels
screenshotbooleanCapture a screenshot after the action and return it
screenshotDelayMsnumberSettle delay (ms) before that screenshot so it reflects the result (max 10000)
smoothboolean
stepMsnumber
x1number
x2number
y1number
y2number

capsulate_ui_tree Read the UI tree

Return the accessibility tree of a desktop capsule (AT-SPI on Linux, UI Automation on Windows): roles, names, values, states and screen rectangles with centers (cx, cy) you can click. Far cheaper and more exact than reading a screenshot.

ParameterTypeDescription
sessionId *string
interestingbooleanOnly actionable or labelled nodes (default true)
maxDepthnumberDepth limit (default the server's)
windowstringOnly the window whose title contains this

capsulate_find_element Find UI elements

Find accessible elements by role / name / text in a desktop capsule. Each match has a center (cx, cy) to click.

ParameterTypeDescription
sessionId *string
exactbooleanRequire an exact match instead of a substring
limitnumber
namestringAccessible name (label) to match
rolestringAccessible role, e.g. 'button', 'menu item', 'text', 'terminal' (Linux AT-SPI) or 'Button', 'Edit' (Windows UI Automation)
statestringRequire a state, e.g. 'enabled', 'visible', 'focused'
textstringMatch against the name OR the value
windowstring

capsulate_wait_element Wait for a UI element

Wait until an accessible element matching the selector appears (for example after a page load).

ParameterTypeDescription
sessionId *string
exactbooleanRequire an exact match instead of a substring
namestringAccessible name (label) to match
rolestringAccessible role, e.g. 'button', 'menu item', 'text', 'terminal' (Linux AT-SPI) or 'Button', 'Edit' (Windows UI Automation)
statestringRequire a state, e.g. 'enabled', 'visible', 'focused'
textstringMatch against the name OR the value
timeoutMsnumberDefault 10000
windowstring

capsulate_click_element Click a UI element

Find an accessible element (waiting for it if needed) and click its center. The reliable way to press a named button or link.

ParameterTypeDescription
sessionId *string
buttonstring
countnumber2 for a double click
exactbooleanRequire an exact match instead of a substring
namestringAccessible name (label) to match
rolestringAccessible role, e.g. 'button', 'menu item', 'text', 'terminal' (Linux AT-SPI) or 'Button', 'Edit' (Windows UI Automation)
statestringRequire a state, e.g. 'enabled', 'visible', 'focused'
textstringMatch against the name OR the value
waitMsnumberHow long to wait for the element (default 5000)
windowstring

capsulate_clipboard Read or set the clipboard

Without `text`, return the desktop capsule's clipboard. With `text`, put that text on the clipboard (then paste with ctrl+v). Pasting long text is faster and safer than typing it.

ParameterTypeDescription
sessionId *string
textstring

capsulate_windows List or focus windows

Without a target, list the open windows of a desktop capsule. With `id` or `title`, bring that window to the front. To minimize, maximize, move, resize or close one, use capsulate_window.

ParameterTypeDescription
sessionId *string
idstring
titlestring

capsulate_ocr Read the text on screen

OCR the desktop capsule's screen (or a region) and return the words with their boxes. Use when the UI tree has no labels (canvas apps, images).

ParameterTypeDescription
sessionId *string
hnumber
wnumber
xnumber
ynumber

capsulate_element Act on a UI element

Act on the accessible element a selector finds, without coordinates: set_value (replace a field's text, or a slider's value, with value), clear, toggle (a check box), expand or collapse (a menu, combo box or tree item), invoke (press a button, follow a link), select (a list item, tab or radio button; with value, the option of that name inside a combo box or list), focus, scroll_into_view. Prefer it to clicking and typing at guessed coordinates: it acts on exactly the element you name. Roles match across systems ('button', 'push button' and 'Button' are the same); a multi-line editor is 'docume…

ParameterTypeDescription
action *string
sessionId *string
exactbooleanRequire an exact match instead of a substring
indexnumberWhich match when several do (0, the first, in capsulate_find_element's order)
namestringAccessible name (label) to match
rolestringAccessible role, e.g. 'button', 'menu item', 'text', 'terminal' (Linux AT-SPI) or 'Button', 'Edit' (Windows UI Automation)
statestringRequire a state, e.g. 'enabled', 'visible', 'focused'
textstringMatch against the name OR the value
valuestringFor set_value, the new text; for select, the name of the option to choose inside the element
windowstringOnly within the window whose title contains this

capsulate_window Manage a window

Minimize, maximize, restore, close, move, resize or focus a window of a desktop capsule, by id (from capsulate_windows) or a part of its title. move takes x, y (the new top-left corner); resize takes w, h (each at least 50). close asks the app to close, as the title bar's close button does, so it may first ask to save. Returns the window afterwards (none after close).

ParameterTypeDescription
action *string
sessionId *string
hnumberFor resize: the new height (at least 50)
idstringWindow id from capsulate_windows
titlestringA part of the window's title
wnumberFor resize: the new width (at least 50)
xnumberFor move: the new left edge, in screen pixels
ynumberFor move: the new top edge

capsulate_open Open a URL, a file or an app

Open a URL (in the default browser), a file (in its default app) or an app by name on a desktop capsule, instead of hunting through menus. Without kind it is guessed: a path (/, ~, C:\) is a file, a scheme (https:, mailto:) or www. is a URL, anything else is an app name (a Linux menu entry such as 'Text Editor', a Windows Start menu entry such as 'Notepad', or a program on the path). Pass waitMs to wait for the new window and get it back. For web pages you will read or fill in, capsulate_browser_open is faster and more exact.

ParameterTypeDescription
sessionId *string
target *stringA URL, a file path or an app name
kindstringDefault: guessed from the target
waitMsnumberWait up to this long for the new window and return it (at most 30000)

capsulate_wait_for Wait for a condition

Wait in the capsule until a condition holds, instead of sleeping or taking screenshot after screenshot: present (an element matching the selector is there), absent (none is any more: a dialog closed, a spinner went away), enabled (a matching element can be used), text (an element's name or value contains text; the selector is optional), window (a window whose title contains window is open), screen_stable (nothing on screen changed for stableMs: an app or page finished drawing). Returns met (true or false), waitedMs and what matched. The wait never holds up the capsule's other calls.

ParameterTypeDescription
condition *string
sessionId *string
exactbooleanRequire an exact match instead of a substring
namestringAccessible name (label) to match
rolestringAccessible role, e.g. 'button', 'menu item', 'text', 'terminal' (Linux AT-SPI) or 'Button', 'Edit' (Windows UI Automation)
stableMsnumberFor screen_stable: how long nothing may change (default 600, at most 10000)
statestringRequire a state, e.g. 'enabled', 'visible', 'focused'
textstringFor text: what the name or value must contain. For present, absent and enabled: match the name OR the value
timeoutMsnumberDefault 10000, at most 120000
windowstringFor window: a part of the title to wait for. For the element conditions: only within that window

capsulate_screen_info Read the screen's size

The screen's size in pixels, the pointer's position and the active window of a desktop capsule. Use it instead of a screenshot when that is all you need.

ParameterTypeDescription
sessionId *string

capsulate_control Who is driving the screen

Read or change who drives a desktop capsule's shared screen. state 'free' (nobody), 'agent' (you; every input renews a 45 s hold) or 'human' (a person; your input is refused until they hand it back). action 'status' (default) reads it, 'take' claims it for you, 'release' lets go when you finish so the person can use the screen, 'pace' sets how your input plays while a person watches: 'natural' (the pointer glides, typing is readable) or 'presentation' (slow enough to follow every step); 'fast' is the default. action 'visible' turns visible mode on or off (when the person asks to see every step…

ParameterTypeDescription
sessionId *string
actionstring
carestringFor action 'care'
notestringOptional note shown on the console
pacestringFor action 'pace'
visiblebooleanFor action 'visible'

capsulate_handoff Hand the screen to a person

Hand the desktop capsule's screen to the person watching, with a note saying exactly what you need (sign in, solve a CAPTCHA, approve a payment, check something). The console shows 'The AI needs you' with your note. Then waits until they press Done, hand back, and returns their note. Use this instead of typing passwords or secrets yourself.

ParameterTypeDescription
note *stringWhat the person should do, in one or two plain sentences
sessionId *string
waitSecondsnumberHow long to wait for the hand back (default 300, max 900). 0 returns at once.

capsulate_wait_for_handback Wait for the person to hand back

Wait until the person holding the desktop capsule's screen hands it back. Returns at once when nobody holds it. Returns their note.

ParameterTypeDescription
sessionId *string
waitSecondsnumberDefault 300, max 900

capsulate_say Narrate to the person watching

Show one short line on the live console of a desktop capsule, e.g. 'Opening the settings to change the theme'. Narrate each step so the person watching knows what you are doing and why.

ParameterTypeDescription
sessionId *string
text *stringOne short sentence (max 500 characters)

capsulate_browser_open Open the browser

Open the agent's own Chrome on a desktop capsule (the person watching sees it) and optionally load a url. For web pages prefer the capsulate_browser_* tools: they read the page as text with refs and act at page speed, faster and more exact than screenshots and clicks.

ParameterTypeDescription
sessionId *string
urlstring

capsulate_browser_navigate Go to a url

Load a url in the browser's current tab and wait for it.

ParameterTypeDescription
sessionId *string
url *string
tabstring

capsulate_browser_snapshot Read the page

Read the current page as an outline of elements with refs, e.g. [e12] link "Pricing". Act on them by ref with the other browser tools. Refs stay valid until the element goes away; take a new snapshot after the page changes.

ParameterTypeDescription
sessionId *string
interactivebooleanOnly elements you can click or type into (shorter)
maxnumberMost elements to list (default 400)
tabstring

capsulate_browser_click Click in the page

Click an element of the page by ref (from capsulate_browser_snapshot), CSS selector or visible text.

ParameterTypeDescription
sessionId *string
buttonstring
clicksnumber2 for a double click
refstringA ref from capsulate_browser_snapshot, e.g. 'e12' (most exact)
selectorstringA CSS selector
textstringVisible text or accessible name of the element

capsulate_browser_fill Type into a field

Type a value into a field (replacing what is there); submit presses Enter after. Never use it for passwords or card numbers: hand the screen to the person instead (capsulate_handoff).

ParameterTypeDescription
sessionId *string
value *string
refstringA ref from capsulate_browser_snapshot, e.g. 'e12' (most exact)
selectorstringA CSS selector
submitboolean
textstringVisible text or accessible name of the element

capsulate_browser_select Choose an option

Choose an option of a dropdown (<select>) by its value or label.

ParameterTypeDescription
option *string
sessionId *string
refstringA ref from capsulate_browser_snapshot, e.g. 'e12' (most exact)
selectorstringA CSS selector
textstringVisible text or accessible name of the element

capsulate_browser_press Press keys in the page

Press keys in the page, in order: 'Enter', 'Tab', 'Escape', 'ArrowDown', 'PageDown' or a single character.

ParameterTypeDescription
keys *array
sessionId *string

capsulate_browser_scroll Scroll the page

Scroll the page by dy pixels (negative scrolls up), or bring an element into view by ref, selector or text.

ParameterTypeDescription
sessionId *string
dynumber
refstringA ref from capsulate_browser_snapshot, e.g. 'e12' (most exact)
selectorstringA CSS selector
textstringVisible text or accessible name of the element

capsulate_browser_wait Wait for the page

Wait until an element or text appears (or, with state 'hidden', goes away). Without a target, waits for the page to finish loading.

ParameterTypeDescription
sessionId *string
refstringA ref from capsulate_browser_snapshot, e.g. 'e12' (most exact)
selectorstringA CSS selector
statestring
textstringVisible text or accessible name of the element
timeoutMsnumberDefault 10000, at most 110000

capsulate_browser_text Read text

The page's visible text, or one element's (by ref, selector or text).

ParameterTypeDescription
sessionId *string
maxnumberMost characters (default 20000)
refstringA ref from capsulate_browser_snapshot, e.g. 'e12' (most exact)
selectorstringA CSS selector
textstringVisible text or accessible name of the element

capsulate_browser_screenshot Screenshot the page

A screenshot of the browser page only (fast, small JPEG). For the whole desktop use capsulate_screenshot.

ParameterTypeDescription
sessionId *string
fullPageboolean

capsulate_browser_tabs Browser tabs

List the browser's tabs, or open (new, with url), switch to (select) or close one (by tab id).

ParameterTypeDescription
sessionId *string
actionstring
tabstring
urlstring

capsulate_browser_eval Run JavaScript in the page

Evaluate a JavaScript expression in the page and return its JSON value (awaits promises). For reading data the outline does not show.

ParameterTypeDescription
expression *string
sessionId *string

capsulate_menus List an application's menus

List every menu of the focused window (or the window whose title contains window) with its items, read by opening each menu and closing it again. The quick way to learn what an application can do before you explore it; it takes a few seconds and the person watching sees the menus open.

ParameterTypeDescription
sessionId *string
windowstring

capsulate_run_actions Run several steps in one call

Run a list of steps on a desktop capsule in ONE call, back to back; the run stops at the first step that fails. Prefer it over one call per step whenever you know what comes next. Each step is {do: verb, ...that verb's fields}: screen: click {x, y, button?, count?}, type {text}, key {keys: ['ctrl+s']}, move {x, y}, scroll {x, y, dx, dy}, drag {x1, y1, x2, y2, button?} or {path: [[x, y], ...], smooth?, closed?, stepMs?, button?} (a stroke through the points), screenshot {format?, scale?, x?, y?, w?, h?}, ui_tree, find_element {selector}, wait_element {selector, timeoutMs}, clipboard, clipboard_…

ParameterTypeDescription
sessionId *string
steps *array
framesobjectCoordinate frames steps may name, e.g. {canvas: {origin: [346, 176], scale: 0.42, clamp: [[0, 0], [900, 1200]]}}
observestring
skillstringThe skill use steps call when they name none

capsulate_skills Skills: what was learned before, and what you learned

The team's skills. action 'list' (query?) lists them; 'get' (skill, version?, part?: 'all' | 'instructions' | 'spec') reads one, its instructions, procedures, traps and environment, so you do not have to discover the application again. 'save' keeps what you learned: skillMd (a whole SKILL.md) or name + description (what it does and when to use it) + instructions (Markdown), and spec (capsulate/skill.json: environment, frames, inputs, procedures as run_actions steps with {{param}} placeholders, checks, traps) and files. It creates the skill, or adds a proposed version when the team has one by t…

ParameterTypeDescription
action *string
descriptionstringFor save: what the skill does and when to use it (at most 1024 characters)
filesarrayFor save: other files of the skill folder
forcebooleanFor save as current, or approve: skip the rehearsal (the owner's call)
instructionsstringFor save: the SKILL.md body in Markdown
keepbooleanFor rehearse: keep the fresh capsule after the rehearsal
lessonIdstringFor save: the lesson this skill was learned from
namestringFor save: lowercase letters, digits and hyphens, e.g. krita-painting
notestringFor save or approve: what changed, or why
onbooleanFor weekly: turn the weekly rehearsal on or off
partstringFor get: everything (default), only the SKILL.md, or only the spec (the procedures' steps)
querystringFor list: words to match in the name or description
sessionIdstringFor environment: the capsule to save as the skill's environment
setupstringFor environment: the procedure a launch runs once the capsule is ACTIVE
skillstringThe skill's name (or id, skl_...)
skillMdstringFor save: the whole SKILL.md (frontmatter with name and description, then instructions)
specobjectFor save: capsulate/skill.json {kind?, apps?, environment?, frames?, inputs?, procedures?, checks?, traps?}
statestringFor save: the new version's state
versioninteger

capsulate_skill_run Run a skill in the background

Run a skill's procedure (or steps that call its procedures) in the background, with no time limit: the stored steps replay and you are asked only where the skill leaves a decision open. action 'start' (sessionId, skill, procedure? default main, inputs?, steps?, frames?, version?; or launch: true to start the skill's environment for the run, keep? to keep it) starts it and waits up to waitMs (default 20000) for it to end or to need you. 'get' (runId, waitMs?) reads it; 'continue' (runId with values answering its question, or action 'retry' or 'skip', or steps to run instead of a stuck step) goe…

ParameterTypeDescription
action *string
continueActionstringFor continue: run the stuck step again, or go on without it
framesobjectFor start: coordinate frames the steps may name
inputsobjectFor start: the skill's inputs
keepbooleanFor start with launch: keep the capsule after the run
launchbooleanFor start: launch the skill's environment for the run
notestring
procedurestringFor start: the procedure (default main)
runIdstring
sessionIdstringFor start: the capsule to run on
skillstringFor start or list: the skill's name
statusstringFor list: e.g. needs_input,needs_help
stepsarrayFor start: steps instead of a procedure; for continue: steps to run instead of the stuck step
valuesobjectFor continue: the answer to the run's question
versioninteger
waitMsintegerHow long to wait for the run to end or need you (default 20000 for start and continue)

capsulate_inbox What waits for someone

The team's inbox: runs that ask a question or are stuck on a step, versions waiting for approval, versions whose rehearsal failed, and skills whose software changed. Each item says what to do next.

capsulate_lesson Lessons: learn a skill on a capsule

A lesson records how a job is done on a capsule so it can become a skill. While it records, every action taken on the capsule through these tools is logged in full, a person's clicks, keys and typing on the shared screen are recorded with the elements they hit (typing in a password field is masked), and keyframes are taken. action 'start' (sessionId, title, goal?, mode: 'ai' to teach yourself toward the goal, 'human' when a person teaches on the shared screen; skill? it improves); 'note' (lessonId, text, screenshot?) for what you learned or a trap; 'pause', 'resume', 'finish', 'discard' (lesso…

ParameterTypeDescription
action *string
descriptionstringFor draft into a new skill: what it does and when to use it
goalstringFor start: what the lesson should achieve
lessonIdstring
modestringFor start: ai (you explore toward the goal) or human (a person teaches)
screenshotbooleanFor note: take a keyframe with it
sessionIdstringFor start and on: the capsule the lesson happens on
skillstringFor start: a skill this lesson improves; for draft: the skill to draft into or to create
statusstringFor list
textstringFor note
titlestringFor start: what is taught, e.g. 'Export a PDF in LibreOffice'
videobooleanFor start: record a video of the screen too (Linux capsules)
voicebooleanFor start (human): the person may explain out loud in the console; their voice becomes text in the digest