Skip to content

chore: bump @metamask/device-mcp to ^0.10.0 - #134

Merged
cryptotavares merged 1 commit into
mainfrom
cryptotavares/bump-device-mcp-0.10.0
Dec 2, 2026
Merged

cryptotavares merged 1 commit into
mainfrom
cryptotavares/bump-device-mcp-0.10.0

Conversation

@cryptotavares

Copy link
Copy Markdown
Collaborator

Part of the mm CLI v2 effort.

Summary: Bump @metamask/device-mcp from ^0.9.0 to ^0.10.0. This picks up MetaMask/device-mcp#65: on iOS, mm type <field> "" now succeeds instead of failing with MM_TYPE_FAILED.

Problem

Core pins ^0.9.0. On 0.x, a caret range does not pick up a new minor, so core does not get 0.10.0. With device-mcp 0.9.0 on iOS, mm type <field> "" clears the field, then runs idb ui text "", which exits 1. The field is empty, but the call fails, so a script cannot tell this expected case from a real failure.

mm type --testid <search field> ""   (device-mcp 0.9.0, iOS)

idb ui key 4 --command                  select all
idb ui key 42                           backspace
idb ui text  --udid <udid>              exit 1: ('Request was not sent',)

→ exit 4  MM_TYPE_FAILED

Solution

Bump the range to ^0.10.0. Core's code and API do not change. The fix is in device-mcp's IdbBackend.typeText: empty text returns after the select-all and Backspace clear. Non-empty text takes the same path as before.

flowchart TD
    A["typeText(text)"] --> B["ui key 4 (select all)"]
    B --> C["ui key 42 (backspace)"]
    C --> D{"text empty?"}
    D -->|yes| E["return. Field is empty."]
    D -->|no| F["idb ui text text"]
    F --> G["return. Field has text."]

    classDef new fill:#fff3cd,stroke:#d39e00
    class D,E new
Loading

Yellow boxes are new.

What changes

Call (iOS) Before (0.9.0) After (0.10.0)
mm type <field> "" exit 4 MM_TYPE_FAILED; field empty exit 0, textLength: 0
mm type <field> "text" exit 0 No change
Android mm type <field> "" exit 0 since 0.9.0 No change

Decisions for reviewers

Decision Reason
chore:, not feat: Core's API does not change. The new behaviour comes from device-mcp.
No CHANGELOG.md entry The changelog is generated at release.
Consumers bump their own device-mcp to ^0.10.0 The consumer creates the backend from its own copy of device-mcp, so the iOS fix lives there. Core resolves its own HermesClient.
No new core tests The behaviour is covered by device-mcp #65. Core has no workaround for the empty-text failure to update.

Consumer changes

Mobile and Extension bump @metamask/device-mcp to ^0.10.0 with this core. On Mobile, core alone does not fix type "": the consumer's own device-mcp copy must be 0.10.0 too.

Review guide

# File What to check
1 package.json, yarn.lock ^0.10.0. yarn dedupe leaves one device-mcp entry, at 0.10.0.
2 README.md The dependency range and the consumer range.
Testing
  • yarn build exits 0.
  • yarn lint exits 0.
  • CI=1 yarn test exits 0: 76 files, 2914 tests. Coverage 98.14 / 95.5 / 97.51 / 98.23. The floors do not change.
  • Live check on the iOS simulator (real funds, read-only account list search field, no account selected): npm core 0.15.0 with device-mcp 0.9.0 before; this branch via yalc with the consumer's device-mcp at 0.10.0 after.
Step Before After
mm type --testid multichain-account-selector-search-input "zz" exit 0, textLength: 2 exit 0, textLength: 2
mm type --testid multichain-account-selector-search-input "" exit 4, MM_TYPE_FAILED exit 0, textLength: 0

Before:

$ mm type --testid multichain-account-selector-search-input ""
exit 4
{"ok":false,"error":{"code":"MM_TYPE_FAILED","message":"Operation failed: Command failed: idb ui text  --udid <udid>\nExit code: 1\nstderr: ('Request was not sent',)\n","retryable":false}}

After:

$ mm type --testid multichain-account-selector-search-input ""
exit 0
{"typed":true,"target":"testId:multichain-account-selector-search-input","textLength":0}
Release contents (device-mcp v0.9.0...v0.10.0)

No export, type or signature that core uses changed: HermesClient, TargetObscuredError, the backend types and HermesCdpResult are unchanged. #65 is the only behavioural change.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​device-mcp@​0.9.0 ⏵ 0.10.088100100 +198 +180

View full report

@socket-security

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Potential code anomaly (AI signal): npm @metamask/device-mcp is 96.0% likely to have a medium risk anomaly

Notes: This module implements Hermes CDP discovery and command execution. Its main security concern is that executeVerifiedCdpCommand() connects to the discovery-provided WebSocket URL without calling the available localhost/port validation helper, allowing a malicious discovery response to trigger a connection to an unintended host. It also sends caller-supplied CDP methods and parameters, while the exported blocked-method check is not applied in this function. No credential theft or other clear malware behavior is present; severity is a security warning dependent on control of the discovery response or caller inputs.

Confidence: 0.96

Severity: 0.55

From: package.json → npm/@metamask/device-mcp@0.10.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/device-mcp@0.10.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@cryptotavares
cryptotavares marked this pull request as ready for review November 27, 2026 19:30
@cryptotavares
cryptotavares requested a review from a team as a code owner November 27, 2026 19:30
@cryptotavares
cryptotavares merged commit 42c1976 into main Dec 2, 2026
27 checks passed
@cryptotavares
cryptotavares deleted the cryptotavares/bump-device-mcp-0.10.0 branch December 2, 2026 19:17
cryptotavares added a commit to MetaMask/skills that referenced this pull request Dec 4, 2026
…6.1 and @metamask/device-mcp 0.10.0 (#329)

## Description

> **Summary:** Updates `testing/mobile-visual-testing` for
`@metamask/client-mcp-core`
[0.16.1](https://github.com/MetaMask/client-mcp-core/releases/tag/v0.16.1)
and `@metamask/device-mcp` 0.10.0. Five claims in the skill are now
wrong, the most important being that an ambiguous ref can tap another
element. Each fix was checked against the `v0.16.1` code and a live run.

Companion Mobile PR: MetaMask/metamask-mobile#41237. Previous update:
#298 (Mobile #40496).

### Problem

An agent that follows the current skill expects the wrong outcome in
five places:

- An `ambiguous` or label-only ref "can tap another element" ([core
#127](MetaMask/client-mcp-core#127)). A `click`
now taps the listed node at its bounds. The other target commands refuse
such a ref.
- An unknown command with no daemon "exits 3"
([#126](MetaMask/client-mcp-core#126)). It exits
2 before any daemon starts.
- `--timeout abc` "is dropped without an error" (#126). It exits 2 once
a daemon runs, and 3 without one.
- iOS `mm type <field> ""` "exits 4 with `MM_TYPE_FAILED`"
([#134](MetaMask/client-mcp-core#134),
device-mcp 0.10.0). It exits 0.
- The daemon log line "ends with the outcome"
([#133](MetaMask/client-mcp-core#133)). It now
also names the target.

The `cdp` port order also gains the port that the consumer's launch
resolved ([#128](MetaMask/client-mcp-core#128)).

```mermaid
flowchart TD
    S["describe-screen: node ref"] --> Q{"unique testId,<br/>label or text?"}
    Q -->|yes| ANY["every target command"]
    Q -->|"no: unnamed or ambiguous: true"| T{"command?"}
    T -->|click| B["tap at bounds, target ends in (bounds)"]
    B -->|element moved| NF["MM_TARGET_NOT_FOUND, nothing tapped"]
    T -->|"type, wait-for, get-text,<br/>scroll-to-element, long-press"| R["MM_TARGET_NOT_FOUND, exit 4, hint"]

    classDef new fill:#fff3cd,stroke:#d39e00
    classDef stop fill:#f8d7da,stroke:#c82333
    class B new
    class NF,R stop
```

Yellow boxes are new. Red boxes stop the command.

### What changes

| Area | Before | After |
|---|---|---|
| Refs (`repos/metamask-mobile.md`, `cli-reference.md`,
`error-recovery.md`) | Resolved again at tap time; ambiguous or
label-only refs can tap another element; unnamed refs are `Unknown
a11yRef` | Unnamed and `ambiguous` refs work only with `click` (bounds
tap, `(bounds)` target, `MM_TARGET_NOT_FOUND` when moved); other
commands refuse them with a `hint` |
| "The tap opened another screen" row | Cause: an ambiguous ref | Cause:
a substring `--testid` match or a stale ref |
| Expo dev menu close | `tap-coordinates` only; the button "has no
usable ref" | `mm click <ref>` of the unnamed button, or
`tap-coordinates` |
| Bad input | Unknown command exits 3 without a daemon; non-numeric flag
dropped | Unknown command or bad `launch` value: exit 2, no daemon;
`--timeout abc`: exit 2, or 3 without a daemon |
| iOS `type ""` | Exit 4 `MM_TYPE_FAILED`, field cleared | Exit 0,
`textLength: 0` |
| `cdp` port | Launch `--metro-port` or `MM_METRO_PORT` | Launch
`--metro-port`, else the port the launch resolved from `MM_METRO_PORT`,
then `HERMES_METRO_PORT`, then 8081 |
| Daemon log | Outcome only | Outcome and target (`testid=`, `ref=`,
`method=`, …) |

[#137](MetaMask/client-mcp-core#137) (`mm
<command> --help`) needs no change: the skill never told agents to avoid
`--help`. The browser-only changes (#125, #129, #130, #131, #138, #139)
do not apply.

Review: start with "Which refs work where" in
`repos/metamask-mobile.md`.

## Type of Change

- [ ] New skill
- [x] Skill improvement/update
- [ ] Bug fix
- [ ] Documentation update
- [ ] Other (please describe):

## Checklist

- [x] I have read the
[CONTRIBUTING.md](https://github.com/MetaMask/skills/blob/main/CONTRIBUTING.md)
guidelines
- [x] My skill follows the
[SKILL_TEMPLATE.md](https://github.com/MetaMask/skills/blob/main/.github/SKILL_TEMPLATE.md)
format
- [x] I have tested this skill with an AI agent
- [x] My skill does not contain any secrets, private keys, or sensitive
data
- [x] I have added appropriate documentation
- [x] My changes don't break existing skills

## Testing

<details>
<summary>Sources and live run</summary>

- Code: core tag `v0.16.1` (`src/platform/mobile-platform-driver.ts`
bounds refs and `boundsRefError`, `src/cli/mm.ts` `parseIntFlag` and the
help check, `src/tools/launch.ts` `applyHermesDefaults`,
`src/server/request-log.ts`), core `SKILL.md` at the tag, and the
device-mcp 0.10.0 CHANGELOG.
- Live, read only, real-funds wallet, Metro 8085, npm core 0.16.1 and
device-mcp 0.10.0 with MetaMask/metamask-mobile#41237, following only
this skill. iPhone 17 Pro simulator: launch with `MM_METRO_PORT=8085`
and no `--metro-port`, then `hermes-targets` and `cdp`
(`sessionMetroPort: 8085`, `connected: true`); unlock; hamburger menu,
About, back; Explore search, `type` and `type ""` (exit 0, `textLength:
0`), back. Ambiguous and unnamed refs refused by `get-text`, `wait-for`,
`type`, `scroll-to-element`, `long-press` and `run-steps` (exit 4 with a
`hint`); `click` on an unnamed ref returned `target: "a11yRef:e17
(bounds)"`; error paths (exit 2, 3 and 0 for `--help`); daemon log
targets. Android emulator `Medium_Phone_API_36.1`, login screen: the
same `cdp` port, bounds `click`, refusals, `type ""` and `--timeout
abc`.
- Not run live: a bounds `click` after the element moved (code and core
tests only).
- `yarn lint` pass, `yarn test` 106/106 pass, `yarn audit:skills` 0
errors and 134 warnings (same as `main`).

</details>

<details>
<summary>Known gaps (not in this PR)</summary>

- The iOS wallet home tree is 64 levels deep and its full read fails.
device-mcp falls back to a partial tree, and `wait-for --testid
wallet-screen` times out on the right screen. The skill already points
iOS agents to `account-picker`. Fixes: core #141, device-mcp #67 and
#68.
- `explore-safe-area` is not in the iOS tree (the skill names it as the
Android Explore marker only).

</details>

## Additional Context

Merge this after MetaMask/metamask-mobile#41237.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants