PostHog
PostHog is a comprehensive product and user analytics platform designed to integrate seamlessly into your workflow, providing deep insights into user behavior and product performance. It empowers teams to make data-driven decisions by capturing and analyzing user interactions in real-time.
Features
- Open-source analytics platform allowing full data ownership
- Real-time user behavior tracking and event analytics
- Built-in feature flags and A/B testing capabilities
- Easy integration with existing tech stacks and APIs
- Customizable dashboards for tailored data visualization
Benefits
- Gain complete control over your analytics data and infrastructure
- Improve user engagement through data-driven product enhancements
- Reduce reliance on third-party analytics providers, enhancing privacy
- Accelerate decision-making with actionable, real-time insights
- Optimize feature rollouts with integrated experimentation tools
Available tools
52 actions available as tools
Add insight to dashboard
Add an existing insight to a dashboard. Requires insight ID and dashboard ID. Optionally supports layout and color customization.
Dashboard create
Create a new dashboard in the project. Requires name and optional description, tags, and other properties.
Dashboard delete
Delete a dashboard by ID (soft delete - marks as deleted).
Dashboard get
Get a specific dashboard by ID. The response will include insights / tiles that are on the dashboard.
Dashboards get all
Get all dashboards in the project with optional filtering. Can filter by pinned status, search term, or pagination.
Dashboard update
Update an existing dashboard by ID. Can update name, description, pinned status or tags.
Dashboard reorder tiles
Reorder tiles (insights) on a dashboard. Provide an array of tile IDs in the desired order from top to bottom. First, use dashboard-get to retrieve the dashboard and see the current tile IDs, then provide the tile IDs in your desired order.
Docs search
Use this tool to search the PostHog documentation for information that can help the user with their request. Use it as a fallback when you cannot answer the user's request using other tools in this MCP. Only use this tool for PostHog related questions.
Error details
Use this tool to get the details of an error in the project.
List errors
Use this tool to list errors in the project.
Create feature flag
Creates a new feature flag in the project. Once you have created a feature flag, you should: Ask the user if they want to add it to their codebase, Use the "search-docs" tool to find documentation on how to add feature flags to the codebase (search for the right language / framework), Clarify where it should be added and then add it.
Delete feature flag
Delete a feature flag in the project.
Feature flag get all
Get all feature flags in the project.
Feature flag get definition
Get the definition of a feature flag. You can provide either the flagId or the flagKey. If you provide both, the flagId will be used.
Update feature flag
Update a new feature flag in the project. To enable a feature flag, you should make sure it is active and the rollout percentage is set to 100 for the group you want to target. To disable a feature flag, you should make sure it is inactive, you can keep the rollout percentage as it is.
Experiment get all
Get all experiments in the project.
Experiment create
Create a comprehensive A/B test experiment. PROCESS: 1) Understand experiment goal and hypothesis 2) Search existing feature flags with 'feature-flags-get-all' tool first and suggest reuse or new key 3) Help user define success metrics by asking what they want to optimize 4) MOST IMPORTANT: Use 'event-definitions-list' tool to find available events in their project 5) For funnel metrics, ask for specific event sequence (e.g., ['product_view', 'add_to_cart', 'purchase']) and use funnel_steps parameter 6) Configure variants (default 50/50 control/test unless they specify otherwise) 7) Set targeting criteria if needed.
Experiment delete
Delete an experiment by ID.
Experiment update
Update an existing experiment by ID. Can update name, description, lifecycle state, variants, metrics, and other properties. RESTART WORKFLOW: To restart a concluded experiment, set end_date=null, conclusion=null, conclusion_comment=null, and optionally set a new start_date. To make it draft again, also set start_date=null. COMMON PATTERNS: Launch draft (set start_date), stop running (set end_date + conclusion), archive (set archived=true), modify variants (update parameters.feature_flag_variants). NOTE: feature_flag_key cannot be changed after creation.
Experiment get
Get details of a specific experiment by ID.
Experiment results get
Get comprehensive experiment results including all metrics data (primary and secondary) and exposure data. This tool fetches the experiment details and executes the necessary queries to get complete experiment results. Only works with new experiments (not legacy experiments).
Insight create from query
Create an insight from a query that you have previously tested with 'query-run'. You should check the query runs, before creating an insight. Do not create an insight before running the query, unless you know already that it is correct (e.g. you are making a minor modification to an existing query you have seen).
Insight delete
Delete an insight by ID (soft delete - marks as deleted).
Insight get
Get a specific insight by ID.
Insight query
Execute a query on an existing insight to get its results/data. Provide the insight ID to retrieve the current query results.
Insights get all
Get all insights in the project with optional filtering. Can filter by saved status, favorited status, or search term.
Insight update
Update an existing insight by ID. Can update name, description, filters, and other properties. You should get the insight before update it to see it's current query structure, and only modify the parts needed to answer the user's request.
Query run
You should use this to answer questions that a user has about their data and for when you want to create a new insight. You can use 'event-definitions-list' to get events to use in the query, and 'event-properties-list' to get properties for those events. It can run a trend, funnel or HogQL query. Where possible, use a trend or funnel rather than a HogQL query, unless you know the HogQL is correct (e.g. it came from a previous insight.).
Query generate hogql from question
This is a slow tool, and you should only use it once you have tried to create a query using the 'query-run' tool, or the query is too complicated to create a trend / funnel. Queries project's PostHog data based on a provided natural language question - don't provide SQL query as input but describe the output you want. When giving the results back to the user, first show the SQL query that was used, then provide results in reasily readable format. You should also offer to save the query as an insight if the user wants to.
Get llm total costs for project
Fetches the total LLM daily costs for each model for a project over a given number of days. If no number of days is provided, it defaults to 7. The results are sorted by model name. The total cost is rounded to 4 decimal places. The query is executed against the project's data warehouse. Show the results as a Markdown formatted table with the following information for each model: Model name, Total cost in USD, Each day's date, Each day's cost in USD. Write in bold the model name with the highest total cost. Properly render the markdown table in the response.
Organization details get
Get the details of the active organization.
Organizations get
Get the organizations the user has access to.
Switch organization
Change the active organization from the default organization. You should only use this tool if the user asks you to change the organization - otherwise, the default organization will be used.
Projects get
Fetches projects that the user has access to in the current organization.
Event definitions list
List all event definitions in the project with optional filtering. Can filter by search term.
Event definition update
Update event definition metadata. Can update description, tags, mark status as verified or hidden. Use exact event name like '$pageview' or 'user_signed_up'.
Properties list
List properties for events or persons. If fetching event properties, you must provide an event name.
Switch project
Change the active project from the default project. You should only use this tool if the user asks you to change the project - otherwise, the default project will be used.
Survey create
Creates a new survey in the project. Surveys can be popover or API-based and support various question types including open-ended, multiple choice, rating, and link questions. Once created, you should ask the user if they want to add the survey to their application code.
Survey get
Get a specific survey by ID. Returns the survey configuration including questions, targeting, and scheduling details.
Surveys get all
Get all surveys in the project with optional filtering. Can filter by search term or use pagination.
Survey update
Update an existing survey by ID. Can update name, description, questions, scheduling, and other survey properties.
Survey delete
Delete a survey by ID (soft delete - marks as archived).
Surveys global stats
Get aggregated response statistics across all surveys in the project. Includes event counts (shown, dismissed, sent), unique respondents, conversion rates, and timing data. Supports optional date filtering.
Survey stats
Get response statistics for a specific survey. Includes detailed event counts (shown, dismissed, sent), unique respondents, conversion rates, and timing data. Supports optional date filtering.
Logs query
Search and query logs in the project. Supports filtering by severity levels (trace, debug, info, warn, error, fatal), service names, date range, and free text search. Returns log entries with their attributes, timestamps, and trace information. Supports pagination via cursor.
Logs list attributes
List available log attributes in the project. Use this to discover what attributes you can filter on when querying logs. Supports filtering by attribute type (log or resource) and searching by attribute name.
Logs list attribute values
Get possible values for a specific log attribute. Use this to discover what values exist for a given attribute key, which helps when building log queries with filters.
Actions get all
Get all actions in the project. Actions are reusable event definitions that can combine multiple trigger conditions (page views, clicks, form submissions) into a single trackable event for use in insights and funnels. Supports pagination with limit and offset parameters. Note: Search/filtering by name is not supported on this endpoint.
Action get
Get a specific action by ID. Returns the action configuration including all steps and their trigger conditions.
Entity search
Search for PostHog entities by name or description. Can search across multiple entity types including insights, dashboards, experiments, feature flags, notebooks, actions, cohorts, event definitions, and surveys. Use this to find entities when you know part of their name. Returns matching entities with their IDs and URLs.
Demo mcp ui apps
Demo tool for testing MCP Apps SDK integration. Returns sample data that is displayed in an interactive UI app. Use this to verify that MCP Apps are working correctly.