:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(mcp): align read-only header name with sandbox (#58990)
Georgiy Tarasov04c30d2929e2
diff --git a/services/mcp/src/index.ts b/services/mcp/src/index.tsindex dd3000f35480..eb6bbf9c7d1c 100644--- a/services/mcp/src/index.ts+++ b/services/mcp/src/index.ts@@ -376,7 +376,7 @@ const handleRequest = async (const version = Number(request.headers.get('x-posthog-mcp-version') || url.searchParams.get('v')) || 1- const readOnlyRaw = request.headers.get('x-posthog-readonly') || url.searchParams.get('readonly')+ const readOnlyRaw = request.headers.get('x-posthog-read-only') || url.searchParams.get('readonly')const readOnly = readOnlyRaw === 'true' || readOnlyRaw === '1' || undefined// Explicit selection between tool-based and CLI-based MCP. Falls back to thediff --git a/services/mcp/src/lib/request-properties.ts b/services/mcp/src/lib/request-properties.tsindex d951b3fcb513..369572a88fb1 100644--- a/services/mcp/src/lib/request-properties.ts+++ b/services/mcp/src/lib/request-properties.ts@@ -56,7 +56,7 @@ export function parseRequestProperties(const params = url.searchParamsconst token = request.headers.get('Authorization')?.split(' ')[1] ?? ''- const readOnlyRaw = header(request, 'x-posthog-readonly') || params.get('readonly')+ const readOnlyRaw = header(request, 'x-posthog-read-only') || params.get('readonly')return {apiToken: token,