Server Mode
MobileCLI can run as a server, exposing all device operations via JSON-RPC over HTTP and WebSocket. This is how Mobile MCP integrates with it.
The full JSON-RPC API specification is available at mobile-next/mobile-openrpc.
Start the server
Section titled “Start the server”mobilecli server start --listen localhost:12000 --corsHTTP POST (JSON-RPC)
Section titled “HTTP POST (JSON-RPC)”Send JSON-RPC requests to the server:
curl -X POST http://localhost:12000/jsonrpc \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"devices.list","id":1}'WebSocket (JSON-RPC)
Section titled “WebSocket (JSON-RPC)”Connect via WebSocket for real-time interactions and streaming:
ws://localhost:12000/wsUse cases
Section titled “Use cases”| Interface | Best for |
|---|---|
| CLI | Scripts, CI/CD, one-off commands |
| HTTP POST | Request/response workflows, simple automation |
| WebSocket | Real-time control, screen streaming, long-lived sessions |