Skip to content

feat: add ?consumer= query param as highest-priority consumer identification#92

Merged
klappy merged 1 commit into
mainfrom
feat/consumer-query-param
Apr 15, 2026
Merged

feat: add ?consumer= query param as highest-priority consumer identification#92
klappy merged 1 commit into
mainfrom
feat/consumer-query-param

Conversation

@klappy
Copy link
Copy Markdown
Owner

@klappy klappy commented Apr 15, 2026

What

Adds ?consumer= query parameter as the highest-priority consumer label resolution in oddkit telemetry.

Why

Platforms like Claude.ai, ChatGPT, and ElevenLabs don't support custom HTTP headers in their MCP client configuration. Users on these platforms have no way to self-identify in telemetry today. This change lets them append ?consumer=yourname to their MCP server URL to get a meaningful consumer label instead of falling back to unknown or a generic User-Agent.

Resolution chain (updated)

  1. ?consumer= query parameter (URL-level, highest priority) — NEW
  2. x-oddkit-client header (explicit)
  3. MCP initialize clientInfo.name (protocol-native)
  4. User-Agent header (fallback)
  5. "unknown" (default)

Companion

klappy/klappy.dev#96 updates the getting started article to document this option.

Verification

  • npx tsc --noEmit passes with zero errors
  • Single file change: workers/src/telemetry.ts

Note

Low Risk
Low risk: only changes telemetry consumer label attribution by adding a new highest-priority URL query parameter, with existing sanitization preserved.

Overview
Adds support for identifying the telemetry consumer_label via a ?consumer= query parameter on the request URL, taking highest priority over existing sources.

Updates parseConsumerLabel’s resolution order and emits consumer_source: "query-param" when the parameter is used; otherwise behavior remains the same (header → initialize clientInfo.nameUser-Agentunknown).

Reviewed by Cursor Bugbot for commit f95b13b. Bugbot is set up for automated code reviews on this repo. Configure here.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
oddkit f95b13b Commit Preview URL

Branch Preview URL
Apr 15 2026, 01:45 AM

@klappy klappy merged commit b89fd44 into main Apr 15, 2026
5 checks passed
@klappy klappy deleted the feat/consumer-query-param branch April 15, 2026 01:49
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