- Startseite
- Plugins
- Tools & Funktionen
- dsh-cua-desktop
dsh-cua-desktop
cotton1candy/dsh-cua-desktop
Connects the computer-use runtime bundled in the ChatGPT desktop app to a DSH profile as a stdio MCP server, exposing its persistent JavaScript kernel as the mcp__cua__js tool for clicking, typing, scrolling, accessibility trees and screenshots in Chrome and any macOS app. Needs ChatGPT.app, the Codex/ChatGPT Chrome extension, and macOS Accessibility and Screen Recording permissions.
Installation
dsh plugin --profile web add github:cotton1candy/dsh-cua-desktopREADME
dsh-cua-desktop
A DSH bundle that gives every agent in the profile hands-on control of Chrome and any macOS app, using the computer-use runtime that already ships inside ChatGPT.app — the same runtime Codex desktop uses for its computer-use feature.
That runtime does not need the ChatGPT app process, and in its local browser mode it never
calls OpenAI. cua_repl is a local MCP stdio server that runs a persistent JavaScript kernel
with the cua API.
DSH agent → mcp__cua__js
│
▼
/bin/sh bootstrap (finds a Node runtime, materialises the launcher)
│
▼
cua-repl (ChatGPT.app/Contents/Resources/cua_node/…/@oai/cua-repl)
│
▼
node_repl (MCP stdio server, persistent JS kernel)
├── browser service ──► ChatGPT browser extension ──► Chrome (native messaging)
└── sky service ──► SkyComputerUseService ──► macOS AX + screen
Installed with plugin_manager install_bundle; it lives at the profile level, so it applies to
every workspace and every session in the profile, not to the folder it was built in.
Tools
| Tool | What it is |
|---|---|
mcp__cua__js | Run JavaScript in a persistent kernel: cua.getApp(), cua.listApps(), cua.getBrowser(), cua.createBrowserTab(), cua.getTab(), plus per-target click, typeText, pressKey, scroll, getAXState, getScreenshot, Playwright locators, and nodeRepl.write() / nodeRepl.emitImage(). |
mcp__cua__js_reset | Drop all JavaScript bindings and start a fresh kernel. |
mcp__cua__js_add_node_module_dir | Add a node_modules directory for import inside the kernel. |
The js description is the runtime's own documentation (API reference, accessibility
workflow, computer-use confirmation policy). turn_ended is intentionally hidden: the
launcher drives it itself when the MCP server shuts down.
Requirements
- ChatGPT.app in
/Applications(override withDSH_CUA_CHATGPT_APP). The bundle reads the runtime out ofChatGPT.app/Contents/Resources; the app is never launched. - Chrome + the Codex/ChatGPT browser extension (
hehggadaopoacecdllhhajmbjkdcmajg) installed, enabled, and its native-messaging host (com.openai.codexextension) registered. - macOS Accessibility (required) and Screen Recording (screenshots) for the
computer-use helper, i.e.
SkyComputerUseService/ Codex Computer Use. If the ChatGPT app has used computer use before, these are already granted.
No configuration is required.
Configuration
The patch declares each knob explicitly because DSH strips DSH_* names from MCP child
environments. Set them in the DSH process environment before starting DSH:
| Variable | Default | Meaning |
|---|---|---|
DSH_CUA_SURFACES | browser,computer | Which surfaces to enable (browser, computer). |
DSH_CUA_APPROVALS | accept | How to answer the runtime's approval elicitations: accept, deny, or forward (for clients that can render them). |
DSH_CUA_WAKE_CHROME | 1 | Wake Chrome's extension host when nothing is listening. 0 disables. |
DSH_CUA_DEFAULT_TIMEOUT_MS | 180000 | Default per-js-call timeout injected when the agent omits timeout_ms. |
DSH_CUA_CHATGPT_APP | /Applications/ChatGPT.app | Alternate app bundle. |
DSH_CUA_NODE | discovered | Node executable for the launcher. |
DSH_CUA_DEBUG | 0 | 1 logs discovery/approval decisions to the MCP server's stderr. |
What the launcher does beyond starting the runtime
- Discovery. Finds
cua_node,cua-repl, the browser service (app bundle or the newest~/.codex/plugins/cache/openai-bundled/browser/*), the localcodexCLI, the Sky service bundle and the app version on every start. CODEX_CLI_PATH.node_replneeds a sandbox supervisor. Without one it runs the kernel unsandboxed, the privileged native-pipe bridge never reaches the browser trusted worker, and the Chrome backend silently reports zero browsers. The supervisor is thecodexbinary inside ChatGPT.app — a local process that only listens on stdio.- Turn metadata. The browser backend refuses to work without
x-codex-turn-metadata(session_id,turn_id). Codex sends it per tool call; DSH does not, so the launcher injects it into everytools/call. - Approvals. The first time an app is driven, the Sky backend asks
Allow Computer Use to use "<app>"?as an MCP elicitation. DSH's MCP client cannot render form elicitations, so the request used to fail the call. The launcher advertises the capability to the runtime on DSH's behalf and answers the request (acceptby default, logged withDSH_CUA_DEBUG=1). SetDSH_CUA_APPROVALS=denyto refuse instead. - Chrome wake-up. Chrome spawns the extension's native-messaging host lazily. With the ChatGPT app closed and Chrome idle there is no host, so no browser is discovered. The launcher activates Chrome once (and opens one blank tab only if that is not enough) and waits for the host socket to accept a connection.
- Tab lifetime. Codex closes the tabs it created via a
turn_endedhook at the end of a turn. DSH has no such boundary, so the launcher sendsturn_endedwhen the MCP server shuts down; during a session the agent should close what it opened (await tab.close()) or mark what must survive (tab.markDeliverable()).
Sandbox: what the kernel can and cannot do
Every process the runtime spawns is supervised by the codex sandbox. Observed launch line:
codex sandbox -c default_permissions="node_repl" \
-c permissions.node_repl={filesystem = {... = "read", ":root" = "read"},
network = {enabled = false}} \
-- node --experimental-vm-modules kernel.js
Consequences worth knowing:
- The JavaScript kernel has no network access. Navigating a page is done by Chrome, not by the kernel; the kernel cannot fetch anything itself.
- The kernel's filesystem is read-only. Screenshots and other binary results must come
back through
nodeRepl.emitImage(...);fs.writeFileSyncinside the kernel fails withEPERMby design.
A live session was measured to open no non-loopback sockets from any process in its tree
(python → launcher → cua_repl → node_repl → codex sandbox / codex app-server).
Troubleshooting
| Symptom | Cause and fix |
|---|---|
browsers: [] with no error | No listening extension host. Restart Chrome, or let the launcher wake it (DSH_CUA_DEBUG=1 shows the decision). A host that was killed mid-flight can stay wedged until Chrome restarts. |
Missing required Codex turn metadata | The launcher did not inject metadata — check that the MCP server being used is this bundle's row. |
nodeRepl.createElicitation is unavailable | The run bypassed the launcher; the raw cua_repl server cannot answer approvals for DSH. |
EPERM writing a file from the kernel | Expected: the kernel is read-only. Use nodeRepl.emitImage. |
| No apps, only browsers | Sky service missing or Accessibility permission revoked for the computer-use helper. |
Verify
node src/cua-runtime.cjs --print-config # what it discovered
node src/cua-runtime.cjs --selftest # start the runtime, print app/browser counts
Development
node scripts/build-patch.mjs # regenerate cordis.patch.yml from src/cua-runtime.cjs
cordis.patch.yml is generated: it embeds src/cua-runtime.cjs because a linked bundle
cannot know its own installed path when the patch is composed. Edit the source, rebuild, then
remove_bundle + install_bundle to pick up patch changes (locale/docs are read live).
Verified
- Chrome through the extension: tab create/navigate/AX read/screenshot/close, on
example.comandexample.org, with the ChatGPT app both running and quit. - Native macOS AX:
Calculator,TextEditandGoogle Chromeaccessibility trees plus screenshots. - Installed row:
plugin_managerreportsapplication: applied;list_bundlesshowsdsh-cua-desktop1.0.0,enabled: true, rowcua-runtime→@deepseek-ai/dsh-mcp-client, and the three tools appear in a live agent tool list. - Cold start with ChatGPT.app quit: native apps worked immediately; Chrome needed the extension host, which the launcher wakes.
Ähnliche Plugins
archify (deepseek-harness)
tt-a1i/archify
WeKnora (dsh-weknora)
tencent/weknora
next-ai-draw-io (dsh-plugin)
dayuanjiang/next-ai-draw-io
AiToEarn (dsh-plugin-aitoearn)
yikart/aitoearn