PostHog integration
Open-source product analytics platform for tracking user behavior, feature flags, session recordings, and A/B testing. Build data-driven products with event tracking, funnel analysis, retention metrics, and user cohorts. Essential for product teams needing self-hosted analytics, experimentation, and real-time user insights.
Say what should happen.
The workflow builds itself.
Common PostHog use cases
- Modify targeting rules
- Create NPS survey
- End running survey
- Launch new A/B test
- End running experiment
- Play back user session
- Remove outdated survey
- Discover tracked events
- Fetch saved report data
- List deployment markers
What you can do with PostHog
Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.
Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.
Feature flag, 5 operations
create_feature_flagCreate feature flagPOSTCreate a new feature flagevaluate_feature_flagsEvaluate feature flagsPOSTEvaluate feature flags for a userget_feature_flagGet feature flagGETGet feature flag details by IDlist_feature_flagsList feature flagsGETList all feature flags in projectupdate_feature_flagUpdate feature flagPATCHUpdate feature flag configuration
Person, 5 operations
create_aliasCreate aliasPOSTCreate alias to merge user identitiesdelete_personDelete personDELETEDelete a person from PostHogget_personGet personGETGet person details by IDidentify_userIdentify userPOSTIdentify and update user profile propertieslist_personsList personsGETList all users/persons in project
Survey, 5 operations
create_surveyCreate surveyPOSTCreate a new surveydelete_surveyDelete surveyDELETEDelete a surveyget_surveyGet surveyGETGet survey details by IDlist_surveysList surveysGETList all surveys in projectupdate_surveyUpdate surveyPATCHUpdate survey configuration
Experiment, 4 operations
create_experimentCreate experimentPOSTCreate a new A/B test experimentget_experimentGet experimentGETGet experiment details and resultslist_experimentsList experimentsGETList all A/B test experimentsupdate_experimentUpdate experimentPATCHUpdate experiment configuration
Cohort, 3 operations
create_cohortCreate cohortPOSTCreate a new user cohortget_cohortGet cohortGETGet cohort details by IDlist_cohortsList cohortsGETList all user cohorts
Annotation, 2 operations
create_annotationCreate annotationPOSTCreate annotation marker on graphslist_annotationsList annotationsGETList all annotations in project
Dashboard, 2 operations
get_dashboardGet dashboardGETGet dashboard details by IDlist_dashboardsList dashboardsGETList all dashboards in project
Event, 2 operations
batch_captureBatch capturePOSTBatch capture multiple events in one requestcapture_eventCapture eventPOSTCapture and track a user event
Group, 2 operations
group_identifyGroup identifyPOSTIdentify and update group propertieslist_groupsList groupsGETList all groups by type
Insight, 2 operations
get_insightGet insightGETGet insight details and resultslist_insightsList insightsGETList all saved insights and reports
Session recording, 2 operations
get_session_recordingGet session recordingGETGet session recording detailslist_session_recordingsList session recordingsGETList session recordings
Action, 1 operation
list_actionsList actionsGETList all defined actions
Event definition, 1 operation
list_event_definitionsList event definitionsGETList all event definitions
Property definition, 1 operation
list_property_definitionsList property definitionsGETList all property definitions
Query, 1 operation
query_hogqlQuery hogqlPOSTExecute HogQL SQL query
Use PostHog from Claude Code, Cursor or Codex
Connect PostHog in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its PostHog operations become tools the client can call, next to every other integration you connected.
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"
[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"{
"mcpServers": {
"livecontext": {
"type": "http",
"url": "https://livecontext.ai/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}How to connect PostHog
- Create your workspace
Sign up free. Nothing to install.
- Connect PostHog once
Add your PostHog connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.
- Describe the job in chat
The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.
PostHog integration FAQ
What can you do with the PostHog integration?
LiveContext exposes 38 operations on PostHog, covering feature flag, person, survey and experiment. Common uses include Modify targeting rules, Create NPS survey and End running survey.
