Skip to content

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_SECRET

Host and Port

The listener is configured by:

text
/data/adb/modules/AndroidUse/.config/androiduse/mcp.env

Default:

sh
ANDROIDUSE_MCP_HOST=127.0.0.1
ANDROIDUSE_MCP_PORT=8765

Use 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.

Research and education use only.