PostHog is open-source product analytics with event tracking, funnels, feature flags, and session replay in one platform. Connecting PostHog to clariBI brings product usage data into your AI analyses through a single API key.
Why connect PostHog
Product analytics questions live behind dashboards that take time to build. Ad-hoc questions usually require SQL or saved insights.
With PostHog connected, you can ask "What is our day-1 retention this month?", "Which feature flag rollouts correlate with higher activation?", or "Funnel drop-off between signup and first action?" without writing queries.
How the connection works
clariBI talks to PostHog through its hosted MCP server at https://mcp.posthog.com/mcp. Authentication uses an API key you generate in your vendor account. Tokens stay encrypted server-side and never leave clariBI in clear form.
sequenceDiagram
actor U as You
participant C as clariBI
participant V as PostHog
U->>V: Generate an API key in PostHog dashboard
U->>C: Paste the key into the connect wizard
C->>V: list_tools (verify the key)
V-->>C: Tools available
C->>C: Encrypt and store credentials
C-->>U: Connection ready
Available tools
The AI engine selects from these read-only PostHog tools during analyses. None of them modify data in PostHog.
| Tool | Returns | Example question |
|---|---|---|
dashboard-get | A dashboard with widgets and config. | Show me the activation dashboard. |
dashboards-get-all | All dashboards in the project. | What dashboards exist? |
feature-flag-get-all | Feature flags with rollout status. | Which flags are at 100% rollout? |
feature-flag-get-definition | Definition of a single feature flag. | Show me the new-pricing flag definition. |
query-run | Run a saved or ad-hoc query. | Run the daily active users query. |
query-trends | Trend analytics over a time range. | Signups by day for the last 30 days. |
query-funnel | Funnel conversion rates. | Signup to first-action conversion? |
query-error-tracking-issues-list | Error tracking issues. | Top errors in the last 24 hours. |
query-session-recordings-list | Session recording metadata. | Recent session recordings for paying users? |
cohorts-list | Cohorts you have defined. | List user cohorts. |
cohorts-retrieve | A single cohort. | Show me the paying users cohort. |
persons-list | Person records. | Find people who triggered signup events. |
persons-retrieve | A single person. | Show me person p_001. |
hogql-schema | HogQL schema for SQL queries against events. | What event properties can I query? |
docs-search | PostHog documentation search. | How do I set up feature flags? |
Data flow during analysis
When you ask a question that maps to PostHog, the AI engine routes to the right tool, reads the result, and pairs the answer with a chart you can pin to a dashboard.
sequenceDiagram
actor U as You
participant C as clariBI
participant AI as AI engine
participant V as PostHog
U->>C: Ask a question about product analytics data
C->>AI: Plan the analysis
AI->>V: Call the right tool
V-->>AI: Tool result
AI->>AI: Summarize and chart
C-->>U: Answer plus visual
Setting up the connection
- Open Data Sources in the clariBI sidebar.
- Click Add data source.
- Open the MCP Servers tab.
- Click the PostHog card.
- In PostHog, open Settings → Personal API keys and create a new key with
analytics_readscope. - Paste the key into clariBI and click Connect.
- Give your data source a name and click Finish.
Permissions and data access
clariBI requests the scopes you granted on the API key (typically analytics_read). Choose a read-only scope when creating the key. Revoke from PostHog Settings or from clariBI Settings.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
| "Could not verify API key" | The key was created with insufficient scopes or for a different project. | Create a new personal API key with analytics_read scope on the right project, then paste it again. |
| Cloud vs self-hosted endpoint | PostHog Cloud (US/EU) and self-hosted PostHog have different endpoint URLs. | For self-hosted, contact us; the catalog defaults to PostHog Cloud. |