The owner must enable Android accessibility separately, choose scopes, consent and start each session locally. The app exposes an authenticated loopback endpoint only while its foreground service runs. The service has no exported entry point or boot receiver and is non-sticky. Random 256-bit tokens are in-memory only and rotate per session. Neither MCP nor an external client can enable scopes or start the endpoint. Stop revokes the session before closing the socket. Process death clears all state.
The phone must be unlocked for inspection or action. Every operation rechecks session state, scope and lock state on Android's main thread. The accessibility service does not record events or send them anywhere. Snapshot handles expire and are invalidated on UI changes. Sensitive nodes are filtered; security-sensitive packages and this app are excluded. This is defense in depth, not a guarantee that ordinary apps contain no secrets or dangerous buttons. Reading the screen can reveal personal text. Clicking may send messages or trigger purchases in another app. Only pair a client you trust; use read-only whenever possible. Screen content is untrusted data, not instructions for your agent.
Local bearer authentication protects against casual local callers, not a compromised device, adb-authorized computer, root, malware able to observe the screen, or a stolen token. USB debugging access is powerful: disable/revoke it when finished. No TLS is provided because traffic is loopback; forwarding must remain local. Never publish the endpoint or token. Browser Origin headers are rejected to reduce browser-driven local request attacks. Requests, response bodies and tokens are not logged.
Loopback is shared with other apps on the phone. Another app with network access can occupy port 8765 before this service starts, or after it stops. A bind failure prevents this service from publishing a new token, but the bearer token authenticates the client to the server, not the server to the client. A stale or misdirected client could send a token to a different local listener or accept fabricated responses. A different port alone would not authenticate the server. Before connecting, check the app shows an active session and its token matches the client's configured token; this does not authenticate the endpoint. Stop clients and remove the ADB forward (adb forward --remove tcp:8765) when the session ends, and do not assume the endpoint is trustworthy on a compromised phone. Stop revokes that session's token on the real server. An unauthenticated local app can also occupy connections and deny service; the bounded queue and read deadline limit resource use but do not guarantee availability.
Tokens are deliberately not persisted, shared automatically, or copied to clipboard. App and consent windows use FLAG_SECURE, reject full and (API29+) partial obscured touch gestures, and hide non-system overlays on API31+. These controls still require real-device validation. Android screenshots of other apps are not requested. Password/accessibility-sensitive controls are filtered. Eligible ordinary editable controls expose bounded metadata and handles, never their text values, but custom controls can mislabel or aggregate sensitive text. Redaction is best-effort, not a guarantee against credential disclosure; there is no perfect semantic classification of UI content.
- Test on physical Samsung S25 Ultra, including lock races, UI mutation and accessibility revoke.
- Independent security review of parser, Android service lifecycle, node identity and privacy filters.
- Play Accessibility API disclosure/consent and policy review; app does not claim to be an accessibility aid. Review specialUse foreground service eligibility.
- Decide currency/markets, paid-app pricing, signing key, developer account, privacy policy, support channel and data-safety disclosures. No payment or purchase system is implemented.
- Review current target-SDK and store rules at submission. Debug builds are not production releases.
Google Play's Accessibility API policy restricts using that API for autonomous initiation, planning and execution of actions/decisions. A generic AI-agent phone-control product may not qualify for Play distribution even with consent. This prototype is not a claim of compliance. Before pursuing the $5 paid release, review the intended client behavior against Google's official Accessibility API policy and consider a user-directed, non-autonomous interaction model or alternative APIs. No store listing, account, charge, publishing or billing setup has been made.
The five-second input deadline starts at socket acceptance, including queue wait. A separate five-second response-write watchdog closes a stalled output socket so the serial worker can recover; completed writes cancel and remove their watchdog task. Neither deadline bounds arbitrary controller/platform work, guarantees scheduling latency, or prevents sustained connection floods. Unexpected listener failure triggers an instance-specific owner callback after transport cleanup; deliberate Stop does not trigger that callback.
Output serialization is bounded before allocating a complete oversized JSON string: per-tool JSON text is limited to 512 KiB and complete response JSON to 2 MiB, with depth 32 and 10,000 JSON-value limits. UTF-8 accounting includes escaped characters and surrogate pairs; lone surrogates are escaped. These caps do not bound the controller's own allocations or make platform IPC cancellable. An oversized tool result becomes isError=true with RESULT_TOO_LARGE; the controller may already have executed, so this is not evidence of no effects and must not trigger blind action retries.
Legacy 2025-03-26 batches allow at most 32 messages and at most one tools/call message. Larger/multiple-tool batches and unsolicited response inputs are rejected before any controller effects with HTTP 400. Normal single calls, notification-only batches and metadata/ping batches remain supported. Version 2025-06-18 uses individual messages. The final output budget has a defensive HTTP 500 path that explicitly warns that prior actions may have occurred; it does not claim to roll back work.
Host regressions use JVM fake controllers, including a bounded 480-KiB response with deliberately small test socket buffers. They are not evidence of physical-device timing, saturation immunity, server authentication, or a complete denial-of-service defense.
For local testing, use scripts/mcp_smoke.py with PHONE_MCP_TOKEN entered using a silent shell read, not a token in process arguments or shell history. The helper bypasses configured HTTP proxies. Environment variables are not secure against privileged or same-account local inspection; unset the token after use and close trusted clients at session end.
Node actions require both read and act scopes and a fresh inspected handle. Scrolling issues one forward/backward native action; text entry issues one native set-text action (at most 1,000 Unicode code points, empty clears), with no focus, submit, clipboard, or echo of supplied values. Credential-like input types, hints, IDs, descriptions, and linked labels are rejected conservatively. This does not reliably recognize every custom credential field or sensitive ordinary note; users must restrict use to trusted clients and intended ordinary-app workflows. A text or scroll action may change state before a timeout is reported. Reinspect rather than blindly retry.