Skip to content

docs(mcp-analytics): Ruby identify reads the Authorization header - #21662

Merged
lucasheriques merged 2 commits into
masterfrom
lucas/mcp-ruby-auth-header
Oct 29, 2026
Merged

lucasheriques merged 2 commits into
masterfrom
lucas/mcp-ruby-auth-header

Conversation

@lucasheriques

Copy link
Copy Markdown
Contributor

Merge after posthog-ruby 3.29.0 ships. These docs describe behavior from PostHog/posthog-ruby#320. Check the version number once it's released.

Changes

PostHog/posthog-ruby#320 gives MCP identify, intent_fallback and event_properties callbacks every HTTP request header in extra["headers"], with lowercase keys. Before that, Ruby passed only four headers, so these docs told Ruby users that identify can't read Authorization.

  • identifying-users.mdx. The Ruby identify sample now resolves the user from the authorization bearer token, the same way the TypeScript and Python samples do. The paragraph after it no longer sends Ruby users to a session lookup or the custom dispatcher.
  • installation/ruby.mdx. The extra description now says headers holds every request header. The bearer-token sample replaces the session lookup. The page also warns that raw header values returned in properties: or event_properties are sent unredacted, which matches the Python helper's docstring.

Checklist

  • Words are spelled using American English
  • Use relative URLs for internal links
  • I didn't change any URLs

@lucasheriques lucasheriques self-assigned this Oct 27, 2026
@github-actions github-actions Bot added docs Improvements or additions to product documentation, "Docs" content PR only touches files under contents/ labels Oct 27, 2026
PostHog/posthog-ruby#320 passes every HTTP request header to MCP callbacks in
extra["headers"]. The Ruby identify samples in identifying-users.mdx and
installation/ruby.mdx now resolve the user from the bearer token, like the TS
and Python samples, instead of saying Ruby can't read Authorization and
pointing at a session lookup or the custom dispatcher. installation/ruby.mdx
also carries the "don't return raw header values" warning.

Gated on posthog-ruby 3.29.0: confirm the version once #320 ships, then merge.
Tested: diff reviewed. No local node_modules, so fix-mdx/vale run in CI.
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview

Status Details Updated (UTC)
🟢 Ready View preview Oct 29, 2026 06:02PM

Changed pages

Page Source
Identifying users contents/docs/mcp-analytics/identifying-users.mdx
Ruby MCP Analytics installation contents/docs/mcp-analytics/installation/ruby.mdx

@lucasheriques
lucasheriques force-pushed the lucas/mcp-ruby-auth-header branch from 230f082 to 22123d2 Compare October 27, 2026 22:46
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Vale prose linter → found 0 errors, 11 warnings, 3 suggestions in your markdown

Full report → Copy the linter results into an LLM to batch-fix issues.

Linter being weird? Update the rules!

contents/docs/mcp-analytics/identifying-users.mdx — 0 errors, 3 warnings, 2 suggestions
Line Severity Message Rule
14:20 warning Use 'ID' instead of 'id'. Vale.Terms
17:79 suggestion Address the reader directly. Use 'you' instead of 'the user'. PostHogDocs.DirectAddress
70:11 warning Use 'SDK' instead of 'sdk'. Vale.Terms
107:301 warning Use 'SDK' instead of 'sdk'. Vale.Terms
125:126 suggestion Address the reader directly. Use 'you' instead of 'the user'. PostHogDocs.DirectAddress
contents/docs/mcp-analytics/installation/ruby.mdx — 0 errors, 8 warnings, 1 suggestions
Line Severity Message Rule
11:226 warning Capitalize 'Logs' for PostHog's product. Use 'logs' for the general industry concept. PostHogBase.ProductNames
13:45 warning Use 'PostHog' instead of 'posthog'. Vale.Terms
17:311 warning 'Streamable' is a possible misspelling. PostHogBase.Spelling
77:11 warning 'stderr' is a possible misspelling. PostHogBase.Spelling
79:27 warning 'stdout' is a possible misspelling. PostHogBase.Spelling
79:168 warning 'stderr' is a possible misspelling. PostHogBase.Spelling
79:214 warning 'stdout' is a possible misspelling. PostHogBase.Spelling
125:80 warning 'stdout' is a possible misspelling. PostHogBase.Spelling
127:269 suggestion Address the reader directly. Use 'you' instead of 'the user'. PostHogDocs.DirectAddress

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 230f082: 1 Should fix.

See this review and its findings in PostHog Review. Comment @posthog review --deep for a Deep review. A Deep review takes longer and looks deeper than a Standard review.

```

To identify from a bearer token, use a [custom dispatcher](#custom-dispatchers), which takes `distinct_id:` on each capture.
The SDK never captures header values. Don't return a raw token, cookie, or API key in `properties:` or from `event_properties`, because the SDK doesn't redact those, and person properties persist on the person profile. Resolve the header to an ID first.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 · Identify the headers captured automatically

For HTTP requests, TransportIdentity.stamp copies User-Agent and X-Anthropic-Client into $mcp_client_user_agent and $mcp_vendor_client on captured events. The blanket privacy guarantee therefore misleads users who rely on it to keep header data out of PostHog; explicitly identify the captured exceptions.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Bundle report

Total JS (gzip)

10.53 MiB (no change)

Eager graph (modules shipped in each entrypoint's initial chunks)

Entrypoint Eager size Budget Modules
✅ app 20.39 MiB (no change) report-only 2113
Largest modules in the app closure
Module Size
./src/data/mcp-tools.json 1459.0 KiB
css ./node_modules/.pnpm/css-loader@5.2.7_webpack@5.101.3/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[1]!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.5.6_webpack@5.101.3/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[8].oneOf[1].use[2]!./src/styles/global.css 840.9 KiB
./src/components/Stickers/Stickers.tsx 696.4 KiB
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/x-ray.mjs 481.2 KiB
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/trenchcoat.mjs 450.8 KiB
./node_modules/.pnpm/rehype-raw@7.0.0/node_modules/rehype-raw/lib/index.js + 29 modules 395.1 KiB
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/im-the-driver.mjs 385.8 KiB
./src/hooks/useCustomers.tsx + 61 modules 381.8 KiB
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/tourist.mjs 364.6 KiB
./node_modules/.pnpm/@posthog+icons@0.36.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js 354.8 KiB
./node_modules/.pnpm/react-markdown@8.0.7_@types+react@16.14.66_react@18.3.1/node_modules/react-markdown/lib/react-markdown.js + 88 modules 351.4 KiB
./src/components/ProductComparisonTable/index.tsx + 130 modules 314.4 KiB
./node_modules/.pnpm/framer-motion@14.0.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/framer-motion/dist/es/render/components/motion/proxy.mjs + 126 modules 287.2 KiB
./node_modules/.pnpm/@posthog+brand@0.13.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/doll-house.mjs 284.1 KiB
./node_modules/.pnpm/cloudinary-core@2.14.0_lodash@4.17.21/node_modules/cloudinary-core/cloudinary-core.js 281.9 KiB

Eager-graph budgets are report-only until a baseline is established. Sizes are gzip of public/**/*.js; eager size is webpack module source bytes for the modules actually shipped in the entrypoint's initial chunks (post-tree-shake).

@lucasheriques
lucasheriques merged commit 8a278a6 into master Oct 29, 2026
21 checks passed
@lucasheriques
lucasheriques deleted the lucas/mcp-ruby-auth-header branch October 29, 2026 18:28
@github-project-automation github-project-automation Bot moved this from Backlog to Done in PostHog.com planning Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

content PR only touches files under contents/ docs Improvements or additions to product documentation, "Docs"

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant