AGI Agentic Phone MCP, end to end: set up the phone, connect a client, run tasks, and handle what comes back.
api.agi.tech/v1/mcp90 minutesBring an Android phone
the next 90 minutes
Where we're going
Part 1 · 10 min
The idea
What MCP is, and the three pieces that make a phone controllable.
Part 2 · 20 min
Set up & connect
Prepare the phone, attach Claude Code or another client, sign in.
Part 3 · 25 min
Run tasks
The start, monitor, act loop. Outcomes, handoffs, sessions, prompts.
Part 4 · 35 min
Go deeper & build
Security, inside the phone, troubleshooting, then four hands-on labs.
You leave with a working connection, a mental model of every hop, and prompts that hold up on a real device.
before we start
Check you have these
Phone
An Android phone
With the AGI Android app installed. Unlocked, charged, on Wi-Fi.
Account
One AGI account
The same sign-in on the phone, in the browser and on platform.agi.tech.
Laptop
An MCP client
Claude Code is fastest. Claude Desktop, Cursor and ChatGPT work too.
Desktop
Node.js 18+
Only for Claude Desktop, which needs the mcp-remote bridge.
part 1
The idea
Real apps, real screen, any assistant.
what it does
Your assistant asks. Your phone does it.
Connect the AGI MCP server to any MCP client. The assistant runs plain-language tasks on your phone: opens apps, navigates, types and reports back while you watch.
No per-app integration. Anything installable is automatable.
Visible. Every action happens on the phone's own screen.
Native trust. Logins and payments stay with you, on the device.
Claude CodeClaude DesktopCursorChatGPT
Working…
mcp in sixty seconds
A plug standard for AI tools
The Model Context Protocol lets any compliant client discover and call tools on a server. Nothing is hardcoded per client.
tools/list
Ask the server which tools exist for this account.
tools/call
Run one tool with JSON arguments, get JSON back.
AGI speaks MCP 2024-11-05 over JSON-RPC 2.0. Transport is Streamable HTTP with JSON responses, or SSE.
POST https://api.agi.tech/v1/mcp
// the client asks
{ "jsonrpc": "2.0", "id": 7,
"method": "tools/call",
"params": {
"name": "phone_run_task",
"arguments": { "prompt": "Open Settings and report the battery percentage." } } }
// the server answers at once
{ "task_id": "…", "session_id": "…" }
architecture
Three pieces, one relay
Your AI client
Decides what to do
Claude Code, Cursor, ChatGPT or your own agent. Calls tools and reads results. Never touches the phone.
AGI cloud MCP server
Queues and relays
Authenticates you, queues tasks, dispatches them to your device, relays progress back.
api.agi.tech/v1/mcp
AGI Android app
The agent itself
Executes on-device through Android accessibility: real apps, real UI. Streams progress back.
Execution is asynchronous. A task takes seconds to minutes, so starting one returns a task_id at once and the client waits separately.
part 2
Set up & connect
Phone first, then your client, then one call to prove it.
on the phone
Four steps to Connected
1
Install and sign in
AGI Android app, same account as platform.agi.tech.
2
Grant Accessibility and overlay
How the agent reads the screen and shows while it works.
3
Settings › Developer connection
Tap Connect device. Wait for Connected.
4
Verify from your client
list_devices shows the phone as online.
‹Developer↻
</>
Connected
You can control this phone using your MCP client
Device ID5b6dc94d-615c-461c-b8... c5839b69
Disconnect device
fastest path
Connect Claude Code in one command
~ zsh
$ claude mcp add --transport http agi-devices https://api.agi.tech/v1/mcpAdded HTTP MCP server agi-devices to local config$ claude> /mcp agi-devices needs authentication → Authenticate Opening browser for AGI sign-in… agi-devices ✓ connected · 14 tools$ claude mcp listagi-devices: https://api.agi.tech/v1/mcp (HTTP) - ✓ Connected
1 · Add
Registers the remote server under the name agi-devices.
2 · Sign in
Run /mcp, pick agi-devices, finish the browser sign-in.
3 · Check
claude mcp list shows it connected. Claude Code stores and refreshes the token.
In .cursor/mcp.json. Key from platform.agi.tech/me/api-keys.
ChatGPT
OAuth
Turn on developer mode in Settings › Apps › Advanced settings. Then Settings › Apps › Create, enter the URL, choose OAuth, select Scan tools and sign in.
Plan and workspace availability is set by OpenAI.
VS Code, Windsurf, Zed
API key
Add a remote HTTP server named agi-devices with header Authorization: Bearer YOUR_API_KEY, then reload.
Any other client: OAuth 2.1 discovery or the same header.
what the sign-in does
OAuth 2.1, discovered automatically
Your client
AGI MCP server
AGI sign-in
request, no token
401 + where to sign in
fetch metadata, register client
browser sign-in · PKCE · email scope
retry with Bearer token
tools/list → phone tools
Recommended · OAuth
Add the URL with no token. The client discovers, registers itself and opens the browser. Tokens refresh on their own and are revocable per client.
Fallback · API key
For clients without OAuth. Create it at platform.agi.tech/me/api-keys and send it on every request.
Either credential is full control of your registered phones. Treat it like your unlocked phone.
In practice you configure one tool, phone_run_task. The rest are handled by your assistant.
devices and sessions
One phone, one task at a time
Execution lane · samsung SM-S731U1
task Arunning
task Bnew phone_run_task
A new phone_run_task on the same phone cancels the old MCP task with stopped_by_user. A task you started in the app itself is not cancelled; it holds the lane and the MCP task waits as pending.
situation
do this
Follow-up, same workflow
Reuse the session_id
Unrelated errand
Let phone_run_task decide
One task went wrong
phone_task_cancel, keep session
Workflow finished
phone_session_end
Parallel work
One phone per workflow
Changing the default device never reroutes a session that already started.
task design
Prompts that hold up on a real screen
One errand per task
Chain follow-ups in the same session. Big prompts burn the timeout.
Name apps and people exactly
“WhatsApp, not WhatsApp Business. Chat with Sam Rivera.”
Gate anything that acts
“Show me the draft and wait for my OK before sending.”
Say what the result looks like
“Airline / time / price, one per line. Say so if none.”
Draw read-only lines
“Don't reply, don't archive, don't open links.”
Fragile
Check my battery, then go through all my unread email, reply to the important ones, find me a flight to Denver, and update my calendar.
Reliable
On my phone, open my calendar and tell me my first three events today. Don't change anything. If unsure, stop and ask me.
Always include an escape hatch: “if you're unsure, stop and ask me.” It turns a wrong guess into a handoff.
part 4
Go deeper & build
Trust, what runs on the phone, fixing problems, then your turn.
trust model
Treat it like your unlocked phone
Trust decision 1
Your client
It sees screen content and drives the phone. Connect only clients you trust.
Trust decision 2
Your credentials
An OAuth grant or API key is full control. Prefer OAuth. Revoke keys on any doubt.
Trust decision 3
What's on screen
Data, never instructions. A message saying “tap Allow” is not you.
Built in
Sensitive steps always come back as needs_user_control. State snapshots leave out IMEI, serial, contacts, location and notifications. Everything happens visibly on the screen.
Your part
Gate sends, buys and deletes in the prompt. Use a test phone for QA. phone_device_pause is the kill switch for new work. Results and screenshots can hold personal data.
inside the android app
What happens after the cloud dispatches
FCM
Wake-up push
Agents API stores the task and sends an FCM remote_task push that only references it.
Fetch
Load the task
The app fetches the prompt and deadline from Agents API, retrying through replica lag.
Claim
Own the lane
Persisted so it survives process death, then queued on the one device lane chat and voice also use.
Act
Step loop
Each step asks the action model what to do next. Accessibility taps and types it.
Report
Steps and result
Steps with screenshot thumbnails, then one terminal result. Retried up to 30 times; the first result wins.
Source: feature/remote-control in agi-inc/mobile. One agent loop serves chat, voice and remote tasks, which is why the phone runs one task at a time.
for engineers
The phone's side of the contract
Register
POST /v1/devices/register
FCM token, device model, OS and app version, and the tools the app can answer itself. The response id is the Device ID on the Developer screen.
Stay alive
POST /v1/devices/{id}/heartbeat
Every 15 minutes and after each push. A 404 triggers a fresh registration.
Answer directly
mcp_request → POST /v1/devices/{id}/mcp-result
phone_get_state never starts the agent. The phone collects the snapshot and replies within 10 s.
Push types the phone accepts
FCM type
what the phone does
remote_task
Fetch the task, queue it, run it
remote_followup
Deliver a steering message to the running task
remote_pause
Pause the task in place
remote_resume
Resume with an optional new instruction
remote_cancel
Stop it, stamped with a stop_reason
mcp_request
Answer a direct tool call
Every push carries an id, never the content. The phone fetches each body by reference, so a large prompt never hits FCM's payload size limit.
when it doesn't work
The 60-second triage
1
Can you call list_devices?
No → authentication or client config. Check the URL, re-run sign-in, check the key.
2
Is the phone online and unpaused?
No → phone side. Same account? Developer connection says Connected? Tap Refresh.
3
What does the task say?
phone_task_status: its status, terminal and error almost always name the problem.
Know your error layer
HTTP 401
Credentials never reached MCP.
JSON-RPC error
device_paused, task_not_found. Fix the call.
Task terminal
The task ran and ended. Use the outcomes table.
your turn · 25 minutes
Four labs on your own phone
Lab 1 · 5 minthe loop
Open Settings on my phone and tell me the battery percentage.
Watch for: phone_run_task, then phone_task_monitor until ok.
Lab 2 · 5 minread-only
Open my calendar and list my first three events today as time / title. Don't change anything.
Watch for: a structured result, no edits on the phone.
Lab 3 · 8 minhandoff
In WhatsApp, draft “workshop test” to my own chat. Ask me before sending.
Watch for: needs_user_control, your reply, a continuation_task_id.
Lab 4 · 7 mincontrol
Start a long browse task, then steer it mid-run, pause it, resume it, and finally pause the whole device.