Phone Relay · Architecture
Phone Relay is an Android app that runs a remote MCP server on the phone itself, so Claude can read the screen, tap and type, open apps, control media, handle notifications and run Tasker tasks, from anywhere, including hands-free in voice mode on mobile data. This page shows how a request gets to the phone, how sign-in keeps everyone else out, and what each tool does.
At a glance
Things people ask it: "Get directions to the airport and start the route." "Start Spotify's DJ." "What did my last texts say? Tell Sam I'm on my way."
Request path
The server never opens a port to the network. cloudflared, built into Phone Relay and run by its service, dials out to Cloudflare and carries requests back down that tunnel, which is why it works on mobile data and behind any router. Hover a box for the details.
One path in: claude.ai reaches the phone only through the tunnel cloudflared opened from the phone, and Phone Relay only listens on localhost.
Sign-in
claude.ai signs in with OAuth 2.1 against Phone Relay itself, which hands the browser to your GitHub OAuth App to find out who is signing in. Click a step for details.
Tools
Thirty fixed tools and no shell. Dot colors: green only reads, orange acts on the phone, red refuses unless the call says the user confirmed. Filter by area, then click a tile for its details.
device_status
screenread_screen
screenscreenshot
screentap
inputlong_press
inputtap, or a screen
point.
swipe
inputscroll
inputtype_text
inputkey
inputopen_app
appsopen_url
appstel only opens the dialer and mailto only a draft. A
Google Maps directions link with dir_action=navigate starts the
route.
media
appsspotify_start_dj
appsread_notifications
notificationsreply_to_notification
notificationstasker_list_tasks
taskertasker_run_task
taskerargs as
%par1, and returns its Return value.
tasker_task_result
taskertasker_lookup
taskertasker_import
taskerinbox
inboxinbox_drop
inboxwims_find_item
wimswims_last_seen
wimswims_open_photo
wimswims_sessions
wimswims_tag_session
wimswims_pending_photos
wimswims_record_items
wimswims_status
wimsTasker runs
A Tasker run is independent of the MCP call that started it. Tasker gets a secret one-time token to post the result with; Claude gets a separate short run id to collect it.
The token that can post a result never reaches Claude, and the endpoint that takes it only answers requests from the phone itself.
Inside the app
Two Gradle modules keep the server testable without a phone.
- Ktor CIO server and routing, bound to loopback.
- OAuth authorization server: registration, PKCE, GitHub callback, token store, rate limits.
-
MCP JSON-RPC handler and every tool's definition and argument checks,
behind a
PhoneBackendinterface. - Tasker XML validation, the bridge task and run results.
- Tests include an end-to-end run over real sockets against a fake GitHub.
-
Foreground service (
specialUse) that starts on boot and hosts the server. -
Accessibility service for the screen, gestures, screenshots and the
input method used by
type_text. - Notification listener for notifications, replies and media sessions.
- Settings with the GitHub client secret and tokens encrypted by an Android Keystore key.
- Status screen with setup checks, the activity log, and controls to stop the server or sign everyone out.
Security
Treat the connector like a remote login to your phone.
-
Loopback only. The server binds to
127.0.0.1; the tunnel you run is the only way in. - Allowlist, empty by default. Only the GitHub usernames you enter can sign in, and each request checks the list again.
- Short-lived, revocable tokens stored hashed in an encrypted file; one button signs everyone out.
- Pinned redirects and PKCE, so a sign-in code cannot be sent to another site.
- No shell, no Tasker one-off actions, and sends that refuse without a confirmed yes.
- Activity log of every call, with the caller.
- Your GitHub account. Whoever controls an allowed account controls the phone; turn on two-factor authentication.
- The assistant. Only replies and new Tasker tasks demand a confirmation in code; a tap on a Send button is just a tap.
- Tasker's External Access, which lets any app on the phone run your named tasks.
- Debug builds carry a test sign-in shortcut; never put one behind the tunnel.