MCP
Covers: poema-mcp, the MCP server that lets Claude Code or another MCP client work in instances: its install, its tools
and what it never does.
For: developers who give a coding agent instances to work in, and agents that read their own tool list.
poema-mcp is an MCP server that lets Claude Code, or another MCP client, create and work in instances: it makes them,
runs commands and edits files in them, suspends them when idle and forks them to try several approaches. It is how an
agent on your machine drives poema cloud, and not the MCP servers an agent running in an instance uses, which are set on
New instance (Deploy from git).
Set it up
The Python SDK installs poema-mcp (Quickstart). It reads the same variables as the SDK.
For Claude Code:
claude mcp add poema -e POEMA_URL=https://api.client-test.poema.dev -e POEMA_API_KEY=poema_ns_... -- poema-mcp
Any other MCP client runs the same command, over stdio, with the same two variables.
With the CLI installed too, sign in once instead, and give it no variables: it reads the key poema login keeps.
poema login --url https://client-test.poema.dev claude mcp add poema -- poema-mcp
It reads that key when it starts: after the next poema login, restart the MCP server.
Claude Code has to find poema-mcp: put ~/.venvs/poema/bin on its PATH, or give the full path.
Tools
The tools, grouped by what they do. Each answers a failure with its error, for the client to act on.
Make and manage instances
sandbox_createmakes a new instance and waits until it runs, up to 2 minutes: a name, and optionally animage(poema's base image unless given),workspaces, agateway, amodel,env(its environment variables, names to values),labels(on its Task),timeout_seconds(it is suspended that many seconds after it starts, asspec.timeoutSeconds, at most your plan's session length, which also applies when none is given), ahostof poema's fleet to run on, which it waits for and is never moved from, andallowed_tools, the tools it may call on its workspaces' MCP servers by server name (the workspaces that declare one are copied for it, and deleted with it). It refuses a name an instance already has. Without a gateway an instance has no network;defaultreaches package registries and git hosts. One that cannot start within 2 minutes is an error saying why; the instance stays and starts by itself once it can, sosandbox_deleteit if you no longer want it.sandbox_suspendsuspends an instance and waits until it is: it stops using compute, and its memory and files are kept.sandbox_resumewakes it and waits until it runs.sandbox_forkforks an instance into new ones, 1 to 100 names, each running on a copy of its/workspace(withmemory, of its memory too), and waits until they run. The instance is suspended first and stays so until resumed. Forks count toward the instances you may run at once.sandbox_set_timeoutsuspends itsecondsfrom now (from when it next starts, if it is not running), at most your plan's session length; 0 sets that length.sandbox_deletedeletes an instance and its workspace.task_startmakes a new instance that runs its own command, an agent such asclaude -p "...", with whatsandbox_createtakes. It needs no timeout: your quota caps what it spends. When its command ends it is suspended, andsandbox_statusandsandbox_logsgive its exit code and the last 16 KiB of its output. Such an instance is never forked, and once its command has endedsandbox_resume,sandbox_runand the file tools refuse it, as a resume may run its command again. One that cannot start within 2 minutes is an error saying why; the instance stays and starts by itself once it can, sosandbox_deleteit if you no longer want it.
Commands and files
sandbox_runruns a shell command (bash -lc) to its end, in/workspaceunless given acwd, with no stdin, and returns its exit code and output. One still running after its timeout, 120 seconds unless given, is killed and returns its output so far.- The command and file tools need an instance made with Access from your machine (
debug: true); thosesandbox_createandtask_startmake always have it. sandbox_read_fileandsandbox_write_fileread and write a file, the write making its directories.sandbox_list_fileslists the files and directories under apath,/workspaceunless given, to adepthof levels, 1 unless given: a line each, a directory's path ending in/and a file's followed by its size in bytes.
Read what is there
sandbox_listlists the instances and their phases.sandbox_statussays an instance's phase and why (its conditions' messages), its image, gateway and model, when its timeout suspends it, a line each, then its last 10 events.sandbox_logsreturns the lasttaillines its own command printed, 200 unless given.workspace_list,gateway_listandmodel_listlist your organization's, with no key, no user in a URL, no server arguments and no environment values.quota_getshows your limits and what is used, andusage_getyour spend (optionally from astartday to anendday).mcp_server_toolslists the names of the tools of an MCP server that one of your workspaces declares, so that you can chooseallowed_tools; never the server's own descriptions.
Annotations
Each tool carries MCP's tool annotations for the client. sandbox_list, sandbox_status, sandbox_logs,
sandbox_read_file, sandbox_list_files and the views above are read-only. sandbox_run, sandbox_write_file and
sandbox_delete are destructive, as they can overwrite or remove files. Of the tools that change something, all but
sandbox_run, sandbox_set_timeout and task_start are idempotent. task_start is marked destructive, not idempotent and open-world: its command can
reach whatever its Gateway allows, so a client asks you first. mcp_server_tools is open-world too, as it asks an MCP
server outside poema. The other tools reach poema's instances only.
What it never does
It works on your organization's instances, including those made on the dashboard, and can read anything inside one
through sandbox_run. The agent itself chooses allowed_tools for the instances it makes. It never makes or shows a key, never changes who has access, a plan, a limit or money, and never
widens which sites an instance may reach: a person does those on the dashboard or in the CLI (Team and access,
Network rules). It opens no terminal, port forward or SSH.
Last checked: unreleased checkout.