Repository navigation
chore: bump @metamask/device-mcp to ^0.9.0 - #116
Merged
Merged
Conversation
Type the persistent Hermes client against device-mcp's HermesClient and test the 0.9.0 Android error shapes (TargetObscuredError with keyboard, the verified dismissKeyboard failure) and snapshot warnings.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
cryptotavares
marked this pull request as ready for review
November 20, 2026 12:39
…res device-mcp ^0.9.0 Read HermesClient straight from the typed device-mcp runtime. Keep the one-shot path for a call whose metroPort or appId differs from the session target, so the persistent client is never retargeted. The tests force that one-shot path with a per-call metroPort instead of modelling a device-mcp without HermesClient. Drop the matching compatibility prose from the README and SKILL.md.
Collaborator
Author
|
@SocketSecurity ignore npm/@metamask/device-mcp@0.9.0 |
pnarayanaswamy
approved these changes
Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of the mm CLI v2 effort (ticket
P1-51). Picks up the@metamask/device-mcp0.9.0 release: MetaMask/device-mcp#54, MetaMask/device-mcp#59, MetaMask/device-mcp#60 and MetaMask/device-mcp#61.Problem
Core pins
^0.8.0. On 0.x, a caret range does not pick up 0.9.0. So with core 0.14.0 on Android:HermesClient, so everymm cdpcall opens its own socket.mm type <field> ""fails with exit 4.Solution
Bump the range and type the persistent client against the real
HermesClientclass. Core now requires 0.9.0, so the feature check for an older device-mcp that #91 added is removed. A call with another Metro port or app id still uses a one-shot connection, so the session client is never retargeted.flowchart TD A["mm cdp"] --> B{"session Metro port<br/>and app id?"} B -->|yes| C["one HermesClient per session<br/>socket opened once, reused"] B -->|"per-call override"| D["runHermesCdp: one-shot socket"] T["mm click (Android)"] --> H{"device-mcp 0.9.0 hit test:<br/>target covered?"} H -->|no| P[tap sent] H -->|"keyboard, --dismiss-keyboard"| K["dismissKeyboard (verified), tap again"] H -->|"keyboard or overlay"| X["MM_TARGET_OBSCURED, exit 4.<br/>Nothing is tapped."] classDef new fill:#fff3cd,stroke:#d39e00 classDef stop fill:#f8d7da,stroke:#c82333 class C,H,K new class X stopYellow boxes are new. Red boxes stop the tap.
What changes
Live run on the Android emulator and the iOS simulator (dev build, Metro 8085). Before: npm core 0.14.0 with device-mcp 0.8.0. After: this branch with device-mcp 0.9.0.
mm cdp Runtime.evaluate 1+1, 10 calls,totalMsp50 / p95mm type <account search> ""afterzzMM_TYPE_FAILED, fieldztextLength: 0, field shows its placeholdermm dismiss-keyboard, keyboard upmInputShowntrue → false (verified by device-mcp)mm click --testid fox-animation, under the keyboardMM_TARGET_OBSCURED:… covered at (540, 1959) by the keyboard: android.widget.FrameLayout. Nothing was tapped. …--dismiss-keyboardkeyboardDismissed: truemm click --testid navbar-hamburger-menu-button, under "Tools"MM_TARGET_OBSCURED:… by android.view.View around android.widget.ImageView label="Tools"describe-screenon loginwarningsfieldThe first after call (2742 ms) ran about 3 s after the unlock, while wallet home was still loading. On quieter screens a new client takes 50–135 ms for its first call.
Decisions for reviewers
HermesClientLikeandHermesClientConstructorwith device-mcp'sHermesClienttypemetroPort,appId,isConnected,send(method, params, { timeoutMs })andclose()match the old shape.sendreturnsHermesCdpResult, which has the same shape asCdpOutcome.typeof HermesClient === 'function'check and the "older device-mcp" fallback^0.9.0as a dependency, and every 0.9.x exportsHermesClient. The check only existed because #91 merged before 0.9.0 was out. Forcing an older device-mcp against core's range is not supported.trackContextsand no listenersRuntime.enableonly whentrackContextsis true (defaultfalse). Core passes{ metroPort, appId, pinnedDeviceId, onPin }only. So core sends noRuntime.enable.TargetObscuredErrorusescode: 'TARGET_OBSCURED'andkeyboard: true.classifyInteractionErrorandisKeyboardObscuredalready read these fields. The newKeyboard still shown after ESCAPE and BACK. …error is a plainError.dismissKeyboardToolreports it asMM_DEVICE_ACTION_FAILED.SnapshotResult.warnings#snapshotAppreads onlyhierarchy.chore:, notfeat:Review guide
Read the files in this order:
package.json,yarn.lock^0.9.0.yarn dedupeleaves one device-mcp entry.src/platform/mobile-platform-driver.ts#hermesClient: HermesClient,#getHermesClient(no feature check), the one-shot path for per-call overridesTargetObscuredErrorinmobile-platform-driver.test.tsanderror-classification.test.ts. ThedismissKeyboarderror indevice.test.ts. A snapshot withwarningsincaptureScreen.README.md,SKILL.mddismiss-keyboardcheck.Consumer changes
Mobile and Extension bump
@metamask/device-mcpto^0.9.0with core 0.15.0. Both copies matter on Mobile:type "", verifieddismiss-keyboard,MM_TARGET_OBSCURED) come from that copy.HermesClientfrom its own location. With only core bumped, the persistent client works but the Android fixes do not.Testing
yarn build,yarn lint(exit 0) andCI=1 yarn testpass: 65 files, 2443 tests, no type errors. Coverage 98.21 / 96 / 97.85 / 98.3. The floors invitest.config.mtsdo not change.node_modules/@metamask/device-mcp0.9.0.HermesClientwas a function.lsofon the daemon showed one ESTABLISHED socket to 8085 with the same local port across 30 calls.mm hermes-targetsreportedconnected: trueandsessionMetroPort: 8085.MM_TARGET_OBSCURED.launch,describe-screenandcleanupexit 0.Docs changed
README.md: core depends on^0.9.0, and the consumer must create its backend from the same range. The session keeps one Hermes connection.SKILL.md: Android hit-tests taps with device-mcp 0.9.0. Androiddismiss-keyboardfails withMM_DEVICE_ACTION_FAILEDwhen the keyboard stays up. The persistent Hermes connection is described without a version condition.