Skip to content

Mobile MCP: let AI agents drive your iOS and Android apps. MCP server for simulators, emulators and real devices. Works with Claude Code, Codex, Cursor and any MCP client.

feat: add MOBILEMCP_DISABLE_TELEMETRY env to opt out of telemetry (#305)

Gil Megidish26a137c45077
diff --git a/README.md b/README.md
index d3330fd..6119d41 100644
--- a/README.md
+++ b/README.md
@@ -460,6 +460,30 @@ When launched, Mobile MCP can connect to:
Make sure you have your mobile platform SDKs (Xcode, Android SDK) installed and configured properly before running Mobile Next Mobile MCP.
+### Telemetry
+
+Mobile MCP collects anonymous usage telemetry via PostHog. To disable it, set the `MOBILEMCP_DISABLE_TELEMETRY` environment variable:
+
+```bash
+MOBILEMCP_DISABLE_TELEMETRY=1 npx @mobilenext/mobile-mcp@latest
+```
+
+For json configurations:
+
+```json
+{
+ "mcpServers": {
+ "mobile-mcp": {
+ "command": "npx",
+ "args": ["-y", "@mobilenext/mobile-mcp@latest"],
+ "env": {
+ "MOBILEMCP_DISABLE_TELEMETRY": "1"
+ }
+ }
+ }
+}
+```
+
### Running in "headless" mode on Simulators/Emulators
When you do not have a real device connected to your machine, you can run Mobile MCP with an emulator or simulator in the background.
diff --git a/src/server.ts b/src/server.ts
index 4fa9b0b..64a833a 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -104,6 +104,10 @@ export const createMcpServer = (): McpServer => {
};
const posthog = async (event: string, properties: Record<string, string | number>) => {
+ if (process.env.MOBILEMCP_DISABLE_TELEMETRY) {
+ return;
+ }
+
try {
const url = "https://us.i.posthog.com/i/v0/e/";
const api_key = "phc_KHRTZmkDsU7A8EbydEK8s4lJpPoTDyyBhSlwer694cS";