Skip to content

Add client analytics headers#301

Merged
ewlarson merged 1 commit into
developfrom
feature/client-analytics-headers
Jun 18, 2026
Merged

Add client analytics headers#301
ewlarson merged 1 commit into
developfrom
feature/client-analytics-headers

Conversation

@ewlarson

Copy link
Copy Markdown
Contributor

Summary

  • Add shared MCP client header helpers for X-BTAA-Client-* attribution and User-Agent values.
  • Send MCP client headers from the HTTP bridge and from the WebSocket bridge when the optional ws implementation is available.
  • Update the QGIS plugin client channel to qgis and cover the expected analytics headers in tests.
  • Document the MCP header environment variables and the current first-party client identities.

Why

The analytics program needs stable first-party client attribution across desktop and MCP clients, not only browser and SSR traffic. These headers let downstream analytics distinguish QGIS, MCP HTTP bridge, and MCP WebSocket bridge requests.

Impact

MCP bridge and QGIS traffic can now be attributed with explicit client name, version, channel, and optional instance metadata. The WebSocket bridge warns when it falls back to a WebSocket implementation that cannot attach custom handshake headers.

Validation

  • /Users/ewlarson/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node --test mcp/client_headers.test.js mcp/mcp_http_bridge.test.js mcp/mcp_websocket_bridge.test.js
  • /Users/ewlarson/.pyenv/versions/3.13.1/bin/python -m pytest qgis-plugin/tests

Note: python -m pytest qgis-plugin/tests passed with an existing pytest-asyncio deprecation warning about asyncio_default_fixture_loop_scope.

@ewlarson ewlarson force-pushed the feature/client-analytics-headers branch from 8d6b5e7 to ef9e3c9 Compare June 18, 2026 22:19
@ewlarson ewlarson marked this pull request as ready for review June 18, 2026 22:22
@ewlarson ewlarson merged commit 689a524 into develop Jun 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant