mait.sh1.132.1

Private beta: features and content may change. No warranty; use at your own risk.

Tools

What your agent can do with its private desktops, grouped by purpose, with the limits and the states a desktop goes through.

Beta
Overview

Seven tools.

Four tools have command-line equivalents; actions, adoption and unadoption exist only as tools. Every tool except xsession_adopt accepts a session's id or its name; adoption needs the exact id.

Sessions

Create, list and inspect sessions.

ToolUse it toParameters
xsession_createCreate and start a desktop session and get back its record plus the endpoint and token a viewer needs to connect. An input it does not know, such as a misspelled port name, fails the call.none required; see the options below
xsession_listList the sessions this connection owns, and optionally the unowned ones. Unowned sessions show only their id, name, state, audio and creation time, enough to choose one to adopt but not to act on.includeOrphaned (optional, default false)
xsession_get_envRead what a local program needs to reach a session: the display, authority file, runtime directory, sound path and remote desktop endpoint. There is no Wayland compositor, so the Wayland display is always empty.sessionId (required, id or name)

Why: create once, then read the attach facts instead of guessing them. A local program needs both DISPLAY and XAUTHORITY to open the display, and a viewer needs the rdp block; xsession_get_env is the one place both are reported.

Every input of xsession_create is optional:

OptionDefaultUse it to
sessionIdgeneratedChoose the id: 1 to 64 letters, digits, ., _ or -
namethe idGive it a friendly name, unique among your sessions; accepted anywhere an id is
resolution1920x1080Set the desktop size, WxH
wmnoneStart a window manager: openbox, fluxbox, icewm, twm or dwm
audiothe audio default set by your launcher, else bridgeChoose sound: off (none), on (sound to the viewer and microphone from it), host (the same, plus an output that plays on the host's audio server) or bridge (the same as on)
rdpPortfrom 33890Pick the loopback port; a port held by another session or one that cannot be bound fails the call and is never substituted
rdpTokengeneratedSupply your own token (16 to 256 letters, digits, _ or -); its strength is then yours to guarantee
displayNumberfrom 100Leave it unset: the record shows the number that was assigned. A value held by another session is skipped, and a value already claimed on the host fails the call
Control

Resize, freeze, rotate and destroy.

ToolUse it toParameters
xsession_actionStop, resume, destroy, resize or issue a new token for a session, one at a time or as a batch of up to 50 independent items. It is the one call for every change to a running session.one item (sessionId, action) or actions, never both
xsession_destroyTear a session down and remove its files.sessionId (required, id or name)

The actions of xsession_action:

ActionExtra inputsUse it to
stopforce (optional)Freeze every process the session supervises, the desktop included; nothing is torn down
resumeforce (optional)Unfreeze them
destroynoneRemove the session, as xsession_destroy does
resizewidth and height, both requiredChange the desktop size live; a connected viewer follows. The session must be running
rotate-tokennoneIssue a fresh token. Later connections need it; an open connection is not evicted

Why: change the session you have rather than starting another. Resume a stopped session before destroying it: a destroy does not thaw it first, and a batch that destroys several frozen sessions can exceed the 60-second call limit. force applies to stop and resume only: on stop it retries a session already recorded as stopped, and on resume it is the way to try to thaw a degraded one.

A batch returns one result per item with success and, on failure, an error, plus a total, succeeded and failed summary. The call itself succeeds even when every item failed, so read failed. It is refused before anything runs when it is empty, has more than 50 items or names an action that does not exist.

Ownership

Adopt and release ownership.

ToolUse it toParameters
xsession_adoptClaim a session that no connection owns and get its full record. It creates and destroys nothing, and fails if you already own the session, if its name collides with one of yours, or if it is not available.sessionId (required, the exact id, never a name)
xsession_unadoptRelease ownership of a session without destroying it. Its processes keep running, so use it only for a deliberate handoff.sessionId (required, id or name)

Why: a crash or a handoff leaves a session nobody owns. Find it with xsession_list and includeOrphaned, adopt it by its exact id, and finish it. For ordinary completion, call xsession_destroy instead of unadopting.

States

What a session can be.

StateMeaning
runningStarted and serving: the normal state after a successful create
stoppedFrozen by stop; everything is kept in place and resume returns it to running
degradedOne or more of its processes exited after a successful create. Read the component logs, then destroy it
destroyingTeardown is in progress; actions on it fail
Limits

What to expect when a call fails.

A tool failure comes back as a tool error with a message, not as a protocol error. The limits that matter:

LimitValue
Calls30 per minute across the tool prefix
One call60 seconds by default; MCP_XSESSION_TOOL_TIMEOUT_SECS changes it
Items per batch50
Viewersone RDP viewer per session
Resizeany size within the session's own limits, up to 32768 by 32768 on the desktop server this starts, and only while the session is running
Listening127.0.0.1 only; reaching a session from another machine is your own deployment choice, such as an SSH tunnel

A destroy that reports errors has still removed the session's record; the message names what could not be cleaned up. See Troubleshooting.