Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 28 additions & 20 deletions PRIVACY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Mobile Dev Privacy Policy

Last updated: 3 November 2026
Last updated: 23 November 2026

## 1. Who we are and what this policy covers

Expand Down Expand Up @@ -62,9 +62,9 @@ Use test data, scope requests to the relevant app, and review content before
sharing it. Do not provide passwords, API keys, payment-card data, health records,
or government identifiers through these workflows.

Mobile Dev does not upload this development content to Callstack's Sentry or
Mixpanel projects as telemetry. This exclusion does not prevent a tool result from reaching the
host or content you deliberately email to support from reaching Callstack.
Mobile Dev excludes this development content from diagnostics and product
analytics. Tool results can still reach the host, and content you deliberately
email to support can still reach Callstack.

### Diagnostics and usage telemetry

Expand Down Expand Up @@ -96,18 +96,22 @@ not a reason to put secrets into your test data.

### Product analytics

Release builds send basic product analytics to Mixpanel so we can see how many
installations use Mobile Dev and which tools they use most. Events record that a
host session started or that a tool was called, with the tool's name, whether it
succeeded, the host (Codex, Claude, Cursor, the Mac app or other), the plugin
version, the operating system type, a timestamp, and the random installation ID
described above. Frequent polling and input tools are not recorded.

Analytics events never contain MCP arguments or results, app or device content,
device names or identifiers, project paths, or account details. They go to
Mixpanel's EU ingestion endpoint with IP collection turned off, so Mixpanel does
not store your IP address or derive a location from it. We do not create user
profiles, combine analytics with other data about you, or use them for advertising.
Starting with version 0.1.190, release builds send basic product analytics to Anal
at `anal.margelo.com` so we can see how many installations use Mobile Dev and which
tools they use most. Events record that a host session started or that a tool
was called, with the tool's name, whether it succeeded, the host (Codex, Claude,
Cursor, the Mac app or other), the plugin version, the operating system type, a
timestamp, and the random installation ID described above. Frequent polling and
input tools are not recorded.

Analytics events exclude MCP arguments and results, app and device content,
device names and identifiers, project paths, and account details. Anal receives
requests with IP-derived location disabled and excludes the IP address from
analytics records. Each connected session creates or updates a pseudonymous
installation profile with the same random installation ID, host, plugin
version, and operating system type. We use this ID to link events to the
installation. We do not combine analytics with other data about you or use them
for advertising.

### Updates and support

Expand Down Expand Up @@ -141,8 +145,11 @@ telemetry controls and the right to object.
Callstack. The configured ingestion endpoints are in Sentry's German region.
This alone is not a promise that every support, subprocessor, or administrative
operation takes place exclusively in Germany.
- **Mixpanel:** processes the product analytics described above for Callstack,
in its EU data residency region.
- **Anal:** Margelo operates the product analytics service. Vercel hosts
ingestion and processes batches in the United States. MotherDuck stores the
analytics records.
- **Mixpanel:** earlier releases with product analytics send data to Mixpanel's
EU region.
- **OpenAI or another host you use:** receives tool results and content supplied
through that host. Its processing and retention are governed by your relationship
with that provider, not the Sentry opt-out.
Expand All @@ -168,7 +175,8 @@ and [OpenAI's privacy policy](https://openai.com/policies/privacy-policy/).
| --- | --- |
| Sentry errors/crashes | 90 days under our Sentry Team plan. |
| Sentry performance spans and Application Metrics | 30 days under our Sentry Team plan. |
| Mixpanel product analytics | Up to 24 months, then deleted. |
| Product analytics in Anal | Contact us for the retention period that applies to your records. |
| Product analytics in Mixpanel | Up to 24 months, then deleted. |
| Local live logs | Held in bounded memory buffers. A server log session expires after five minutes without reads or keep-alives; closing the session stops collection. Copies already attached to the host follow the host's retention. |
| Saved performance recordings | Stored under `~/Library/Application Support/mobile-dev/recordings` until you remove them; the recording store has no automatic age-based expiry. |
| TraceSift integration results/references and the chosen project folder | Stored under `~/.tracesift/integrations/mobile-dev` by default, or the corresponding `TRACE_SIFT_HOME` directory, until removed. Original profiles and the TraceSift service's own data are separate. |
Expand All @@ -193,7 +201,7 @@ operating system, and your own backup tools manage their copies separately.
components and prevents creation of a new installation ID. It does not delete
reports already sent or disable GitHub update checks or host processing.
- **Disable product analytics only:** set `MOBILE_DEV_ANALYTICS=off` (or
`DO_NOT_TRACK=1`) in the same environment and restart. Mixpanel events stop;
`DO_NOT_TRACK=1`) in the same environment and restart. Product analytics stops.
Sentry error and performance reporting continues unless you also turn it off.
- **Reset the installation ID:** stop Mobile Dev processes and remove only the
`anonymous-user-id` file listed above. A new ID is generated on the next start
Expand Down
19 changes: 10 additions & 9 deletions docs/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,23 @@ shell has no native Sentry SDK.

## Product analytics

Since 0.1.177, release MCP servers send basic product analytics to Mixpanel's EU
project to count installations and feature use. `instrumentProductAnalytics`
Starting with 0.1.190, release MCP servers send basic product analytics to the
Mobile Dev project in Anal to count installations and feature use. Earlier
releases from 0.1.177 send to Mixpanel's EU endpoint. `instrumentProductAnalytics`
(`packages/core/src/analytics.ts`) wraps the `tools/call` handler and reports
`Tool Called` with the tool name and a `success` or `error` outcome; the chat
client's initialization reports `Session Started`. Every event carries only
`host`, `plugin_version`, `os` (`process.platform`), a timestamp, an insert ID and
the server-owned installation ID as `distinct_id`. Tools `isFrequentTool` lists are
skipped. Events are batched (50 per request, at most 500 queued), sent every 30
seconds and when the plugin closes; failed batches are dropped. Requests go to
`api-eu.mixpanel.com/track?ip=0&verbose=1`: Mixpanel neither stores nor geolocates
the IP, and reports rejected batches in its reply.
`https://anal.margelo.com/track?ip=0&verbose=1`. Anal skips IP-derived location
enrichment and reports batch acceptance in its JSON reply.

Each connected session also queues an installation profile with the same
`distinct_id`, `host`, `plugin_version` and `os`. Profiles are sent through
`api-eu.mixpanel.com/engage?ip=0&verbose=1` with `$ip: "0"`, so they appear in
Mixpanel's Users view without IP-derived location, names or account details.
`https://anal.margelo.com/engage?ip=0&verbose=1` with `$ip: "0"`, so they appear
in Anal's Users view without IP-derived location, names or account details.
Existing events join the profile by installation ID. Profiles are pseudonymous,
not a guarantee of anonymisation under data protection law. A failed profile
update stays pending until the next flush; closing makes one final attempt and
Expand All @@ -84,11 +85,11 @@ discards any pending update. Profile failures do not prevent event delivery.
Development builds send nothing, and neither does the iOS mirror service. The
choice is made when the server starts: `MOBILE_DEV_TELEMETRY=off` turns analytics
off along with Sentry; `MOBILE_DEV_ANALYTICS=off` or `DO_NOT_TRACK=1` turns off only
analytics, including profile updates. `analytics.flush` counts each Mixpanel request
with `component=server` and `outcome=success` only when Mixpanel accepted the batch.
analytics, including profile updates. `analytics.flush` counts each ingestion request
with `component=server` and `outcome=success` only when the service accepts the batch.
The bounded `endpoint` attribute distinguishes `track` event batches from `engage`
profile updates; before installation profiles, the metric counted only event batches.
The panel UI sends nothing to Mixpanel, and its CSP is unchanged.
The MCP server handles all product analytics requests.

## Volume policy

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobile-dev",
"version": "0.1.189",
"version": "0.1.190",
"private": true,
"workspaces": [
"packages/shared",
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
import type { CallToolRequest, CallToolResult } from "@modelcontextprotocol/sdk/types.js";
import { PLUGIN_VERSION } from "@mobile-dev/shared/version.ts";
import { isFrequentTool, MIXPANEL_TOKEN, MIXPANEL_TRACK_URL, MIXPANEL_ENGAGE_URL, TELEMETRY_INTERVAL_MS } from "@mobile-dev/shared/telemetry.ts";
import { ANALYTICS_ENGAGE_URL, ANALYTICS_TOKEN, ANALYTICS_TRACK_URL, isFrequentTool, TELEMETRY_INTERVAL_MS } from "@mobile-dev/shared/telemetry.ts";
import type { TelemetryEnvironment, TelemetryHost } from "@mobile-dev/shared/telemetry.ts";
import { TELEMETRY_ENVIRONMENT } from "./telemetry-environment.ts";
import { getTelemetryIdentity } from "./telemetry-identity.ts";
import { recordAnalyticsFlush, serverTelemetryHost } from "./telemetry.ts";

// Mixpanel takes at most 50 events per request; the queue stays bounded while it is unreachable.
// Bound the request size and the queue while ingestion is unavailable.
const BATCH_SIZE = 50;
const MAX_QUEUED = 500;

Expand Down Expand Up @@ -54,12 +54,12 @@ async function deliver(send: Send, url: string, batch: AnalyticsEvent[] | Analyt
}

/**
* Sends pseudonymous product analytics to Mixpanel from release servers: connected host sessions and
* Sends pseudonymous product analytics to Anal from release servers: connected host sessions and
* the tools they call, plus an installation profile with its host, plugin version and OS. Never sends
* arguments, results, device details, paths or IP properties. Install before tools register.
*/
export function instrumentProductAnalytics(server: McpServer, options: AnalyticsOptions = {}): ProductAnalytics {
const { token = MIXPANEL_TOKEN, environment = TELEMETRY_ENVIRONMENT, userId = getTelemetryIdentity()?.userId, send = fetch } = options;
const { token = ANALYTICS_TOKEN, environment = TELEMETRY_ENVIRONMENT, userId = getTelemetryIdentity()?.userId, send = fetch } = options;
if (token === "" || environment !== "release" || userId === undefined || optedOut()) return disabled;
const distinctId = userId;
const queue: AnalyticsEvent[] = [];
Expand All @@ -71,13 +71,13 @@ export function instrumentProductAnalytics(server: McpServer, options: Analytics
async function drain() {
const profile = pendingProfile;
if (profile !== undefined) {
const outcome = await deliver(send, MIXPANEL_ENGAGE_URL, [profile]);
const outcome = await deliver(send, ANALYTICS_ENGAGE_URL, [profile]);
recordAnalyticsFlush(outcome, "engage");
if (outcome === "success" && pendingProfile === profile) pendingProfile = undefined;
}
while (queue.length > 0) {
const batch = queue.splice(0, BATCH_SIZE);
const outcome = await deliver(send, MIXPANEL_TRACK_URL, batch);
const outcome = await deliver(send, ANALYTICS_TRACK_URL, batch);
recordAnalyticsFlush(outcome, "track");
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function recordTraceSiftPayload(kind: "task" | "react", bytes: number) {
Sentry.metrics.gauge("tracesift.explore.payload_bytes", bytes, { unit: "byte", attributes });
}

/** Counts each batch sent to Mixpanel by whether Mixpanel accepted it. */
/** Counts each product analytics batch by whether ingestion accepted it. */
export function recordAnalyticsFlush(outcome: "success" | "failed", endpoint: "track" | "engage") {
if (process.env.MOBILE_DEV_TELEMETRY === "off") return;
Sentry.metrics.count("analytics.flush", 1, { attributes: { component: "server", outcome, endpoint } });
Expand Down
Loading
Loading