Skip to content

PostHog Integration

The PostHog node lets your agents capture custom events, query analytics with HogQL, and manage insights and cohorts.

PostHog requires two different keys for full functionality:

When connecting PostHog via Settings → Integrations, Spawnbase authenticates using a Personal API key (phx_...).

  1. Go to PostHog → Settings → Personal API Keys
  2. Click Create personal API key
  3. Grant scopes: organization:read, project:read, event:read, event:write
  4. Use this key when connecting PostHog in Spawnbase

The Capture Event action requires a separate Project API key as an input field.

  1. Go to PostHog → Settings → Project API Key
  2. Copy the key (phc_...) and paste it into the projectApiKey field in the node configuration
ToolDescription
query-runRun trends, funnels, retention, lifecycle, paths, and stickiness queries
query-generate-hogql-from-questionGenerate and run HogQL queries from natural language
query-trendsQuery trend data for events over time
query-funnelAnalyze conversion funnels
query-retentionAnalyze user retention
query-lifecycleQuery user lifecycle stages
query-pathsAnalyze user navigation paths
entity-searchSearch insights, dashboards, experiments, flags, cohorts, and more by name
ToolDescription
insight-create-from-queryCreate a new insight from a query
insight-getGet a specific insight by ID
insight-updateUpdate an existing insight
insights-get-allList all insights in the project
dashboard-createCreate a new dashboard
dashboard-getGet a dashboard with all tiles
dashboards-get-allList all dashboards
ToolDescription
create-feature-flagCreate a feature flag with targeting rules
update-feature-flagUpdate flag rollout, filters, or variants
feature-flag-get-allList all feature flags
experiment-createCreate an A/B experiment
experiment-results-getGet experiment results
ToolDescription
persons-listList persons with filters
persons-retrieveGet a specific person’s details
cohorts-createCreate a static or dynamic cohort
cohorts-listList all cohorts
ToolDescription
alert-createCreate threshold or anomaly detection alerts on insights
alert-simulatePreview how a detector would perform on historical data
alerts-listList all alerts
ToolDescription
survey-createCreate a survey
surveys-get-allList all surveys
annotation-createMark deployments or changes on charts
activity-logs-listView who changed what and when
docs-searchSearch PostHog documentation
  • Capture Event uses the Project API key (phc_...), not the Personal API key — this trips up most users.
  • Create Query accepts HogQL — useful for flexible analytics queries your agent can construct dynamically.
  • Most read actions require organization and project_id fields — these load dynamically from your connected account.
Server URLhttps://mcp.posthog.com/mcp
TransportStreamable HTTP
DocsPostHog MCP

See Node Configuration Troubleshooting for common issues like empty dropdowns and connection errors.