Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(cua-driver): mcp-config support for openclaw, opencode, hermes; pi documented as unsupported

Francesco Bonacci536d9c79155d
diff --git a/docs/content/docs/cua-driver/guide/getting-started/installation.mdx b/docs/content/docs/cua-driver/guide/getting-started/installation.mdx
index 042caedbe9..bf460f0e74 100644
--- a/docs/content/docs/cua-driver/guide/getting-started/installation.mdx
+++ b/docs/content/docs/cua-driver/guide/getting-started/installation.mdx
@@ -101,36 +101,47 @@ cua-driver stop
The MCP server is one of two ways to use cua-driver — skip this section if you only want the CLI (`cua-driver list_apps`, etc.). You can register both later, MCP and CLI work side-by-side.
-Cua Driver speaks MCP over stdio. Pick the command for your client:
+Cua Driver speaks MCP over stdio. Use `cua-driver mcp-config --client <name>` to print the right command for your client, or copy one of the snippets below directly:
-### Claude Code
+### Clients with a CLI add command
```bash
+# Claude Code (add --scope project|global as needed)
claude mcp add --transport stdio cua-driver -- /usr/local/bin/cua-driver mcp
-```
-
-Add `--scope project` to register only for the current repo, or `--scope global` for every project.
-
-### Codex (OpenAI)
-```bash
+# Codex (OpenAI)
codex mcp add cua-driver -- /usr/local/bin/cua-driver mcp
+
+# OpenClaw
+cua-driver mcp-config --client openclaw | sh
```
-### Cursor / other clients
+### Clients configured via a config file
-Cursor has no CLI for MCP — paste the JSON into `~/.cursor/mcp.json` (or your client's equivalent):
+Cursor, OpenCode, and Hermes all configure MCP servers via files. Use `mcp-config` to print the exact snippet, paste it into the right path:
```bash
+# Cursor — paste into ~/.cursor/mcp.json (or .cursor/mcp.json for project scope)
cua-driver mcp-config --client cursor | pbcopy
+
+# OpenCode (sst/opencode) — paste into opencode.json at the project root
+cua-driver mcp-config --client opencode | pbcopy
+
+# Hermes (NousResearch) — paste into ~/.hermes/config.yaml,
+# then run `/reload-mcp` inside Hermes
+cua-driver mcp-config --client hermes | pbcopy
```
-For any other client that accepts the standard `mcpServers` shape:
+For any other client that accepts the standard `mcpServers` JSON shape:
```bash
cua-driver mcp-config | pbcopy
```
+<Callout type="info">
+**Pi (badlogic/pi-mono)** does not support MCP natively. Community workarounds exist (`0xKobold/pi-mcp`, `nicobailon/pi-mcp-adapter`) but are unsupported by us.
+</Callout>
+
The client spawns `cua-driver mcp` on demand once registered.
## Uninstall
diff --git a/docs/content/docs/cua-driver/reference/cli-reference.mdx b/docs/content/docs/cua-driver/reference/cli-reference.mdx
index c4efa92ca2..28e173afe3 100644
--- a/docs/content/docs/cua-driver/reference/cli-reference.mdx
+++ b/docs/content/docs/cua-driver/reference/cli-reference.mdx
@@ -148,7 +148,7 @@ Print MCP server config or a client-specific install command.
**Flags:**
-- `--client <name>` (optional): one of `claude`, `codex`, `cursor`. Omit for the generic JSON snippet that any MCP client accepts.
+- `--client <name>` (optional): one of `claude`, `codex`, `cursor`, `openclaw`, `opencode`, `hermes`, `pi`. Omit for the generic JSON snippet that any MCP client accepts.
**Generic JSON (default):**
@@ -166,18 +166,17 @@ cua-driver mcp-config
**Client-specific install commands:**
-```bash
-cua-driver mcp-config --client claude
-# claude mcp add --transport stdio cua-driver -- /Applications/CuaDriver.app/Contents/MacOS/cua-driver mcp
-
-cua-driver mcp-config --client codex
-# codex mcp add cua-driver -- /Applications/CuaDriver.app/Contents/MacOS/cua-driver mcp
-
-cua-driver mcp-config --client cursor
-# JSON snippet to paste into ~/.cursor/mcp.json (Cursor has no CLI)
-```
-
-Pipe to `pbcopy` to put on the clipboard, or use the printed `claude` / `codex` commands directly.
+| Client | Output |
+|---|---|
+| `claude` | `claude mcp add --transport stdio cua-driver -- <path> mcp` |
+| `codex` | `codex mcp add cua-driver -- <path> mcp` |
+| `openclaw` | `openclaw mcp set cua-driver '{...}'` (CLI registry) |
+| `cursor` | JSON for `~/.cursor/mcp.json` (no CLI) |
+| `opencode` | JSON snippet for `opencode.json` (`type: "local"`) |
+| `hermes` | YAML for `~/.hermes/config.yaml`, then `/reload-mcp` inside Hermes |
+| `pi` | Errors — Pi does not support MCP natively |
+
+Pipe to `pbcopy` to put any output on the clipboard, or pass the printed `claude` / `codex` / `openclaw` commands straight to a shell.
## Trajectory recording
diff --git a/libs/cua-driver/Sources/CuaDriverCLI/CuaDriverCommand.swift b/libs/cua-driver/Sources/CuaDriverCLI/CuaDriverCommand.swift
index 885ffa8233..726b30faa6 100644
--- a/libs/cua-driver/Sources/CuaDriverCLI/CuaDriverCommand.swift
+++ b/libs/cua-driver/Sources/CuaDriverCLI/CuaDriverCommand.swift
@@ -39,24 +39,14 @@ struct MCPConfigCommand: ParsableCommand {
)
@Option(name: .customLong("client"),
- help: "Client to print the install command for: claude | codex | cursor. Omit for the generic JSON snippet.")
+ help: "Client to print the install command for: claude | codex | cursor | openclaw | opencode | hermes | pi. Omit for the generic JSON snippet.")
var client: String?
func run() throws {
let binary = resolvedBinaryPath()
switch client?.lowercased() {
case nil, "":
- let snippet = """
- {
- "mcpServers": {
- "cua-driver": {
- "command": "\(binary)",
- "args": ["mcp"]
- }
- }
- }
- """
- print(snippet)
+ print(genericMcpServersSnippet(binary: binary, includeType: false))
case "claude":
print("claude mcp add --transport stdio cua-driver -- \(binary) mcp")
case "codex":
@@ -64,26 +54,68 @@ struct MCPConfigCommand: ParsableCommand {
case "cursor":
// Cursor has no CLI — emit JSON the user pastes into
// ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
+ print(genericMcpServersSnippet(binary: binary, includeType: true))
+ case "openclaw":
+ // OpenClaw has a CLI registry — set with a JSON arg.
+ print("openclaw mcp set cua-driver '{\"command\":\"\(binary)\",\"args\":[\"mcp\"]}'")
+ case "opencode":
+ // OpenCode (sst/opencode) uses opencode.json with type:"local"
+ // and command as a single merged array.
let snippet = """
+ // paste under "mcp" in opencode.json (or opencode.jsonc):
{
- "mcpServers": {
+ "$schema": "https://opencode.ai/config.json",
+ "mcp": {
"cua-driver": {
- "command": "\(binary)",
- "args": ["mcp"],
- "type": "stdio"
+ "type": "local",
+ "command": ["\(binary)", "mcp"],
+ "enabled": true
}
}
}
"""
print(snippet)
+ case "hermes":
+ // Hermes (NousResearch) — YAML at ~/.hermes/config.yaml.
+ // Reload inside Hermes with /reload-mcp after editing.
+ let snippet = """
+ # paste under mcp_servers in ~/.hermes/config.yaml,
+ # then run /reload-mcp inside Hermes:
+ mcp_servers:
+ cua-driver:
+ command: "\(binary)"
+ args: ["mcp"]
+ """
+ print(snippet)
+ case "pi":
+ FileHandle.standardError.write(Data(
+ ("Pi (badlogic/pi-mono) does not support MCP natively — author has stated MCP support will not be added "
+ + "for context-budget reasons.\n"
+ + "Community workarounds: 0xKobold/pi-mcp, nicobailon/pi-mcp-adapter (npm).\n").utf8
+ ))
+ throw ExitCode(2)
default:
FileHandle.standardError.write(Data(
- "Unknown client '\(client!)'. Valid: claude, codex, cursor.\n".utf8
+ ("Unknown client '\(client!)'. Valid: claude, codex, cursor, openclaw, opencode, hermes, pi.\n").utf8
))
throw ExitCode(2)
}
}
+ private func genericMcpServersSnippet(binary: String, includeType: Bool) -> String {
+ let typeLine = includeType ? ",\n \"type\": \"stdio\"" : ""
+ return """
+ {
+ "mcpServers": {
+ "cua-driver": {
+ "command": "\(binary)",
+ "args": ["mcp"]\(typeLine)
+ }
+ }
+ }
+ """
+ }
+
private func resolvedBinaryPath() -> String {
// `Bundle.main.executablePath` points at the physical binary
// inside the .app bundle even when invoked via a symlink. Falls
diff --git a/libs/cua-driver/scripts/install.sh b/libs/cua-driver/scripts/install.sh
index 9f94f0b89b..cd3fafa9c6 100755
--- a/libs/cua-driver/scripts/install.sh
+++ b/libs/cua-driver/scripts/install.sh
@@ -179,10 +179,15 @@ Next steps:
• Codex (OpenAI):
codex mcp add cua-driver -- /usr/local/bin/cua-driver mcp
- • Cursor / other clients (paste JSON into the client's mcp config):
- cua-driver mcp-config --client cursor
+ • OpenClaw:
+ cua-driver mcp-config --client openclaw # prints the openclaw cmd
- For other clients accepting the generic shape:
+ • Cursor / OpenCode / Hermes (no add CLI — paste config):
+ cua-driver mcp-config --client cursor # JSON for ~/.cursor/mcp.json
+ cua-driver mcp-config --client opencode # JSON for opencode.json
+ cua-driver mcp-config --client hermes # YAML for ~/.hermes/config.yaml
+
+ For other clients accepting the generic mcpServers shape:
cua-driver mcp-config
Docs: https://github.com/trycua/cua/tree/main/libs/cua-driver