Connect from Host
The recommended path is adb forwarding. It keeps the MCP listener phone-local while still allowing the workstation agent to connect.
sh
adb forward tcp:8765 tcp:8765
export ANDROIDUSE_MCP_SECRET="$(adb shell 'su -M -c "cat /data/adb/modules/AndroidUse/.secret/mcp_secret"' | tr -d '\r\n')"
codex mcp add androiduse --url http://127.0.0.1:8765/mcp --bearer-token-env-var ANDROIDUSE_MCP_SECRETHost and Port
The listener is configured by:
text
/data/adb/modules/AndroidUse/.config/androiduse/mcp.envDefault:
sh
ANDROIDUSE_MCP_HOST=127.0.0.1
ANDROIDUSE_MCP_PORT=8765Use 127.0.0.1 for adb-forward-only access. Use 0.0.0.0, ::, or a LAN address only on trusted networks and only after the firewall rules are deliberate.
