stateset-computer-use MCP server: previewing, triggering, polling,
retrieving results, using idempotency keys, or working with agent_type templates.
Environment
- API base:
https://api.computer.stateset.app/api/v1 - Auth header on every call:
X-API-Key: $STATESET_CUA_API_KEY - Never put an API key in a prompt, file, example, log or commit.
Preferred workflow
- Discover allowed task types with
GET /templates, or MCPstateset_cua_list_templates. - Preview any non-trivial task with
POST /jobs/preview, or MCPstateset_cua_preview_task. - Trigger with
POST /trigger, or MCPstateset_cua_trigger_task. - Send an
Idempotency-Keyon every trigger. Use a stable key for the same logical task, so a retry after a timeout does not run it twice. - For a simple client,
POST /jobs/{job_id}/waitwith{"timeout_seconds": 30}. For a long-running task, pollGET /jobs/{job_id}or consume SSE untilstatusissucceeded,failedorcancelled. - Fetch
GET /jobs/{job_id}/resultfor the summary and artifact pointers.
Trigger payload
Minimum:model—haiku,sonnet,opus, or a canonical model ideffort—low,mediumorhighmax_cost_usd— a per-job budget ceilingtags— up to 20 labels, e.g.["tenant:acme", "flow:approval"]output_schema— a JSON Schema the final answer is validated against, caller-sidewebhook_urlandwebhook_secret— a one-shot completion callback
MCP tools
When thestateset-computer-use MCP server is available, prefer its tools over raw HTTP:
stateset_cua_preview_task · stateset_cua_trigger_task · stateset_cua_trigger_batch ·
stateset_cua_get_job · stateset_cua_wait_for_result · stateset_cua_get_result ·
stateset_cua_list_jobs · stateset_cua_list_templates · stateset_cua_get_template
curl
Safety
- Set
max_cost_usdon exploratory or large tasks. - Preview before any batch submission.
- Never retry without an idempotency key.
- Treat artifact storage keys as pointers; use the dashboard or the authenticated artifact download endpoints to read them.
Further reading
- Computer Use API reference — all 90 v1 endpoints
- Computer Use MCP servers — hosted and local
- Computer Use Agent — how a job executes