Experiments · No. 01 · Source on GitHub

Reproduce Experiment 01: Claude operates the phone

Warning

Highly experimental. Proceed with caution. Reproducing this means flashing a new operating system and running code as root. One wrong step can brick your phone or erase everything on it. Use a spare phone you can afford to lose.

Claude Code on your computer drives the phone through an MCP server that runs on the phone: it reads the screen, places a call and hangs up. Write-up and video: Experiment 01.

You need

Steps

  1. Start the MCP server on the phone. With the phone on USB, from the repository folder:

    ./mcp/run.sh
    

    It builds the server, pushes it to the phone, forwards port 7071 to your computer and starts it. Leave this terminal open: every tool call Claude makes is printed here.

  2. Check it answers, in a second terminal:

    curl -s http://127.0.0.1:7071/mcp -H 'Content-Type: application/json' \
      -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"device_status","arguments":{}}}'
    

    You should get the battery level, network and foreground app as JSON.

  3. Start Claude Code in the same second terminal, from the repository folder:

    claude
    

    The repository's .mcp.json points Claude Code at the phone. Approve the rethink-phone server when asked. Type /mcp to check it shows as connected with 13 tools.

  4. Ask it to do things on the phone. These are the prompts from the video:

    • Can you tell me what is on my phones screen right now ?
    • can you call <a number or a contact's name>
    • please end the call

    Claude Code asks before each tool call. Approve them, or press Shift+Tab to switch to auto mode, as in the video.

  5. Optional: send a text. Send a text to <name> saying hello. Claude opens Messages with the text filled in, reads the screen, and taps Send itself. Nothing is sent without that visible tap.

  6. Read the audit log, the phone's own record of every tool call:

    $ADB shell cat /data/local/tmp/rethink/mcp-audit.jsonl
    

Press Ctrl-C in the first terminal to stop the server.

If something's off

Code

mcp/: two Java files, built with javac and d8, run as root with app_process.