mobai-mcp 2.1.0 → 2.2.0
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/dist/resources.js +46 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/resources.js
CHANGED
|
@@ -11,6 +11,12 @@ export const RESOURCES = [
|
|
|
11
11
|
description: "Testing workflow, rules, error fixes, and .mob script syntax for test generation",
|
|
12
12
|
mimeType: "text/plain",
|
|
13
13
|
},
|
|
14
|
+
{
|
|
15
|
+
uri: "mobai://claude-code-preview",
|
|
16
|
+
name: "Claude Code Preview Setup",
|
|
17
|
+
description: "How to preview a MobAI device's control UI inside Claude Code's preview panel",
|
|
18
|
+
mimeType: "text/plain",
|
|
19
|
+
},
|
|
14
20
|
];
|
|
15
21
|
export function getResourceContent(uri) {
|
|
16
22
|
switch (uri) {
|
|
@@ -18,10 +24,43 @@ export function getResourceContent(uri) {
|
|
|
18
24
|
return DEVICE_AUTOMATION_REF;
|
|
19
25
|
case "mobai://reference/testing":
|
|
20
26
|
return TESTING_REF;
|
|
27
|
+
case "mobai://claude-code-preview":
|
|
28
|
+
return CLAUDE_CODE_PREVIEW;
|
|
21
29
|
default:
|
|
22
30
|
return null;
|
|
23
31
|
}
|
|
24
32
|
}
|
|
33
|
+
const CLAUDE_CODE_PREVIEW = `<claude-code-preview>
|
|
34
|
+
Prerequisite: the MobAI desktop app must be running. It owns the
|
|
35
|
+
localhost 8787 web server the preview panel will render.
|
|
36
|
+
|
|
37
|
+
1. Call list_devices and grab the device's id and controlUrl.
|
|
38
|
+
|
|
39
|
+
2. Write .claude/launch.json at the project root (or, inside a git
|
|
40
|
+
worktree, at the worktree root):
|
|
41
|
+
|
|
42
|
+
{
|
|
43
|
+
"version": "0.0.1",
|
|
44
|
+
"configurations": [{
|
|
45
|
+
"name": "MobAI — <device name>",
|
|
46
|
+
"runtimeExecutable": "sleep",
|
|
47
|
+
"runtimeArgs": ["86400"],
|
|
48
|
+
"port": 8787,
|
|
49
|
+
"url": "<controlUrl>"
|
|
50
|
+
}]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
- runtimeExecutable + runtimeArgs is a no-op lifetime anchor for
|
|
54
|
+
Claude Code's panel; the real server is MobAI.
|
|
55
|
+
- port is the localhost port Claude Code binds the preview to;
|
|
56
|
+
always 8787 for MobAI.
|
|
57
|
+
- url is the device-specific URL (controlUrl from step 1) that the
|
|
58
|
+
panel actually displays.
|
|
59
|
+
|
|
60
|
+
3. Call the mcp__Claude_Preview__preview_start tool with the "name"
|
|
61
|
+
from the configuration above.
|
|
62
|
+
</claude-code-preview>
|
|
63
|
+
`;
|
|
25
64
|
const DEVICE_AUTOMATION_REF = `<device-automation-reference>
|
|
26
65
|
|
|
27
66
|
<guide>
|
|
@@ -57,6 +96,13 @@ const DEVICE_AUTOMATION_REF = `<device-automation-reference>
|
|
|
57
96
|
|
|
58
97
|
<workflow>Observe screen → plan → act via execute_dsl → verify (end script with wait_for stable + observe) → repeat until done.</workflow>
|
|
59
98
|
|
|
99
|
+
<per-app-skills>
|
|
100
|
+
Before working with a known app, check ~/.claude/skills/ for a skill matching its bundle id or name (e.g. com-instagram-android, uber) and load it — it may already encode selectors, flows, and quirks learned on a prior run.
|
|
101
|
+
When you discover app-specific gotchas that would cost future sessions time — unstable selectors that only work with a specific predicate, hidden taps, flows that need an extra wait_for, React Native / Flutter screens that need OCR, dialogs that hijack input — create or update a skill at ~/.claude/skills/<app-slug>/SKILL.md capturing the finding. Keep each skill short: the specific quirk, the selector/flow that works, and one sentence on why the obvious approach fails. Do not write generic mobile-automation advice there — that belongs in this reference.
|
|
102
|
+
|
|
103
|
+
Also save reusable multi-step flows as labeled mobai CLI command sequences inside the same SKILL.md. When you confirm a flow works (login, dismiss onboarding, open-settings-and-toggle-X, checkout), add a section with a heading like "## Flow: login" and a fenced shell code block of "mobai ..." commands in order — one per step. Mark variable inputs with placeholders (<EMAIL>, <OTP_CODE>) so future sessions know what to substitute. On next run, replay the commands (shell them out or translate to execute_dsl) with placeholders substituted — this avoids re-deriving the flow from scratch. Shell commands are saved (not JSON DSL) because the MobAI CLI does not execute DSL JSON blobs, and shell commands stay replayable from either CLI or MCP sessions. If a snippet breaks because the app changed, update it in place.
|
|
104
|
+
</per-app-skills>
|
|
105
|
+
|
|
60
106
|
<screenshot-tools>
|
|
61
107
|
get_screenshot — fast low-quality image for LLM visual analysis.
|
|
62
108
|
save_screenshot — full-quality PNG for reporting, debugging, or sharing.
|
package/package.json
CHANGED
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/MobAI-App/mobai-mcp",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.2.0",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "mobai-mcp",
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.2.0",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
}
|