PostHog
Proxy PostHog's hosted MCP server for analytics, feature flags, error tracking, HogQL, and more.
Example questions
Try asking your AI client
-
Why did signup conversion drop in PostHog this week?
-
Did the new onboarding flag ever get rolled out past 10 percent?
-
Which errors spiked after yesterday's deploy?
-
Write a short insight brief for Amalie - do not change flags.
-
How many people used the private gateway in the last 7 days?
Overview
Proxy PostHog's hosted MCP server for analytics, feature flags, error tracking, HogQL, and more. Hub-native list_projects and get_project tools are always available. Additional tools mirror upstream dynamically after connect.
Prerequisites
- A PostHog account with access to the org/project you want AI to query
- A stackgate.ai account
Getting credentials
- Open Integrations → PostHog in stackgate.ai.
- Click Activate, then Connect PostHog.
- Complete PostHog OAuth (RFC 9728 / PKCE).
- Open Preferences to pin a default organization, project, region (US/EU), and optional read-only mode. All feature categories are selected by default after connect.
You can optionally override with a PostHog personal API key in preferences instead of OAuth.
Using with AI clients
- Dedicated endpoint:
POST /mcp/posthog - Private gateway:
posthog__*namespaced tools (mirrored from upstream) - Use list_projects / get_project to discover project ids before pinning one. Both return
active_scopeso you can confirm the pinned org/project. - Call switch_project with
projectId(or pin a project in Preferences) so later analytics and SQL target that project. - Pass optional
organization_idandproject_idon analytics tools such asexecute_sqlandquery_web_overviewto override the pin for that call only. - Run refresh_tools after connect to sync the latest upstream tool list. That tool is handled by stackgate.ai and is not forwarded upstream.
See PostHog MCP documentation for upstream capabilities.
Troubleshooting
- OAuth failed — confirm PostHog OAuth client registration for your region (US vs EU MCP URL).
- Empty tool list — call refresh_tools after connect; upstream may require org/project preferences.
- Token expired — reconnect PostHog from My Integrations.
Available tools
list_projects and get_project are always available. Additional tools are mirrored dynamically from PostHog's hosted MCP server after you connect. Use refresh_tools to sync the latest upstream tool list.
- Analytics queries and HogQL
- Feature flags inspection
- Error tracking and session replay metadata
- Experiment and dashboard context
See also: upstream MCP documentation.
MCP endpoint:
https://stackgate.ai/mcp/posthog
(HTTP) or via the
private gateway.
Related workflows
Multi-integration playbooks that use PostHog to solve concrete business outcomes.