452 Commits
Author SHA1 Message Date
Gil Megidish ef371e8c6f docs: update changelog for v1.0.7 (#466) 1.0.7 2026-10-01 16:55:15 +02:00
Gil Megidish 5592739bf6 chore: upgrade mobilewright to 0.0.63 (#464) 2026-10-01 16:47:02 +02:00
yi111andYi-111-a 36366d5cdd fix: raise an actionable error when dump ui returns no elements (#457)
`mobile_list_elements_on_screen` called `response.data.elements.flatMap(...)`
directly. When the device screen is off or locked, `mobilecli dump ui` answers
with `{"status": "ok", "data": {}}`, so `.elements` is `undefined` and the call
died with a raw "Cannot read properties of undefined (reading 'flatMap')"
TypeError and a stack trace.

An agent driving the device got an unactionable internal error instead of
something it could recover from, and the correct next step (wake the device)
was not discoverable from the message, so it typically retried the same failing
call.

Guard both levels of the payload and raise an `ActionableError`, which the tool
wrapper already renders as "<message>. Please fix the issue and try again."
without a stack trace. `DumpUIResponse` now models `data` and `data.elements`
as optional so the guard is type-honest rather than a cast.

An empty `elements` array still resolves to an empty list, so a genuinely empty
screen keeps its previous behaviour.

Closes #455

Co-authored-by: Yi-111-a <42726078+Yi-111-a@users.noreply.github.com>
2026-10-01 10:04:49 +02:00
Gil Megidish 2d5c1fa753 fix: follow-ups to server/discover serving (#463)
- mount /mcp on POST only so the GET/DELETE 405 routes are reachable again
- pass onerror to serveStdio so a failing factory is logged, not swallowed
- run the legacy initialize and tools/list tests through createMcpHandler
2026-10-01 10:03:49 +02:00
Rahul ec61fe05a5 fix: serve server/discover for the 2026-07-28 protocol revision (#451)
* fix: serve server/discover for the 2026-07-28 protocol revision

The server advertises support for protocol revision 2026-07-28 in its
handshake, but answers server/discover with 'Method not found' because
the hand-wired transports never mark the connection as serving the
modern era — the SDK only installs the server/discover handler behind
that era gate (via createMcpHandler / serveStdio).

Route both transports through the SDK serving entries:

- stdio: serveStdio() owns the transport and the era decision; a
  server/discover probe pins the connection modern, an initialize
  handshake keeps serving the 2025-era protocol as before.
- HTTP: createMcpHandler() + toNodeHandler() classify each request;
  envelope-carrying requests get a fresh era-marked instance and
  legacy traffic is served stateless from the same factory (the same
  per-request model as the previous hand-rolled handler).

Fixes #409

* fix: log request-handling failures via onerror callbacks

The previous hand-rolled route logged transport setup and
request-handling failures; the SDK serving entries answer HTTP 500
silently unless configured. Wire both createMcpHandler and
toNodeHandler to the application logger through their onerror
options.
2026-10-01 09:54:23 +02:00
Gil Megidish da98beb044 fix: wait for package on npm before publishing to mcp registry 2026-09-30 13:49:21 +02:00
Gil Megidish 20469828c5 chore: upgrade brace expansion 2026-09-30 13:48:59 +02:00
gmegidish 571a18354b chore: upgrade brace expansion 2026-09-30 13:36:52 +02:00
gmegidish eab93bf2b9 fix: wait for package on npm before publishing to mcp registry 2026-09-30 13:23:49 +02:00
Gil Megidish 7b7d68e315 Merge pull request #460 from mobile-next/docs/changelog-1.0.6
docs: update changelog for 1.0.6
1.0.6
2026-09-30 11:26:09 +02:00
gmegidish c9f61e3240 docs: update changelog for 1.0.6 2026-09-30 11:25:43 +02:00
Gil Megidish f2907f083e feat: mobile_fold_device to fold and unfold foldable devices 2026-09-30 11:12:47 +02:00
gmegidish 3375a2ee67 chore: npm audit fix 2026-09-29 12:58:15 +02:00
gmegidish 3801a145eb feat: mobile_fold_device to fold and unfold foldable devices 2026-09-29 12:56:29 +02:00
Gil Megidish 18d0e8c44e docs: update changelog for 1.0.5 1.0.5 2026-09-23 17:38:31 +02:00
gmegidish 1b4d70cc19 docs: update changelog for 1.0.5 2026-09-23 17:37:29 +02:00
Gil Megidish c8b1612efd chore: migrate to MCP TypeScript SDK v2 packages 2026-09-23 17:14:05 +02:00
Gil Megidish 1bb3028fe2 docs: point the Goose install badge at goose-docs.ai (both URLs currently 404) 2026-09-23 17:03:49 +02:00
Gil Megidish 815a06b2ce chore: update mobilecli to latest 2026-09-23 17:03:29 +02:00
sxh313 d5caa285a2 docs: point the Goose install badge at goose-docs.ai
Goose moved off block.github.io/goose, and the stub left behind only
redirects the site root, so both URLs in the install badge now 404 and the
button renders as a broken image. The same paths resolve on goose-docs.ai
and still hand the parameters off to the goose:// extension handler.

Applied to the English, Japanese and Chinese READMEs alike.
2026-09-23 17:01:27 +02:00
gmegidish b3689fffa6 chore: update mobilecli 2026-09-23 16:52:29 +02:00
gmegidish 291a6be663 feat: add server instructions describing the device workflow 2026-09-16 17:16:24 +02:00
gmegidishandAnas Khan e179a1b02b docs: credit #400 for the SDK v2 migration groundwork
Co-authored-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
2026-09-16 15:06:59 +02:00
gmegidish a67a965bb3 feat: log mobile-mcp and mcp sdk versions on stdio startup 2026-09-16 09:03:52 +02:00
gmegidish 61d4fac158 docs: changelog entry for the SDK v2 package migration (#445) 2026-09-15 17:29:00 +02:00
gmegidish fcf556e7e0 chore: migrate to MCP TypeScript SDK v2 packages
Replace the single @modelcontextprotocol/sdk 1.30.0 dependency with the v2
package split:

- @modelcontextprotocol/server  -> McpServer, StdioServerTransport (/stdio)
- @modelcontextprotocol/node    -> NodeStreamableHTTPServerTransport
- @modelcontextprotocol/express -> createMcpExpressApp
- @modelcontextprotocol/client  -> Client, InMemoryTransport (tests only)

Tool registration wraps the raw zod shape in z.object() as v2 requires; the
batch tool already did this at call time. zod bumped to ^4.2.0. Wire
behaviour on stdio and on POST /mcp is unchanged; the server does not opt
into the 2026-07-28 protocol revision.
2026-09-15 17:28:07 +02:00
Gil Megidish 63a5974d9b docs: update changelog for 1.0.4 1.0.4 2026-09-13 22:13:12 +02:00
gmegidish 9d564c3d2d docs: update changelog for 1.0.4 2026-09-13 21:43:29 +02:00
Gil Megidish 1008eb7b83 fix: return coordinate mapping with every screenshot 2026-09-13 21:24:30 +02:00
gmegidish aee29110b1 Merge remote-tracking branch 'origin/main' into fix/screenshot-coordinate-mapping 2026-09-13 21:18:54 +02:00
Gil Megidish 5bc7402713 docs: sync ja and zh-CN READMEs with English 2026-09-12 22:34:59 +02:00
gmegidish 667de703c5 docs: drop issue #98 links from READMEs and roadmap 2026-09-12 22:11:11 +02:00
gmegidish 43258e1f41 docs: sync ja and zh-CN READMEs with English
- add the missing mobile_batch_commands tool to the tool list
- Streamable HTTP section: add the localhost DNS rebinding protection
  note, the "old pure-SSE flow is no longer available" sentence, and the
  Smithery / horizontal hosts clause
- zh-CN: wrap the privacy policy URL in a markdown link; GitHub was
  pulling the full-width 。 into the URL, producing a broken link
2026-09-12 22:10:01 +02:00
Gil Megidish 74dc86d07d feat: serve Streamable HTTP on --listen /mcp 2026-09-12 21:40:44 +02:00
gmegidish 5d16416c24 fix: address CodeRabbit review on streamable http
- README (en/ja/zh-CN): /mcp only accepts POST; GET and DELETE return 405
- register response close cleanup before connecting and handling, so a
  response that closes early still tears down the transport and server
- verify script: wait for the child to exit before deciding on SIGKILL;
  child.killed only means a signal was sent
- validate-response: extract the last balanced, parseable JSON object,
  ignoring braces inside strings, instead of slicing first { to last }
2026-09-12 21:35:35 +02:00
gmegidish 6ed7e32feb fix: tolerate preamble text around the acceptance-test json
The prompt asks the agent for bare json, but it sometimes prefixes a
sentence ("All assertions passed.") and the run failed on a passing
test. Extract the outermost {...} instead of requiring the response to
start with it, and match code fences anywhere rather than anchored.
2026-09-12 21:33:30 +02:00
gmegidish a924d1bbf3 fix: correct Playground package id casing in android test prompt
Android package names are case-sensitive and the emulator installs
com.mobilenext.playground, but the prompt asserted the capitalized
com.mobilenext.Playground. Present since the file was added in 349c3c1;
earlier e2e runs passed only because the agent grading the prompt
silently normalized the casing.
2026-09-12 21:33:30 +02:00
gmegidish 15263b7efd feat: return 410 with migration note on removed /sse endpoint
Clients still pointing at the old SSE transport got a bare 404 (or a 401
when MOBILEMCP_AUTH was set). Serve 410 Gone with a pointer to the README
instead, registered ahead of the auth middleware so the reason reaches
unauthenticated clients.

Also adds an npm start script.
2026-09-12 21:33:30 +02:00
gmegidish 1af2c3f12f Merge remote-tracking branch 'origin/main' into feat/streamable-http 2026-09-12 21:33:29 +02:00
Gil Megidish 5c4d02b201 feat: serve Streamable HTTP on --listen /mcp
Replace deprecated SSE transport with stateless MCP Streamable HTTP
using StreamableHTTPServerTransport (sessionIdGenerator undefined) and
createMcpExpressApp for localhost Host/DNS-rebinding protection. Keep
MOBILEMCP_AUTH Bearer middleware and stdio as the default. Closes #98.
2026-09-12 21:33:29 +02:00
Gil Megidish 9425872e6f docs: update roadmap for 1.0.3 and add new planned items 2026-09-12 14:21:51 +02:00
gmegidish 661f1340e5 docs: update roadmap for 1.0.3 and add new planned items
Move shipped features to Done Done (1.0.3, 2026-09-08): background
daemon, element refs, embedded Android Device Kit, better screenshot
handling, device logs.

Add planned items: Flutter UI support, browser support, device
settings, clear app storage.
2026-09-12 14:17:47 +02:00
gmegidish 2c74fe1c36 fix: harden jpeg parser and match check after review
- skip 0xff fill bytes that may pad a marker (JPEG B.1.1.2), and reject an
  SOF segment shorter than 8 bytes instead of reading garbage dimensions
- declare "coordinates match" only when the raw dimensions are equal, not
  when the rounded ratios happen to print as 1
- tool description says the mapping text depends on the device reporting
  its screen size
2026-09-11 10:06:42 +02:00
gmegidish 76836109d3 docs: changelog entry for screenshot coordinate mapping (#440) 2026-09-10 23:44:32 +02:00
gmegidish f7b573cc12 fix: return coordinate mapping with every screenshot
mobile_take_screenshot downscales by default since #418 but returned only
the image. A model reads a position off the smaller image and taps it in
full-size screen coordinates, so every screenshot-derived tap lands short.

The tool result now carries a text block ahead of the image that states the
screenshot size, the screen size, and the multiplier to apply before tapping.
When both agree it says so. When either size is unknown the text is omitted
rather than risk a wrong instruction.

Screenshot dimensions are read from the image bytes: png through the
existing PNG class, jpeg through a small SOF-marker parser (baseline and
progressive). Screen dimensions come from getScreenSize, which is already the
space taps use, so iOS points vs pixels needs no special casing.

Closes #29, closes #163.
2026-09-10 23:43:47 +02:00
Gil Megidish 648a6a4b86 chore: update telemetry 2026-09-09 12:00:09 +02:00
gmegidish 108887e1f4 chore: update telemetry 2026-09-09 11:26:33 +02:00
Gil Megidish 46886497c1 ci: split publish out of build and gate it on e2e_test 2026-09-08 20:11:40 +02:00
gmegidish d57a75a633 ci: split publish out of build and gate it on e2e_test
Publishing to npm and the MCP registry ran inside the build job, so it
could complete while e2e_test was still running or after it had failed.
Move publishing into a dedicated publish_npm job and make both publish
jobs depend on e2e_test.
2026-09-08 17:06:03 +02:00
Gil Megidish f40600cd21 ci: skip build workflow when only markdown files change 1.0.3 2026-09-08 16:52:31 +02:00