# Privacy and telemetry ## MCP server (`lantern-works-deals-mcp`) **Telemetry is off by default.** With nothing set, the server sends no telemetry and writes no telemetry file. Its only network requests fetch the public feeds (`/api/v1/*.json`) with `User-Agent: lantern-works-deals-mcp/`. ### Opt-in tool-call counter Set `LANTERN_TELEMETRY=1` to help us see which tools are used. It is enabled only when the value is exactly `1`. **What is sent:** only these fields, at most once per UTC day, in one request: ```json {"install_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "ref": "readme", "events": [{"t": "compare_gpu_prices", "v": "0.3.3", "d": "2026-10-28", "n": 4}]} ``` - `t` is the tool name, `v` the package version, `d` the UTC day and `n` the number of calls that day. - `install_id` is a random UUID generated locally the first time telemetry is on. It is stored at `~/.config/lantern-works/install_id` (or `$XDG_CONFIG_HOME/lantern-works/install_id`) with mode 0600. You can delete that file at any time; a new id is created the next time telemetry is on. It is not derived from an IP, name, hostname or any other machine identifier. The file is never created when telemetry is off. - `ref` is the value of `LANTERN_REF` if it matches `[a-z0-9][a-z0-9_-]{0,31}`, otherwise `other` if that variable is set to something else, or `none` if it is unset. **What is never sent:** - tool arguments, queries or results - IP addresses, names, hostnames, or any identifier derived from the machine - environment details other than the optional `LANTERN_REF` tag **Local files:** counts are kept in `~/.cache/lantern-works-deals-mcp/telemetry.json` (or under `$XDG_CACHE_HOME`) until the day is over. The file contains only `{day: {tool|version: count}}` and at most 7 unsent days. The install id is stored separately as described above and is not written when telemetry is off. **Failure handling:** the request runs in the background with a 2-second timeout. File and network failures are ignored, so a tool call is never blocked or broken. **Collector:** the server code is in [`collector/`](collector/), a Cloudflare Worker with a D1 database. - It validates the payload: only the fields above, known tool names, version numbers and recent days are accepted. An `install_id` must be a 36-character UUID (8-4-4-4-12 hex); anything else is ignored and not stored. Invalid or missing `ref` values are stored as `other` or `none`. - Requests are rate-limited. The limiter uses an in-memory hash, and IPs are never written to storage. - It stores the total per `(day, tool, version)` and, when a valid install id is present, `(day, install_id, ref, tool, version)`, with no request logs and no IP. - Aggregate totals are public at `GET /v1/stats`. The `installs` object reports `distinct` (unique install ids in the window), `returning` (an install id seen on two or more distinct UTC days in the stats window) and `by_ref` / `by_week`. Raw install ids are never published. **Configuration:** - `LANTERN_TELEMETRY_URL` overrides the collector address. - `LANTERN_REF` is an optional source tag sent as `ref`. - Endpoint (0.3.3 and later): `https://lantern-works-telemetry.lantern-works.workers.dev/v1/events`. Public aggregate stats: `https://lantern-works-telemetry.lantern-works.workers.dev/v1/stats`. Versions before 0.3.3 send nothing. To turn it off, unset `LANTERN_TELEMETRY` or set it to anything other than `1`. You can delete the cache file and the install-id file at any time. ## Hosted MCP endpoint The hosted worker at `https://lantern-works-mcp.lantern-works.workers.dev` publishes counts at `/stats.json`. Call counts are anonymous daily totals. Distinct-caller counts use a daily-salted hash. Weekly repeat-caller counts use a pseudonymous, weekly-rotating id, described below. - **Call counts (`hits`):** totals per UTC day × kind × path or tool × `ref` × `ua_class` × `src_class`. These rows do not include an IP address or the raw user agent. - **Distinct callers (`callers_daily`, `callers`):** for `/mcp` POSTs and successful feed fetches, the worker stores only a daily-salted SHA-256 hash of the IP address and user agent (`sha256(salt | IP | user-agent)`), plus the same coarse buckets. The raw IP and user agent are never stored, logged or returned. A random salt is created for each UTC day and deleted when that day ends, so hashes from different days cannot be linked. Hashes are kept for 120 days, then deleted. House and CI traffic is not counted. See [`docs/MEASUREMENT.md`](docs/MEASUREMENT.md). - **Weekly repeat callers (`weekly_callers`):** on an MCP initialize, if a Worker secret is configured, the hosted endpoint stores a **pseudonymous, weekly-rotating** id: a 16-character HMAC-SHA256 of the MCP client name, the client version and a coarse network prefix (IPv4 /24 or IPv6 /48), keyed by that secret plus the ISO week, so the same client on the same network keeps the same id within a week, and stored ids cannot be linked across weeks. The raw IP, the prefix, the client name and the client version are never stored, logged or returned. Each stored row holds only the ISO week, the hash and the UTC days that hash was seen; stored ids are deleted after about 18 weeks. Public counts at `/stats.json` are, per ISO week, `distinct_callers` (how many distinct hashes) and `callers_3plus_days` (how many of those hashes were seen on 3 or more distinct UTC days). Our own traffic, CI, known bots, GitHub Actions and MCP Registry health checks (`ref=mcp-registry`, or a registry-like client name) are not counted. If the secret is not set, or no usable network prefix is available, nothing is recorded and the request is unchanged. See [`docs/MEASUREMENT.md`](docs/MEASUREMENT.md). - **Demand counts (`demand_daily`):** for hosted GPU tool calls (`compare_gpu_prices`, `estimate_job_cost`, `optimize_agent_stack`), totals per UTC day × tool × GPU family × region group × price tier × cheapest provider. The GPU family and region group are bucketed to fixed lists: a missing value is stored as `any`, and anything else as `other`. The price tier and provider describe the first result in our own answer, or `none` when there was none. These rows do not include an IP address, the raw user agent, a caller hash, the tool arguments or any free text. Kept for 120 days. House and CI traffic and known bots are not counted. - **Opt-in price watches:** if you create a watch key, the worker stores a hash of the key, the webhook URL, an optional email, your watches and per-key daily counts. Call arguments are not stored. ## Website The site uses Cloudflare Web Analytics for page views; it sets no cookies. Clicks on search, compare, calculator and outbound links are counted as virtual page views under `/e/...`. Deal links (and the `tracked_url` field in the feed and MCP results) go through a `/go/` redirect on the telemetry worker. Vendor links use `/go/v/` (the slug is resolved only from the served GPU feed: a disclosed referral URL, else that vendor's checked source URL, else the redeem URL of the vendor's only deal; never a caller-supplied URL). Both add one to an aggregate counter per UTC day, deal id (vendor links are stored as `v:`), provider, `src` and `?ref=` tag, then redirect to that listed URL. The counter also keeps a coarse user-agent class (`ua_class`: browser, bot, script, prefetch or other) worked out from the User-Agent and prefetch headers at request time; the raw user agent is never stored, so automated fetches can be left out of the published click count. No IP address, cookie, user agent or other identifier is stored.