@devicecloud.dev/dcd 5.11.0-beta.1 → 5.11.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -36,9 +36,56 @@ See full documentation: [Docs](https://docs.devicecloud.dev)
36
36
 
37
37
  ## MCP server
38
38
 
39
- The same npm package ships an [MCP](https://modelcontextprotocol.io) server (`dcd-mcp` bin) so AI agents — Claude, Cursor, VS Code — can drive devicecloud.dev directly.
39
+ devicecloud.dev has an [MCP](https://modelcontextprotocol.io) server, so AI agents (Claude, Cursor, VS Code) can run cloud tests and drive cloud devices. You don't run it yourself. You add it to your MCP client's config, and the client starts it.
40
40
 
41
- Add it to your MCP client config:
41
+ There are three ways to connect:
42
+
43
+ | | Install | Tools | Use it when |
44
+ | --- | --- | --- | --- |
45
+ | **`dcd mcp`** (recommended) | the CLI | device tools + `dcd_*` cloud-test tools | you want everything, including installing a local build or running local flow files |
46
+ | **Hosted** `https://api.devicecloud.dev/mcp` | nothing | device tools | the agent only drives devices, with apps and flows that are already uploaded or at a URL |
47
+ | **`dcd-mcp`** | the CLI | `dcd_*` cloud-test tools | you only run cloud tests (the older server; `dcd mcp` covers it) |
48
+
49
+ ### `dcd mcp`
50
+
51
+ `dcd mcp` connects to the hosted server and passes its device tools through. It adds what only a local process can do: `install_app` takes `app_path` (a build on your machine, uploaded first) and `run` takes `path` (a flow file, or a directory uploaded as a bundle). It also serves the `dcd_*` tools below.
52
+
53
+ Claude Code:
54
+
55
+ ```sh-session
56
+ $ claude mcp add devicecloud -- npx -y @devicecloud.dev/dcd mcp
57
+ ```
58
+
59
+ Other clients:
60
+
61
+ ```jsonc
62
+ {
63
+ "mcpServers": {
64
+ "devicecloud": {
65
+ "command": "npx",
66
+ "args": ["-y", "@devicecloud.dev/dcd", "mcp"]
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ If the CLI is installed globally, use `"command": "dcd", "args": ["mcp"]` instead.
73
+
74
+ It signs in the same way as the CLI: run `dcd login` once, or set `DEVICE_CLOUD_API_KEY` in `env`. Add `--read-only` to the args (or set `DCD_MCP_READONLY=1`) to serve only the tools that change nothing. If the hosted server can't be reached, it serves the `dcd_*` tools only and says why on stderr.
75
+
76
+ **Device tools:** `list_devices`, `start_device`, `get_device_status`, `install_app`, `launch_app`, `inspect_screen`, `take_screenshot`, `run`, `get_command_status`, `get_logs`, `request_human`, `get_human_status`, `stop_device`, and `cheat_sheet` (Maestro syntax for the agent).
77
+
78
+ ### Hosted
79
+
80
+ Point an HTTP-capable client at the URL. It signs you in through the browser (OAuth), and you can disconnect it later under Settings → Connected apps.
81
+
82
+ ```sh-session
83
+ $ claude mcp add --transport http devicecloud https://api.devicecloud.dev/mcp
84
+ ```
85
+
86
+ ### `dcd-mcp`
87
+
88
+ The older server, with the `dcd_*` tools only. Add it to your MCP client config:
42
89
 
43
90
  ```jsonc
44
91
  {
@@ -56,7 +103,7 @@ Add it to your MCP client config:
56
103
 
57
104
  Auth is inherited from the CLI: set `DEVICE_CLOUD_API_KEY` as above, or run `dcd login` once and the server picks up the stored session. Point it at a non-prod environment with `DCD_API_URL`.
58
105
 
59
- **Tools**
106
+ **`dcd_*` tools** (served by both `dcd mcp` and `dcd-mcp`)
60
107
 
61
108
  | Tool | What it does |
62
109
  | --- | --- |
@@ -0,0 +1,36 @@
1
+ import { type DeviceCatalogue, type DeviceScreenElement, type DeviceSession } from '../types/domain/device-session.types.js';
2
+ /**
3
+ * The platform a `--model` belongs to, from GET /device/models. Matches the
4
+ * model id (iphone-16) or its name (iPhone 16), ignoring case. Unknown, or on
5
+ * both platforms: a usage error that says to pass --platform.
6
+ */
7
+ export declare function platformOfModel(catalogue: DeviceCatalogue, model: string): 'android' | 'ios';
8
+ /**
9
+ * The "Next steps" `dcd device start` prints. They follow the session: a
10
+ * device that isn't ready yet can't be inspected, so that comes first, and
11
+ * a session with no app gets the install step.
12
+ */
13
+ export declare function startNextSteps(session: DeviceSession, hasApp: boolean): [string, string][];
14
+ /** One element on one line: what to target it by, then its bounds. */
15
+ export declare function formatElement(el: DeviceScreenElement): string;
16
+ /** `data:image/jpeg;base64,...` to bytes and a file extension. */
17
+ export declare function decodeDataUrl(dataUrl: string): {
18
+ bytes: Buffer;
19
+ ext: string;
20
+ };
21
+ /** `--env KEY=VALUE`, given once or several times. */
22
+ export declare function parseEnvFlags(value: unknown): Record<string, string> | undefined;
23
+ /** Every value of a repeatable flag; citty keeps only the last one. */
24
+ export declare function collectFlagValues(flag: string, rawArgs: string[]): string[];
25
+ /**
26
+ * citty drops a string flag's value when it starts with `-`, as a flow's
27
+ * first command does (`--yaml "- launchApp"`). Read it from argv instead.
28
+ */
29
+ export declare function recoverFlagValue(flag: string, parsed: string | undefined, rawArgs: string[]): string | undefined;
30
+ /**
31
+ * The lines of `next` that `prev` has not shown. Each fetch is the log's
32
+ * last N lines, so the overlap is the longest end of `prev` that `next`
33
+ * starts with. No overlap: everything in `next` is new.
34
+ */
35
+ export declare function newLogLines(prev: string[], next: string[]): string[];
36
+ export declare const deviceCommand: import("citty").CommandDef<import("citty").ArgsDef>;