-
Notifications
You must be signed in to change notification settings - Fork 178
Using SSE Transport
mobile-mcp supports for stdin and SSE transports.
The Server-Sent-Events transport allows mobile-mcp to be running on a different host than the client itself.
For example, consider this architecture. A Claude Code client is running on my Windows machine, which is connected to a remote mac which is running mobile-mcp, and that is connected to iphone through usb.
+--------+ +------------+ +------------+ +--------+
| Claude |----->| remote mac |----->| mobile-mcp |----->| iphone |
+--------+ +------------+ +------------+ +--------+
To get started, we need 2 things to be configured:
-
mobile-mcp
is running and listening on a port - Client is configured to connect to mcp through this address
To run mobile-mcp, simply execute the following command. Modify the port 10000 to your preferred port number.
npx -y @mobilenext/mobile-mcp --port 10000
It will return a response like:
mobile-mcp sse server listening on http://localhost:10000/mcp
Similarly to adding mobile-mcp
with stdin transport, configuring is done in the same fashion:
Command line:
claude mcp add --transport sse mobile-mcp http://localhost:10000/mcp
Through json configuration:
"mcpServers": {
"mobile-mcp": {
"type": "sse",
"url": "http://localhost:10000/mcp"
}
},
Notice that you cannot provide environment variables through this transport configuration. Environment variables such as ANDROID_HOME have to be exported prior to starting the mobile-mcp
server itself.
From Mobile Next: We are building the future of mobile development 📱 🚀