Skip to content

chore: upgrade to @metamask/client-mcp-core 0.16.1 and @metamask/device-mcp 0.10.0 - #41237

Merged
cryptotavares merged 4 commits into
mainfrom
cryptotavares/bump-client-mcp-core-0.16.1
Dec 4, 2026
Merged

cryptotavares merged 4 commits into
mainfrom
cryptotavares/bump-client-mcp-core-0.16.1

Conversation

@cryptotavares

@cryptotavares cryptotavares commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Summary: Upgrades the visual testing workflow (tests/llm-workflow, the yarn mm CLI) to @metamask/client-mcp-core 0.16.1 and @metamask/device-mcp 0.10.0. The session manager now returns the resolved Metro port and device from launch(), so core keeps them for mm cdp. The setHermesDefaults workaround from #40496 is removed. Only dev tooling changes; no app code is touched.

Releases: client-mcp-core v0.16.0, v0.16.1. Skill PR: MetaMask/skills#329. Previous bump: #40496 and MetaMask/skills#298.

Problem

Core 0.15.0 kept the launch Metro port for cdp only when it came from the --metro-port flag. #40496 worked around it: the session manager called the driver's setHermesDefaults itself, so MM_METRO_PORT was kept too. Core 0.16.0 (#128) reads optional metroPort and deviceId from the launch() result instead. The workaround is now a second path to the same driver call.

Solution

launch() returns the resolved values. Core applies them when the launch flags do not set them.

flowchart TD
    A["MM_METRO_PORT=8085 yarn mm launch (no --metro-port)"] --> B["MetaMaskMobileSessionManager.launch"]
    B --> C["resolveMetroPort: flag ?? MM_METRO_PORT"]
    C --> D["adapter.launch(resolved)"]
    D --> E["return sessionId, extensionId, state, metroPort, deviceId"]
    E --> F["core launch: input.metroPort ?? result.metroPort"]
    F --> G["driver.setHermesDefaults (in core)"]
    G --> H["mm cdp / hermes-targets: session port 8085"]

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

Yellow boxes are new.

What changes for agents (live, iOS and Android)

Call 0.15.0 0.16.1
cdp after MM_METRO_PORT=8085 launch 8085 (consumer workaround) 8085 (core reads the launch() result); sessionMetroPort: 8085, connected: true
Ref of an unnamed or ambiguous node Resolved by query; can tap another element Only click takes it: taps at the node's bounds, target ends in (bounds). Other target commands: MM_TARGET_NOT_FOUND, exit 4, with a hint
iOS type <field> "" Field cleared, exit 4 MM_TYPE_FAILED Exit 0, textLength: 0
Unknown command, no daemon Exit 3 MM_DAEMON_NOT_RUNNING Exit 2 MM_INVALID_INPUT, no daemon started
--timeout abc Dropped; the command runs Exit 2 MM_INVALID_INPUT (exit 3 with no daemon)
mm launch --help Launches a session Prints help, exit 0
.mm-daemon.log Outcome only Outcome and target (testid=, ref=, method=)

Decisions for reviewers

Decision Reason
Return metroPort as resolved.metroPort (can be undefined) Core applies the field only when it is defined. The values are the ones the workaround passed.
Replace the two setHermesDefaults tests instead of adding new ones One test checks the returned fields and that the session manager no longer calls setHermesDefaults. One checks the no-port case.
README: version line and the MM_TARGET_NOT_FOUND row only Detailed agent guidance goes to the skill (MetaMask/skills#329).

Review guide

# File What to check
1 tests/llm-workflow/metamask-provider.ts The setHermesDefaults call is gone; launch() returns metroPort and deviceId
2 tests/llm-workflow/__tests__/metamask-provider.test.ts The two replaced tests
3 tests/llm-workflow/README.md Version line, MM_TARGET_NOT_FOUND row
4 package.json, yarn.lock ^0.16.1 and ^0.10.0 only
Commits
Commit Change
chore(llm-workflow): bump @metamask/client-mcp-core to ^0.16.1 and @metamask/device-mcp to ^0.10.0 package.json only.
chore(llm-workflow): update yarn.lock for … Lockfile for the published versions: one entry each; core depends on device-mcp ^0.10.0.
refactor(llm-workflow): return the resolved Metro port and device from launch Session manager and its tests.
docs(llm-workflow): document client-mcp-core 0.16.1 changes README.

Test layer placement

Unit tests in tests/llm-workflow/__tests__/metamask-provider.test.ts (the session manager is dev tooling with mocked adapters). The live check is the manual run below.

Changelog

CHANGELOG entry: null

Related issues

Refs: https://github.com/MetaMask/client-mcp-core/releases/tag/v0.16.1, MetaMask/client-mcp-core#128, MetaMask/skills#329, #40496

Manual testing steps

Feature: mm CLI visual testing workflow with client-mcp-core 0.16.1

  Background:
    Given an iOS Simulator or Android emulator with a MetaMask dev build and an existing wallet
    And Metro runs from this branch on port 8085

  Scenario: cdp uses the Metro port the launch resolved
    When the agent runs "MM_METRO_PORT=8085 yarn mm launch --platform ios"
    And the agent runs "yarn mm cdp Runtime.evaluate '{\"expression\":\"1+1\",\"returnByValue\":true}'"
    Then the result value is 2
    And "yarn mm hermes-targets" shows "sessionMetroPort": 8085 and "connected": true

  Scenario: an ambiguous ref works only with click
    Given the login screen lists two "Toolbar" nodes with "ambiguous": true
    When the agent runs "yarn mm get-text <ref of one of them>"
    Then the call fails with MM_TARGET_NOT_FOUND and exit 4
    And the hint names "mm click <ref>" or a unique --testid

Screenshots/Recordings

Before

N/A (dev tooling only)

After

N/A (dev tooling only). Evidence is the sanitized text output below (the wallet holds real funds, so no wallet screenshots).

Testing
  • yarn test:unit:llm-workflow: 16 suites, 222 tests pass.
  • yarn lint:tsc exit 0; yarn dedupe --check exit 0; Prettier, oxlint and ESLint on the changed files pass (oxlint reports two existing warnings on lines this PR does not touch).
  • yarn.lock has one @metamask/client-mcp-core entry (0.16.1) and one @metamask/device-mcp entry (0.10.0). device-mcp resolves to 0.10.0 from the app root and from core.

Live, read only, dev client on Metro 8085, real-funds wallet. Nothing was sent, signed or confirmed.

Check iOS (iPhone 17 Pro sim) Android (Medium_Phone_API_36.1)
MM_METRO_PORT=8085 launch, no --metro-port, then hermes-targets ✅ sessionMetroPort: 8085 ✅ sessionMetroPort: 8085
cdp 1+1 on the session port ✅ value: 2, connected: true ✅ value: 2, connected: true
cdp --metro-port 8099 ✅ MM_CDP_FAILED, message names port 8099 —
Ambiguous / unnamed ref on get-text, wait-for, type, scroll-to-element, long-press, run-steps ✅ MM_TARGET_NOT_FOUND, exit 4, hint ✅ (wait-for, long-press)
click on an unnamed ref ✅ target: "a11yRef:e17 (bounds)" ✅ target: "a11yRef:e8 (bounds)"
type <field> "" ✅ exit 0, textLength: 0 ✅ exit 0, textLength: 0
Unlock, menu, About, back; Explore search and back ✅ not run (login screen only)
frobnicate, launch --platform foo, --timeout abc, launch --help ✅ exit 2 / 2 / 2 (3 without daemon) / 0 ✅ --timeout abc exit 2
Daemon log names targets ✅ testid=…, ref=…, method=Runtime.evaluate —
cleanup, stop ✅ ✅

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Dev-only dependency bump and a small session-manager contract change for the mm CLI; no production app code is modified.

Overview
Upgrades the visual testing / yarn mm workflow dev dependencies to @metamask/client-mcp-core 0.16.1 and @metamask/device-mcp 0.10.0 (package.json + lockfile).

MetaMaskMobileSessionManager.launch() no longer calls the driver's setHermesDefaults workaround from the prior core bump; it now returns metroPort and deviceId from the resolved launch so core can wire Hermes/CDP (mm cdp, hermes-targets) when only MM_METRO_PORT is set. Unit tests were updated to assert the returned fields and that setHermesDefaults is not invoked.

The llm-workflow README records the new package versions, notes the iOS type "" behavior via device-mcp, and expands MM_TARGET_NOT_FOUND guidance (ambiguous refs are click-only; other commands get a hint).

No application/runtime code changes—only tests/llm-workflow and dev dependency versions.

Reviewed by Cursor Bugbot for commit ccaeb35. Configure here.

…m launch

Core 0.16 keeps the metroPort and deviceId that launch() returns as the
session's Hermes defaults, so the setHermesDefaults call is no longer needed.
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added size-S pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Dec 3, 2026
@metamask-ci metamask-ci Bot added the team-confirmations Push issues to confirmations team label Dec 3, 2026
@metamask-ci

metamask-ci Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors."). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@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
Updatednpm/​@​metamask/​device-mcp@​0.9.0 ⏵ 0.10.088100100 +198 +180
Updatednpm/​@​metamask/​client-mcp-core@​0.15.0 ⏵ 0.16.198100100 +198 +1100

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 December 3, 2026 16:56
@cryptotavares
cryptotavares requested a review from a team as a code owner December 3, 2026 16:56
@cryptotavares cryptotavares removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags: No E2E tests selected

AI Confidence: 90

E2E reasoning

Expand to read

The PR bumps two dev-only packages, @metamask/client-mcp-core (0.15 to 0.16.1) and @metamask/device-mcp (0.9 to 0.10). It also updates the LLM workflow provider in tests/llm-workflow/, with its test and README. package.json and yarn.lock are flagged critical, but the diffs only touch these devDependencies, and the lockfile changes match. Nothing in app runtime code, the Engine, or the Detox/Appium smoke infrastructure changed. The provider change only moves how metroPort and deviceId are returned from launch, and it affects the LLM workflow tooling alone. No smoke tags are needed.

View run

@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

@seaona seaona left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cryptotavares
cryptotavares added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit a38f1f5 Dec 4, 2026
249 of 253 checks passed
@cryptotavares
cryptotavares deleted the cryptotavares/bump-client-mcp-core-0.16.1 branch December 4, 2026 08:43
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 4, 2026
@metamask-ci metamask-ci Bot added the release-8.25.0 Issue or pull request that will be included in release 8.25.0 label Dec 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-8.25.0 Issue or pull request that will be included in release 8.25.0 size-S team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants