PostHog MCP
OAuth 2.1/DCR analyticsproductfeature-flagsConnect to PostHog MCP to query analytics, manage feature flags, run experiments, and interact with your product data.
PostHog MCP
What you can do
Section titled “What you can do”Connect this agent connector to let your agent:
- Analytics & insights — Run trend, funnel, path, and HogQL queries; create and retrieve insights and dashboards
- Feature flags — Create, update, evaluate, and delete flags; manage multivariate and early-access feature flags
- Experiments — Create A/B tests, configure variants and metrics, launch experiments, and retrieve results
- Surveys — Create surveys with multiple question types; retrieve response stats and submissions
- Persons & cohorts — List and query persons, create and manage cohorts, retrieve person activity
- Session recordings — List and retrieve session recordings and playlists
- Error tracking — List, merge, resolve, and suppress error tracking issues
- Events & actions — List event and property definitions, create and manage actions
- CDP & data pipelines — List and manage transformations, destinations, and external data sources
- Activity & audit — Retrieve activity logs and audit trails for all resources
Authentication
Section titled “Authentication”This connector uses OAuth 2.1/DCR with PKCE. PostHog MCP is an MCP server that issues credentials dynamically via Dynamic Client Registration — Scalekit handles DCR, obtains an access token, and automatically refreshes it before it expires. Your agent code never handles tokens directly — you only pass a connectionName and a user identifier.
Code examples
Connect a user’s PostHog account and interact with PostHog’s analytics, feature flags, experiments, and more through Scalekit. Scalekit handles the OAuth flow, token storage, and tool execution automatically.
PostHog MCP is primarily used through Scalekit tools. Use scalekit_client.actions.execute_tool() to query analytics, manage feature flags, run experiments, and retrieve insights without calling the upstream MCP server directly.
Tool calling
Use this connector when you want an agent to work with PostHog data and configuration.
- List and search feature flags with
posthogmcp_feature_flag_get_all. - Run trend, funnel, path, or HogQL queries using
posthogmcp_query_run. - Create A/B tests via
posthogmcp_experiment_createwith custom metrics and variant splits. - Retrieve survey response data with
posthogmcp_survey_statsafter creating surveys usingposthogmcp_survey_create. - Discover available events with
posthogmcp_event_definitions_listbefore building queries or funnels.
import osfrom scalekit.client import ScalekitClient
scalekit_client = ScalekitClient( client_id=os.environ["SCALEKIT_CLIENT_ID"], client_secret=os.environ["SCALEKIT_CLIENT_SECRET"], env_url=os.environ["SCALEKIT_ENV_URL"],)
auth_link = scalekit_client.actions.get_authorization_link( connection_name="posthogmcp", identifier="user_123",)print("Authorize PostHog MCP:", auth_link.link)input("Press Enter after authorizing...")
connected_account = scalekit_client.actions.get_or_create_connected_account( connection_name="posthogmcp", identifier="user_123",)
tool_response = scalekit_client.actions.execute_tool( tool_name="posthogmcp_feature_flag_get_all", connected_account_id=connected_account.connected_account.id, tool_input={},)print("Feature flags:", tool_response)import { ScalekitClient } from '@scalekit-sdk/node';import 'dotenv/config';
const scalekit = new ScalekitClient( process.env.SCALEKIT_ENV_URL!, process.env.SCALEKIT_CLIENT_ID!, process.env.SCALEKIT_CLIENT_SECRET!);const actions = scalekit.actions;
const { link } = await actions.getAuthorizationLink({ connectionName: 'posthogmcp', identifier: 'user_123',});console.log('Authorize PostHog MCP:', link);process.stdout.write('Press Enter after authorizing...');await new Promise((resolve) => process.stdin.once('data', resolve));
const connectedAccount = await actions.getOrCreateConnectedAccount({ connectionName: 'posthogmcp', identifier: 'user_123',});
const toolResponse = await actions.executeTool({ toolName: 'posthogmcp_feature_flag_get_all', connectedAccountId: connectedAccount?.id, toolInput: {},});console.log('Feature flags:', toolResponse.data);Tool list
Section titled “Tool list” posthogmcp_action_create Create a new action in the project. Actions define reusable event triggers based on page views, clicks, form submissions, or custom events. Each action can have multiple steps (OR conditions). Use actions to create composite events for insights and funnels. Example: Create a 'Sign Up Click' action with steps matching button clicks on the signup page. 7 params
Create a new action in the project. Actions define reusable event triggers based on page views, clicks, form submissions, or custom events. Each action can have multiple steps (OR conditions). Use actions to create composite events for insights and funnels. Example: Create a 'Sign Up Click' action with steps matching button clicks on the signup page.
description string optional Human-readable description of what this action represents. name string optional Name of the action (must be unique within the project) pinned_at string optional ISO 8601 timestamp when the action was pinned, or null if not pinned. Set any value to pin, null to unpin. post_to_slack boolean optional Whether to post a notification to Slack when this action is triggered. slack_message_format string optional Custom Slack message format. Supports templates with event properties. steps array optional Action steps defining trigger conditions. Each step matches events by name, properties, URL, or element attributes. Multiple steps are OR-ed together. tags array optional Tags. posthogmcp_action_delete Delete an action by ID (soft delete - marks as deleted). The action will no longer appear in lists but historical data is preserved. 1 param
Delete an action by ID (soft delete - marks as deleted). The action will no longer appear in lists but historical data is preserved.
id number required A unique integer value identifying this action. posthogmcp_action_get Get a specific action by ID. Returns the action configuration including all steps and their trigger conditions. 1 param
Get a specific action by ID. Returns the action configuration including all steps and their trigger conditions.
id number required A unique integer value identifying this action. posthogmcp_action_update Update an existing action by ID. Can update name, description, steps, tags, and Slack notification settings. 8 params
Update an existing action by ID. Can update name, description, steps, tags, and Slack notification settings.
description string optional Human-readable description of what this action represents. id number required A unique integer value identifying this action. name string optional Name of the action (must be unique within the project). pinned_at string optional ISO 8601 timestamp when the action was pinned, or null if not pinned. Set any value to pin, null to unpin. post_to_slack boolean optional Whether to post a notification to Slack when this action is triggered. slack_message_format string optional Custom Slack message format. Supports templates with event properties. steps array optional Action steps defining trigger conditions. Each step matches events by name, properties, URL, or element attributes. Multiple steps are OR-ed together. tags array optional Tags. posthogmcp_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. 2 params
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.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_activity_log_list List recent activity log entries for the project. Shows who did what and when — feature flag changes, dashboard edits, experiment launches, etc. Supports filtering by scope, user, and date range. 6 params
List recent activity log entries for the project. Shows who did what and when — feature flag changes, dashboard edits, experiment launches, etc. Supports filtering by scope, user, and date range.
item_id string optional Filter by the ID of the affected resource. page number optional Page number for pagination. When provided, uses page-based pagination ordered by most recent first. page_size number optional Number of results per page (default: 100, max: 1000). Only used with page-based pagination. scope string optional Filter by a single activity scope, e.g. "FeatureFlag", "Insight", "Dashboard", "Experiment". * 'Cohort' - Cohort * 'FeatureFlag' - FeatureFlag * 'Person' - Person * 'Group' - Group * 'Insight' - Insight * 'Plugin' - Plugin * 'PluginConfig' - PluginConfig * 'HogFunction' - HogFunction * 'HogFlow' - HogFlow * 'DataManagement' - DataManagement * 'EventDefinition' - EventDefinition * 'PropertyDefinition' - PropertyDefinition * 'Notebook' - Notebook * 'Endpoint' - Endpoint * 'EndpointVersion' - EndpointVersion * 'Dashboard' - Dashboard * 'Replay' - Replay * 'Experiment' - Experiment * 'ExperimentHoldout' - ExperimentHoldout * 'ExperimentSavedMetric' - ExperimentSavedMetric * 'Survey' - Survey * 'EarlyAccessFeature' - EarlyAccessFeature * 'SessionRecordingPlaylist' - SessionRecordingPlaylist * 'Comment' - Comment * 'Team' - Team * 'Project' - Project * 'ErrorTrackingIssue' - ErrorTrackingIssue * 'DataWarehouseSavedQuery' - DataWarehouseSavedQuery * 'Organization' - Organization * 'OrganizationDomain' - OrganizationDomain * 'OrganizationMembership' - OrganizationMembership * 'Role' - Role * 'UserGroup' - UserGroup * 'BatchExport' - BatchExport * 'BatchImport' - BatchImport * 'Integration' - Integration * 'Annotation' - Annotation * 'Tag' - Tag * 'TaggedItem' - TaggedItem * 'Subscription' - Subscription * 'PersonalAPIKey' - PersonalAPIKey * 'ProjectSecretAPIKey' - ProjectSecretAPIKey * 'User' - User * 'Action' - Action * 'AlertConfiguration' - AlertConfiguration * 'Threshold' - Threshold * 'AlertSubscription' - AlertSubscription * 'ExternalDataSource' - ExternalDataSource * 'ExternalDataSchema' - ExternalDataSchema * 'LLMTrace' - LLMTrace * 'WebAnalyticsFilterPreset' - WebAnalyticsFilterPreset * 'CustomerProfileConfig' - CustomerProfileConfig * 'Log' - Log * 'LogsAlertConfiguration' - LogsAlertConfiguration * 'ProductTour' - ProductTour * 'Ticket' - Ticket scopes array optional Filter by multiple activity scopes, comma-separated. Values must be valid ActivityScope enum values. E.g. "FeatureFlag,Insight". user string optional Filter by user UUID who performed the action. posthogmcp_advanced_activity_logs_filters Get the available filter options for activity logs — scopes, activity types, and users that have logged activity. Useful for building filter UIs or understanding what kinds of activity are tracked. 0 params
Get the available filter options for activity logs — scopes, activity types, and users that have logged activity. Useful for building filter UIs or understanding what kinds of activity are tracked.
posthogmcp_advanced_activity_logs_list List activity log entries with advanced filtering, sorting, and field-level diffs. Supports filtering by scope, activity type, user, date range, and search text. 14 params
List activity log entries with advanced filtering, sorting, and field-level diffs. Supports filtering by scope, activity type, user, date range, and search text.
activities array optional Activities. clients array optional Clients. detail_filters string optional Detail filters. end_date string optional End date. hogql_filter string optional Hogql filter. is_system boolean optional Is system. item_ids array optional Item ids. page number optional Page number for pagination. When provided, uses page-based pagination ordered by most recent first. page_size number optional Number of results per page (default: 100, max: 1000). Only used with page-based pagination. scopes array optional Scopes. search_text string optional Search text. start_date string optional Start date. users array optional Users. was_impersonated boolean optional Was impersonated. posthogmcp_alert_create Create a new alert on an insight. Alerts can use either threshold-based conditions or anomaly detection. For threshold alerts: set condition (absolute_value, relative_increase, relative_decrease) and threshold configuration with bounds. For anomaly detection: set detector_config with a detector type (zscore, mad, iqr, threshold, copod, ecod, hbos, isolation_forest, knn, lof, ocsvm, pca) and parameters like threshold (sensitivity 0-1, default 0.9) and window size. Ensemble detectors combine 2+ sub-detectors with AND/OR logic. Requires an insight ID and at least one subscribed user. 12 params
Create a new alert on an insight. Alerts can use either threshold-based conditions or anomaly detection. For threshold alerts: set condition (absolute_value, relative_increase, relative_decrease) and threshold configuration with bounds. For anomaly detection: set detector_config with a detector type (zscore, mad, iqr, threshold, copod, ecod, hbos, isolation_forest, knn, lof, ocsvm, pca) and parameters like threshold (sensitivity 0-1, default 0.9) and window size. Ensemble detectors combine 2+ sub-detectors with AND/OR logic. Requires an insight ID and at least one subscribed user.
calculation_interval string optional How often the alert is checked: hourly, daily, weekly, or monthly. * 'hourly' - hourly * 'daily' - daily * 'weekly' - weekly * 'monthly' - monthly condition object optional Alert condition type. Determines how the value is evaluated: absolute_value, relative_increase, or relative_decrease. config object optional Trends-specific alert configuration. Includes series_index (which series to monitor) and check_ongoing_interval (whether to check the current incomplete interval). detector_config object optional Detector config. enabled boolean optional Whether the alert is actively being evaluated. insight number required Insight ID monitored by this alert. Note: Response returns full InsightBasicSerializer object. name string optional Human-readable name for the alert. schedule_restriction object optional Blocked local time windows (HH:MM in the project timezone). Interval is half-open [start, end): start inclusive, end exclusive. Use blocked_windows array of {start, end}. Null disables. skip_weekend boolean optional Skip alert evaluation on weekends (Saturday and Sunday, local to project timezone). snoozed_until string optional Snooze the alert until this time. Pass a relative date string (e.g. '2h', '1d') or null to unsnooze. subscribed_users array required User IDs to subscribe to this alert. Note: Response returns full UserBasicSerializer object. threshold object required Threshold configuration with bounds and type for evaluating the alert. posthogmcp_alert_delete Delete an alert by ID. This permanently removes the alert and all its check history. Subscribed users will no longer receive notifications. 1 param
Delete an alert by ID. This permanently removes the alert and all its check history. Subscribed users will no longer receive notifications.
id string required A UUID string identifying this alert configuration. posthogmcp_alert_get Get a specific alert by ID. Returns the full alert configuration including check results, threshold settings, detector_config (for anomaly detection alerts), and subscribed users. Check results include anomaly_scores, triggered_points, and triggered_dates for detector-based alerts. By default returns the last 5 checks. Use checks_date_from and checks_date_to (e.g. '-24h', '-7d') to get checks within a time window, and checks_limit to control the maximum returned (default 5, max 500). When date filters are provided without checks_limit, up to 500 checks are returned. Check history is retained for 14 days. 4 params
Get a specific alert by ID. Returns the full alert configuration including check results, threshold settings, detector_config (for anomaly detection alerts), and subscribed users. Check results include anomaly_scores, triggered_points, and triggered_dates for detector-based alerts. By default returns the last 5 checks. Use checks_date_from and checks_date_to (e.g. '-24h', '-7d') to get checks within a time window, and checks_limit to control the maximum returned (default 5, max 500). When date filters are provided without checks_limit, up to 500 checks are returned. Check history is retained for 14 days.
checks_date_from string optional Relative date string for the start of the check history window (e.g. '-24h', '-7d', '-14d'). Returns checks created after this time. Max retention is 14 days. checks_date_to string optional Relative date string for the end of the check history window (e.g. '-1h', '-1d'). Defaults to now if not specified. checks_limit number optional Maximum number of check results to return (default 5, max 500). Applied after date filtering. id string required A UUID string identifying this alert configuration. posthogmcp_alert_simulate Run an anomaly detector on an insight's historical data without creating any alert or check records. Use this to preview how a detector configuration would perform before saving it as an alert. Requires an insight ID and a detector_config object with a type (zscore, mad, iqr, copod, ecod, hbos, isolation_forest, knn, lof, ocsvm, pca, or ensemble). Optionally specify date_from (e.g. '-48h', '-30d') to control how far back to simulate, and series_index to pick which series to analyze. Returns data values, anomaly scores per point, triggered indices and dates, and for ensemble detectors, per-sub-detector score breakdowns. 4 params
Run an anomaly detector on an insight's historical data without creating any alert or check records. Use this to preview how a detector configuration would perform before saving it as an alert. Requires an insight ID and a detector_config object with a type (zscore, mad, iqr, copod, ecod, hbos, isolation_forest, knn, lof, ocsvm, pca, or ensemble). Optionally specify date_from (e.g. '-48h', '-30d') to control how far back to simulate, and series_index to pick which series to analyze. Returns data values, anomaly scores per point, triggered indices and dates, and for ensemble detectors, per-sub-detector score breakdowns.
date_from string optional Relative date string for how far back to simulate (e.g. '-24h', '-30d', '-4w'). If not provided, uses the detector's minimum required samples. detector_config object required Detector configuration to simulate. insight number required Insight ID to simulate the detector on. series_index number optional Zero-based index of the series to analyze. posthogmcp_alert_update Update an existing alert by ID. Can update name, threshold, condition, config, detector_config, subscribed users, enabled state, calculation interval, and weekend skipping. Set detector_config to switch to anomaly detection, or set it to null to switch back to threshold mode. To snooze an alert, set snoozed_until to a relative date string (e.g. '2h', '1d'). To unsnooze, set snoozed_until to null. 13 params
Update an existing alert by ID. Can update name, threshold, condition, config, detector_config, subscribed users, enabled state, calculation interval, and weekend skipping. Set detector_config to switch to anomaly detection, or set it to null to switch back to threshold mode. To snooze an alert, set snoozed_until to a relative date string (e.g. '2h', '1d'). To unsnooze, set snoozed_until to null.
calculation_interval string optional How often the alert is checked: hourly, daily, weekly, or monthly. * 'hourly' - hourly * 'daily' - daily * 'weekly' - weekly * 'monthly' - monthly condition object optional Alert condition type. Determines how the value is evaluated: absolute_value, relative_increase, or relative_decrease. config object optional Trends-specific alert configuration. Includes series_index (which series to monitor) and check_ongoing_interval (whether to check the current incomplete interval). detector_config object optional Detector config. enabled boolean optional Whether the alert is actively being evaluated. id string required A UUID string identifying this alert configuration. insight number optional Insight ID monitored by this alert. Note: Response returns full InsightBasicSerializer object. name string optional Human-readable name for the alert. schedule_restriction object optional Blocked local time windows (HH:MM in the project timezone). Interval is half-open [start, end): start inclusive, end exclusive. Use blocked_windows array of {start, end}. Null disables. skip_weekend boolean optional Skip alert evaluation on weekends (Saturday and Sunday, local to project timezone). snoozed_until string optional Snooze the alert until this time. Pass a relative date string (e.g. '2h', '1d') or null to unsnooze. subscribed_users array optional User IDs to subscribe to this alert. Note: Response returns full UserBasicSerializer object. threshold object optional Threshold configuration with bounds and type for evaluating the alert. posthogmcp_alerts_list List all insight alerts in the project. Returns alerts with their current state, threshold or detector configuration, timing information, and firing check history. Supports filtering by insight ID via query parameter. Alerts can use either threshold-based conditions (absolute_value, relative_increase, relative_decrease) or anomaly detection via detector_config (zscore, mad, iqr, isolation_forest, knn, etc.). 2 params
List all insight alerts in the project. Returns alerts with their current state, threshold or detector configuration, timing information, and firing check history. Supports filtering by insight ID via query parameter. Alerts can use either threshold-based conditions (absolute_value, relative_increase, relative_decrease) or anomaly detection via detector_config (zscore, mad, iqr, isolation_forest, knn, etc.).
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_annotation_create Create an annotation to mark an important change (for example, a deployment) on charts and trends. Provide a note in `content`, when it happened in `date_marker` (ISO 8601), and whether it is scoped to the current `project` or the whole `organization`. 3 params
Create an annotation to mark an important change (for example, a deployment) on charts and trends. Provide a note in `content`, when it happened in `date_marker` (ISO 8601), and whether it is scoped to the current `project` or the whole `organization`.
content string optional Annotation text shown on charts to describe the change, release, or incident. date_marker string optional When this annotation happened (ISO 8601 timestamp). Used to position it on charts. scope string optional Annotation visibility scope: 'project', 'organization', 'dashboard', or 'dashboard_item'. 'recording' is deprecated and rejected. * 'dashboard_item' - insight * 'dashboard' - dashboard * 'project' - project * 'organization' - organization * 'recording' - recording posthogmcp_annotation_delete Soft-delete an annotation by ID. This hides the annotation from normal lists while preserving historical records. 1 param
Soft-delete an annotation by ID. This hides the annotation from normal lists while preserving historical records.
id number required A unique integer value identifying this annotation. posthogmcp_annotation_retrieve Retrieve a single annotation by ID from the current project. Use this when you already know the annotation ID and want complete details. 1 param
Retrieve a single annotation by ID from the current project. Use this when you already know the annotation ID and want complete details.
id number required A unique integer value identifying this annotation. posthogmcp_annotations_list List annotations in the current project, newest first. Use this to review existing deployment markers and analysis notes before adding new annotations. 3 params
List annotations in the current project, newest first. Use this to review existing deployment markers and analysis notes before adding new annotations.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. search string optional A search term. posthogmcp_annotations_partial_update Update an existing annotation by ID. You can change its text (`content`), when it happened (`date_marker`, ISO 8601), or its visibility scope (`project` or `organization`). Only the fields you provide are updated. 4 params
Update an existing annotation by ID. You can change its text (`content`), when it happened (`date_marker`, ISO 8601), or its visibility scope (`project` or `organization`). Only the fields you provide are updated.
content string optional Annotation text shown on charts to describe the change, release, or incident. date_marker string optional When this annotation happened (ISO 8601 timestamp). Used to position it on charts. id number required A unique integer value identifying this annotation. scope string optional Annotation visibility scope: 'project', 'organization', 'dashboard', or 'dashboard_item'. 'recording' is deprecated and rejected. * 'dashboard_item' - insight * 'dashboard' - dashboard * 'project' - project * 'organization' - organization * 'recording' - recording posthogmcp_approval_policies_list List all approval policies configured for this project. Shows which actions require approval, who can approve, and bypass rules. 2 params
List all approval policies configured for this project. Shows which actions require approval, who can approve, and bypass rules.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_approval_policy_get Get details of an approval policy including conditions, approver configuration, quorum requirements, and bypass rules. 1 param
Get details of an approval policy including conditions, approver configuration, quorum requirements, and bypass rules.
id string required A UUID string identifying this approval policy. posthogmcp_cdp_function_templates_list List available function templates. Templates are pre-built function configurations for common integrations (Slack, webhooks, email, etc.) and transformations (GeoIP, etc.). Filter by type (destination, site_destination, site_app, transformation, etc.) via the 'type' query parameter. Results are sorted by popularity (number of active functions using each template). 5 params
List available function templates. Templates are pre-built function configurations for common integrations (Slack, webhooks, email, etc.) and transformations (GeoIP, etc.). Filter by type (destination, site_destination, site_app, transformation, etc.) via the 'type' query parameter. Results are sorted by popularity (number of active functions using each template).
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. template_id string optional Filter to a specific template by its template_id. Deprecated templates are excluded from list results; use the retrieve endpoint to look up a template by ID regardless of status. type string optional Filter by template type (e.g. destination, email, sms_provider, broadcast). Defaults to destination if neither type nor types is provided. types string optional Comma-separated list of template types to include (e.g. destination,email,sms_provider). posthogmcp_cdp_function_templates_retrieve Get a specific function template by its template ID (e.g. 'template-slack', 'template-geoip'). Returns the full template including source code, inputs schema, default filters, and mapping templates. Use this to understand what inputs a template requires before creating a function from it. 1 param
Get a specific function template by its template ID (e.g. 'template-slack', 'template-geoip'). Returns the full template including source code, inputs schema, default filters, and mapping templates. Use this to understand what inputs a template requires before creating a function from it.
template_id string required Template id. posthogmcp_cdp_functions_create Create a new function. Requires 'type' (destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, or transformation) and either 'hog' source code or a 'template_id' to derive code from a template. Provide 'inputs_schema' to define configurable parameters and 'inputs' with their values. Use 'filters' to control which events trigger the function. Transformations run during ingestion and have an 'execution_order' field. 13 params
Create a new function. Requires 'type' (destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, or transformation) and either 'hog' source code or a 'template_id' to derive code from a template. Provide 'inputs_schema' to define configurable parameters and 'inputs' with their values. Use 'filters' to control which events trigger the function. Transformations run during ingestion and have an 'execution_order' field.
description string optional Human-readable description of what this function does. enabled boolean optional Whether the function is active and processing events. execution_order number optional Execution priority for transformation functions (lower runs first). Only applies to type=transformation. If omitted, the function is appended at the end. filters object optional Event filters that control which events trigger this function. hog string optional Source code for the function. For most types this is Hog code; for site_destination and site_app types this is TypeScript. Required if no template_id is provided. icon_url string optional URL for the function's icon displayed in the UI. inputs object optional Values for each input defined in inputs_schema. inputs_schema array optional Schema defining the configurable input parameters for this function. mappings array optional Event-to-destination field mappings. Only for destination and site_destination types. masking object optional PII masking configuration with TTL, threshold, and hash expression. name string optional Display name for the function. template_id string optional ID of a HogFunctionTemplate to derive defaults from (code, inputs_schema, icon, name, description). Use the cdp-function-templates-list tool to find available templates. type string optional Function type. One of: destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, transformation. posthogmcp_cdp_functions_delete Delete a function by ID (soft delete). The function will no longer appear in lists or process events, but historical data is preserved. 1 param
Delete a function by ID (soft delete). The function will no longer appear in lists or process events, but historical data is preserved.
id string required A UUID string identifying this hog function. posthogmcp_cdp_functions_invocations_create Test-invoke a function with a mock event payload. Sends the function configuration and test data to the plugin server for execution and returns logs and status. Use 'mock_async_functions: true' (default) to simulate external calls like fetch() without making real HTTP requests. 6 params
Test-invoke a function with a mock event payload. Sends the function configuration and test data to the plugin server for execution and returns logs and status. Use 'mock_async_functions: true' (default) to simulate external calls like fetch() without making real HTTP requests.
clickhouse_event object optional Mock ClickHouse event data to test the function with. configuration object required Full function configuration to test. globals object optional Mock global variables available during test invocation. id string required A UUID string identifying this hog function. invocation_id string optional Optional invocation ID for correlation. mock_async_functions boolean optional When true (default), async functions like fetch() are simulated. posthogmcp_cdp_functions_list List all functions (destinations, transformations, site apps, and source webhooks) in the project. Returns each function's name, type, enabled status, execution order, and template info. Filter by type (destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, transformation) and enabled status via query parameters. 9 params
List all functions (destinations, transformations, site apps, and source webhooks) in the project. Returns each function's name, type, enabled status, execution order, and template info. Filter by type (destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, transformation) and enabled status via query parameters.
created_at string optional Created at. created_by number optional Created by. enabled boolean optional Enabled. id string optional Id. limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. search string optional A search term. type array optional Multiple values may be separated by commas. updated_at string optional Updated at. posthogmcp_cdp_functions_partial_update Partially update a function. Can enable/disable the function, change its name, description, source code, inputs, filters, mappings, or masking config. The 'type' field cannot be changed after creation. To delete a function, use the cdp-functions-delete tool instead. 14 params
Partially update a function. Can enable/disable the function, change its name, description, source code, inputs, filters, mappings, or masking config. The 'type' field cannot be changed after creation. To delete a function, use the cdp-functions-delete tool instead.
description string optional Human-readable description of what this function does. enabled boolean optional Set to true to activate or false to deactivate the function. execution_order number optional Execution priority for transformations. Lower values run first. filters object optional Event filters that control which events trigger this function. hog string optional Source code. Hog language for most types; TypeScript for site_destination and site_app. icon_url string optional URL for the function's icon displayed in the UI. id string required A UUID string identifying this hog function. inputs object optional Values for each input defined in inputs_schema. inputs_schema array optional Schema defining the configurable input parameters for this function. mappings array optional Event-to-destination field mappings. Only for destination and site_destination types. masking object optional PII masking configuration with TTL, threshold, and hash expression. name string optional Display name for the function. template_id string optional ID of the template to create this function from. type string optional Function type: destination, site_destination, internal_destination, source_webhook, warehouse_source_webhook, site_app, or transformation. * 'destination' - Destination * 'site_destination' - Site Destination * 'internal_destination' - Internal Destination * 'source_webhook' - Source Webhook * 'warehouse_source_webhook' - Warehouse Source Webhook * 'site_app' - Site App * 'transformation' - Transformation posthogmcp_cdp_functions_rearrange_partial_update Update the execution order of transformation functions. Send an 'orders' object mapping function UUIDs to their new execution_order integer values. Only applies to functions with type=transformation. Returns the updated list of transformations. 1 param
Update the execution order of transformation functions. Send an 'orders' object mapping function UUIDs to their new execution_order integer values. Only applies to functions with type=transformation. Returns the updated list of transformations.
orders object optional Map of hog function UUIDs to their new execution_order values. posthogmcp_cdp_functions_retrieve Get a specific function by ID. Returns the full configuration including source code, inputs schema, input values (secrets are masked), filters, mappings, masking config, and runtime status. 1 param
Get a specific function by ID. Returns the full configuration including source code, inputs schema, input values (secrets are masked), filters, mappings, masking config, and runtime status.
id string required A UUID string identifying this hog function. posthogmcp_change_request_get Get a specific change request by ID, including the full intent, policy snapshot, approval votes, and current state. 1 param
Get a specific change request by ID, including the full intent, policy snapshot, approval votes, and current state.
id string required A UUID string identifying this change request. posthogmcp_change_requests_list List approval requests (change requests) for the current project. Returns pending, approved, rejected, and expired requests with vote status and staleness info. Useful for understanding what governance actions are waiting for review. 7 params
List approval requests (change requests) for the current project. Returns pending, approved, rejected, and expired requests with vote status and staleness info. Useful for understanding what governance actions are waiting for review.
action_key string optional Action key. limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. requester number optional Requester. resource_id string optional Resource id. resource_type string optional Resource type. state array optional Multiple values may be separated by commas. posthogmcp_cohorts_add_persons_to_static_cohort_partial_update Add persons to a static cohort by their UUIDs. Only works for static cohorts (is_static: true). 2 params
Add persons to a static cohort by their UUIDs. Only works for static cohorts (is_static: true).
id number required A unique integer value identifying this cohort. person_ids array optional List of person UUIDs to add to the cohort posthogmcp_cohorts_create Create a new cohort. For dynamic cohorts, provide 'filters' with AND/OR groups of property conditions (person properties, behavioral filters, or cohort references). For static cohorts, set 'is_static: true' then use the 'cohorts-add-persons-to-static-cohort-partial-update' tool to add person UUIDs. 6 params
Create a new cohort. For dynamic cohorts, provide 'filters' with AND/OR groups of property conditions (person properties, behavioral filters, or cohort references). For static cohorts, set 'is_static: true' then use the 'cohorts-add-persons-to-static-cohort-partial-update' tool to add person UUIDs.
cohort_type string optional Type of cohort based on filter complexity * 'static' - static * 'person_property' - person_property * 'behavioral' - behavioral * 'realtime' - realtime * 'analytical' - analytical description string optional Description. filters object optional Filters. is_static boolean optional Is static. name string optional Name. query object optional Query. posthogmcp_cohorts_list List all cohorts in the project. Returns a summary of each cohort including id, name, description, count (person count), is_static (cohort type), and created_at timestamp. Use 'cohorts-retrieve' with the cohort ID to get full details including filters, calculation status,
and query definition. 2 params
List all cohorts in the project. Returns a summary of each cohort including id, name, description, count (person count), is_static (cohort type), and created_at timestamp. Use 'cohorts-retrieve' with the cohort ID to get full details including filters, calculation status, and query definition.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_cohorts_partial_update Update an existing cohort's name, description, or filters. Changing filters on a dynamic cohort triggers recalculation. To soft-delete a cohort, set 'deleted: true'. 8 params
Update an existing cohort's name, description, or filters. Changing filters on a dynamic cohort triggers recalculation. To soft-delete a cohort, set 'deleted: true'.
cohort_type string optional Type of cohort based on filter complexity * 'static' - static * 'person_property' - person_property * 'behavioral' - behavioral * 'realtime' - realtime * 'analytical' - analytical deleted boolean optional Deleted. description string optional Description. filters object optional Filters. id number required A unique integer value identifying this cohort. is_static boolean optional Is static. name string optional Name. query object optional Query. posthogmcp_cohorts_retrieve Get a specific cohort by ID. Returns the cohort name, description, filters (for dynamic cohorts), count of matching users, and calculation status. 1 param
Get a specific cohort by ID. Returns the cohort name, description, filters (for dynamic cohorts), count of matching users, and calculation status.
id number required A unique integer value identifying this cohort. posthogmcp_cohorts_rm_person_from_static_cohort_partial_update Remove a person from a static cohort by their UUID. Only works for static cohorts (is_static: true). The person must exist in the project. Idempotent: removing a person who exists but is not a member of the cohort succeeds silently. 2 params
Remove a person from a static cohort by their UUID. Only works for static cohorts (is_static: true). The person must exist in the project. Idempotent: removing a person who exists but is not a member of the cohort succeeds silently.
id number required A unique integer value identifying this cohort. person_id string optional Person UUID to remove from the cohort posthogmcp_comment_count Get the count of comments, optionally filtered by scope and item_id. 0 params
Get the count of comments, optionally filtered by scope and item_id.
posthogmcp_comment_get Get a specific comment by ID including its content, rich content with mentions, and metadata. 1 param
Get a specific comment by ID including its content, rich content with mentions, and metadata.
id string required A UUID string identifying this comment. posthogmcp_comment_thread Get the full thread of replies for a parent comment. Useful for reading complete discussions on a resource. 1 param
Get the full thread of replies for a parent comment. Useful for reading complete discussions on a resource.
id string required A UUID string identifying this comment. posthogmcp_comments_list List comments across the project. Filter by scope (Dashboard, FeatureFlag, Insight, etc.) and item_id to find discussions on specific resources. Returns comment content, author, and threading info. 5 params
List comments across the project. Filter by scope (Dashboard, FeatureFlag, Insight, etc.) and item_id to find discussions on specific resources. Returns comment content, author, and threading info.
cursor string optional The pagination cursor value. item_id string optional Filter by the ID of the resource being commented on. scope string optional Filter by resource type (e.g. Dashboard, FeatureFlag, Insight, Replay). search string optional Full-text search within comment content. source_comment string optional Filter replies to a specific parent comment. posthogmcp_conversations_tickets_list List support tickets in the project. Supports filtering by status (new, open, pending, on_hold, resolved), priority (low, medium, high), channel_source (widget, email, slack), assignee, date range, and search. Results are paginated and ordered by updated_at descending by default. Returns ticket metadata including status, priority, message counts, and timestamps. 14 params
List support tickets in the project. Supports filtering by status (new, open, pending, on_hold, resolved), priority (low, medium, high), channel_source (widget, email, slack), assignee, date range, and search. Results are paginated and ordered by updated_at descending by default. Returns ticket metadata including status, priority, message counts, and timestamps.
assignee string optional Filter by assignee. Use 'unassigned' for tickets with no assignee, 'user:<user_id>' for a specific user, or 'role:<role_uuid>' for a role. channel_detail string optional Filter by the channel sub-type (e.g. 'widget_embedded', 'slack_bot_mention'). channel_source string optional Filter by the channel the ticket originated from. date_from string optional Only include tickets updated on or after this date. Accepts absolute dates ('2026-01-01') or relative ones ('-7d', '-1mStart'). Pass 'all' to disable the filter. date_to string optional Only include tickets updated on or before this date. Same format as 'date_from'. distinct_ids string optional Comma-separated list of person 'distinct_id's to filter by (max 100). limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. order_by string optional Sort order. Prefix with '-' for descending. Defaults to '-updated_at'. priority string optional Filter by priority. Accepts a single value or a comma-separated list (e.g. 'medium,high'). Valid values: 'low', 'medium', 'high'. search string optional Free-text search. A numeric value matches a ticket number exactly; otherwise matches against the customer's name or email (case-insensitive, partial match). sla string optional Filter by SLA state. 'breached' = past 'sla_due_at', 'at-risk' = due within the next hour, 'on-track' = more than an hour remaining. status string optional Filter by status. Accepts a single value or a comma-separated list (e.g. 'new,open,pending'). Valid values: 'new', 'open', 'pending', 'on_hold', 'resolved'. tags string optional JSON-encoded array of tag names to filter by, e.g. '["billing","urgent"]'. posthogmcp_conversations_tickets_retrieve Get a specific support ticket by ID or ticket number. Returns full ticket details including status, priority, assignee, message count, channel info, person data, and session context. 1 param
Get a specific support ticket by ID or ticket number. Returns full ticket details including status, priority, assignee, message count, channel info, person data, and session context.
id string required A UUID string identifying this ticket. posthogmcp_conversations_tickets_update Update a support ticket. Can change status (new, open, pending, on_hold, resolved), priority (low, medium, high), assignee, SLA deadline, escalation reason, and tags. Assignee should be an object with type ('user' or 'role') and id, or null to unassign. 6 params
Update a support ticket. Can change status (new, open, pending, on_hold, resolved), priority (low, medium, high), assignee, SLA deadline, escalation reason, and tags. Assignee should be an object with type ('user' or 'role') and id, or null to unassign.
id string required A UUID string identifying this ticket. priority string optional Ticket priority: low, medium, or high. Null if unset. * 'low' - Low * 'medium' - Medium * 'high' - High sla_due_at string optional SLA deadline set via workflows. Null means no SLA. snoozed_until string optional Snoozed until. status string optional Ticket status: new, open, pending, on_hold, or resolved * 'new' - New * 'open' - Open * 'pending' - Pending * 'on_hold' - On hold * 'resolved' - Resolved tags array optional Tags. posthogmcp_create_feature_flag Create a feature flag in the current project. 6 params
Create a feature flag in the current project.
active boolean optional Whether the feature flag is active. evaluation_contexts array optional Evaluation contexts that control where this flag evaluates at runtime. filters object optional Feature flag targeting configuration. key string optional Feature flag key. name string optional Feature flag description (stored in the 'name' field for backwards compatibility). tags array optional Organizational tags for this feature flag. posthogmcp_dashboard_create Create a new dashboard. Provide a name and optional description, tags, and pinned status. Can also create from a template or duplicate an existing dashboard. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight. 11 params
Create a new dashboard. Provide a name and optional description, tags, and pinned status. Can also create from a template or duplicate an existing dashboard. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.
breakdown_colors object optional Custom color mapping for breakdown values. data_color_theme_id number optional ID of the color theme used for chart visualizations. delete_insights boolean optional When deleting, also delete insights that are only on this dashboard. description string optional Description. name string optional Name. pinned boolean optional Pinned. quick_filter_ids array optional List of quick filter IDs associated with this dashboard restriction_level number optional * '21' - Everyone in the project can edit * '37' - Only those invited to this dashboard can edit tags array optional Tags. use_dashboard number optional ID of an existing dashboard to duplicate. use_template string optional Template key to create the dashboard from a predefined template. posthogmcp_dashboard_delete Delete a dashboard by ID. The dashboard will be soft-deleted and no longer appear in lists. 1 param
Delete a dashboard by ID. The dashboard will be soft-deleted and no longer appear in lists.
id number required A unique integer value identifying this dashboard. posthogmcp_dashboard_get Get a specific dashboard by ID. Returns the full dashboard including all tiles with their insights and layout information. Insight results, filters, and query metadata are omitted to save context — use dashboard-insights-run to fetch the actual data for every insight on the dashboard in one call, or insight-query for a single insight. 1 param
Get a specific dashboard by ID. Returns the full dashboard including all tiles with their insights and layout information. Insight results, filters, and query metadata are omitted to save context — use dashboard-insights-run to fetch the actual data for every insight on the dashboard in one call, or insight-query for a single insight.
id number required A unique integer value identifying this dashboard. posthogmcp_dashboard_insights_run Run all insights on a dashboard and return their results. Uses cached results by default (may be stale); set refresh to 'blocking' for fresh results. Set format to 'optimized' (default) for LLM-friendly text tables or 'json' for raw query results. Use this after dashboard-get to see the actual data behind each insight tile. 3 params
Run all insights on a dashboard and return their results. Uses cached results by default (may be stale); set refresh to 'blocking' for fresh results. Set format to 'optimized' (default) for LLM-friendly text tables or 'json' for raw query results. Use this after dashboard-get to see the actual data behind each insight tile.
id number required A unique integer value identifying this dashboard. output_format string optional 'optimized' (default) returns LLM-friendly formatted text per insight. 'json' returns the raw query result objects. refresh string optional Cache behavior. 'force_cache' (default) serves from cache even if stale. 'blocking' uses cache if fresh, otherwise recalculates. 'force_blocking' always recalculates. posthogmcp_dashboard_reorder_tiles Reorder tiles on a dashboard by providing an array of tile IDs in the desired display order. Computes a 2-column grid layout (6 columns wide, 5 rows tall per tile). First, use dashboard-get to see current tile IDs. 2 params
Reorder tiles on a dashboard by providing an array of tile IDs in the desired display order. Computes a 2-column grid layout (6 columns wide, 5 rows tall per tile). First, use dashboard-get to see current tile IDs.
id number required A unique integer value identifying this dashboard. tile_order array required Array of tile IDs in the desired display order (top to bottom, left to right). posthogmcp_dashboard_update Update an existing dashboard by ID. Can update name, description, pinned status, tags, filters, and restriction level. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight. 12 params
Update an existing dashboard by ID. Can update name, description, pinned status, tags, filters, and restriction level. The returned tiles omit insight results to save context — use dashboard-insights-run to fetch the actual data for each insight.
breakdown_colors object optional Custom color mapping for breakdown values. data_color_theme_id number optional ID of the color theme used for chart visualizations. delete_insights boolean optional When deleting, also delete insights that are only on this dashboard. description string optional Description. id number required A unique integer value identifying this dashboard. name string optional Name. pinned boolean optional Pinned. quick_filter_ids array optional List of quick filter IDs associated with this dashboard restriction_level number optional * '21' - Everyone in the project can edit * '37' - Only those invited to this dashboard can edit tags array optional Tags. use_dashboard number optional ID of an existing dashboard to duplicate. use_template string optional Template key to create the dashboard from a predefined template. posthogmcp_dashboards_get_all Get all dashboards in the project with optional filtering by pinned status or search term. Returns name, description, pinned status, tags, and creation metadata. Tiles and insights are not included — use dashboard-get to fetch a dashboard's tiles, then dashboard-insights-run to fetch the actual data for each insight. 2 params
Get all dashboards in the project with optional filtering by pinned status or search term. Returns name, description, pinned status, tags, and creation metadata. Tiles and insights are not included — use dashboard-get to fetch a dashboard's tiles, then dashboard-insights-run to fetch the actual data for each insight.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_debug_mcp_ui_apps Debug tool for testing MCP Apps SDK integration. Returns sample data displayed in an interactive UI app with component showcase. Use this to verify that MCP Apps are working correctly. 1 param
Debug tool for testing MCP Apps SDK integration. Returns sample data displayed in an interactive UI app with component showcase. Use this to verify that MCP Apps are working correctly.
message string optional Optional message to include in the debug data posthogmcp_delete_feature_flag Soft-delete a feature flag by ID in the current project. 1 param
Soft-delete a feature flag by ID in the current project.
id number required A unique integer value identifying this feature flag. posthogmcp_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. 1 param
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.
query string required Query. posthogmcp_early_access_feature_create Create a new early access feature. A feature flag is automatically created unless feature_flag_id is provided. Stage determines whether opted-in users get the feature enabled. 6 params
Create a new early access feature. A feature flag is automatically created unless feature_flag_id is provided. Stage determines whether opted-in users get the feature enabled.
description string optional A longer description of what this early access feature does, shown to users in the opt-in UI. documentation_url string optional URL to external documentation for this feature. Shown to users in the opt-in UI. feature_flag_id number optional Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not be group-based, and must not be multivariate. name string required The name of the early access feature. payload object optional Arbitrary JSON metadata associated with this feature. stage string required Lifecycle stage. Valid values: draft, concept, alpha, beta, general-availability, archived. Moving to an active stage (alpha/beta/general-availability) enables the feature flag for opted-in users. * 'draft' - draft * 'concept' - concept * 'alpha' - alpha * 'beta' - beta * 'general-availability' - general availability * 'archived' - archived posthogmcp_early_access_feature_destroy Delete an early access feature by ID. Clears enrollment conditions from the linked feature flag but does not delete the flag itself. 1 param
Delete an early access feature by ID. Clears enrollment conditions from the linked feature flag but does not delete the flag itself.
id string required A UUID string identifying this early access feature. posthogmcp_early_access_feature_list List early access features in the current project. Returns name, stage, description, linked feature flag, and creation date for each feature. 2 params
List early access features in the current project. Returns name, stage, description, linked feature flag, and creation date for each feature.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_early_access_feature_partial_update Update an early access feature by ID. Changing the stage automatically updates the linked feature flag's enrollment conditions. 5 params
Update an early access feature by ID. Changing the stage automatically updates the linked feature flag's enrollment conditions.
description string optional A longer description of what this early access feature does, shown to users in the opt-in UI. documentation_url string optional URL to external documentation for this feature. Shown to users in the opt-in UI. id string required A UUID string identifying this early access feature. name string optional The name of the early access feature. stage string optional Lifecycle stage. Valid values: draft, concept, alpha, beta, general-availability, archived. Moving to an active stage (alpha/beta/general-availability) enables the feature flag for opted-in users. * 'draft' - draft * 'concept' - concept * 'alpha' - alpha * 'beta' - beta * 'general-availability' - general availability * 'archived' - archived posthogmcp_early_access_feature_retrieve Get a single early access feature by ID. Returns full details including the linked feature flag configuration. 1 param
Get a single early access feature by ID. Returns full details including the linked feature flag configuration.
id string required A UUID string identifying this early access feature. posthogmcp_endpoint_create Create a new API endpoint from a HogQL or insight query. The name must be URL-safe (letters, numbers, hyphens, underscores, starts with a letter, max 128 chars). Materialization is auto-enabled if the query is eligible. 5 params
Create a new API endpoint from a HogQL or insight query. The name must be URL-safe (letters, numbers, hyphens, underscores, starts with a letter, max 128 chars). Materialization is auto-enabled if the query is eligible.
cache_age_seconds number optional Cache TTL in seconds (60–86400). description string optional Human-readable description of what this endpoint returns. is_materialized boolean optional Whether query results are materialized to S3. name string optional Unique URL-safe name. Must start with a letter, only letters/numbers/hyphens/underscores, max 128 chars. query object optional HogQL or insight query this endpoint executes. Changing this auto-creates a new version. posthogmcp_endpoint_delete Delete an endpoint by name. The endpoint is soft-deleted and its materialized views are cleaned up. 1 param
Delete an endpoint by name. The endpoint is soft-deleted and its materialized views are cleaned up.
name string required Name. posthogmcp_endpoint_get Get a specific endpoint by name. Returns the full endpoint configuration including query definition, version info, materialization status, and column types. Supports ?version=N to retrieve a specific version. 1 param
Get a specific endpoint by name. Returns the full endpoint configuration including query definition, version info, materialization status, and column types. Supports ?version=N to retrieve a specific version.
name string required Name. posthogmcp_endpoint_materialization_status Get lightweight materialization status for an endpoint without fetching full endpoint data. Returns whether materialization is possible, current status, last run time, and any errors. Supports ?version=N. 1 param
Get lightweight materialization status for an endpoint without fetching full endpoint data. Returns whether materialization is possible, current status, last run time, and any errors. Supports ?version=N.
name string required Name. posthogmcp_endpoint_openapi_spec Get the OpenAPI 3.0 specification for an endpoint. Returns a JSON spec that can be used with SDK generators like openapi-generator or @hey-api/openapi-ts to create typed API clients. Supports ?version=N to generate a spec for a specific version. 2 params
Get the OpenAPI 3.0 specification for an endpoint. Returns a JSON spec that can be used with SDK generators like openapi-generator or @hey-api/openapi-ts to create typed API clients. Supports ?version=N to generate a spec for a specific version.
name string required Name. version number optional Specific endpoint version to generate the spec for. Defaults to latest. posthogmcp_endpoint_run Execute an endpoint's query and return results. Uses materialized results when available, otherwise runs inline. For HogQL endpoints, variable keys must match code_name values. For insight endpoints with breakdowns, use the breakdown property name as the key. 5 params
Execute an endpoint's query and return results. Uses materialized results when available, otherwise runs inline. For HogQL endpoints, variable keys must match code_name values. For insight endpoints with breakdowns, use the breakdown property name as the key.
limit number optional Maximum number of results to return. If not provided, returns all results. name string required Name. offset number optional Number of results to skip. Must be used together with limit. Only supported for HogQL endpoints. refresh string optional Refresh. variables object optional Key-value pairs to parameterize the query. For HogQL endpoints, keys match variable code_name (e.g. {"event_name": "$pageview"}). For insight endpoints with breakdowns, use the breakdown property name as key. posthogmcp_endpoint_update Update an existing endpoint by name. Can update the query (auto-creates a new version), description, cache age, active status, and materialization. Pass version in body to target a specific version for non-query updates. 7 params
Update an existing endpoint by name. Can update the query (auto-creates a new version), description, cache age, active status, and materialization. Pass version in body to target a specific version for non-query updates.
cache_age_seconds number optional Cache TTL in seconds (60–86400). description string optional Human-readable description of what this endpoint returns. is_active boolean optional Whether this endpoint is available for execution via the API. is_materialized boolean optional Whether query results are materialized to S3. name string required Name. query object optional HogQL or insight query this endpoint executes. Changing this auto-creates a new version. version number optional Target a specific version for updates (defaults to current version). posthogmcp_endpoint_versions List all versions for an endpoint, in descending order (latest first). Each version contains the query snapshot, description, cache settings, and materialization status at that point in time. 5 params
List all versions for an endpoint, in descending order (latest first). Each version contains the query snapshot, description, cache settings, and materialization status at that point in time.
created_by number optional Created by. is_active boolean optional Is active. limit number optional Number of results to return per page. name string required Name. offset number optional The initial index from which to return the results. posthogmcp_endpoints_get_all Get all API endpoints in the current project. Endpoints expose saved HogQL or insight queries as callable API routes. Returns name, description, query, active status, current version, and materialization info for each endpoint. 4 params
Get all API endpoints in the current project. Endpoints expose saved HogQL or insight queries as callable API routes. Returns name, description, query, active status, current version, and materialization info for each endpoint.
created_by number optional Created by. is_active boolean optional Is active. limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_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. 2 params
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.
entities array optional Entity types to search. If not specified, searches all types. Available: insight, dashboard, experiment, feature_flag, notebook, action, cohort, event_definition, survey query string required Search query to find entities by name or description posthogmcp_error_tracking_assignment_rules_create Create an error tracking assignment rule for the current project. Provide `filters` to match incoming errors and an `assignee` with `type` (`user` or `role`) plus the matching user ID or role UUID. 2 params
Create an error tracking assignment rule for the current project. Provide `filters` to match incoming errors and an `assignee` with `type` (`user` or `role`) plus the matching user ID or role UUID.
assignee object required User or role to assign matching issues to. filters object required Property-group filters that define when this rule matches incoming error events. posthogmcp_error_tracking_assignment_rules_list List error tracking assignment rules for the current project. Returns rules in evaluation order with their filters, assignee, and disabled state. Supports pagination with `limit` and `offset`. 2 params
List error tracking assignment rules for the current project. Returns rules in evaluation order with their filters, assignee, and disabled state. Supports pagination with `limit` and `offset`.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_error_tracking_grouping_rules_create Create an error tracking grouping rule for the current project. Provide required `filters`, and optionally set `assignee` and `description` for the issues this rule creates. 3 params
Create an error tracking grouping rule for the current project. Provide required `filters`, and optionally set `assignee` and `description` for the issues this rule creates.
assignee object optional Optional user or role to assign to issues created by this grouping rule. description string optional Optional human-readable description of what this grouping rule is for. filters object required Property-group filters that define which exceptions should be grouped into the same issue. posthogmcp_error_tracking_grouping_rules_list List error tracking grouping rules for the current project. Returns rules in evaluation order with their filters, optional assignee, description, and linked issue when available. 0 params
List error tracking grouping rules for the current project. Returns rules in evaluation order with their filters, optional assignee, description, and linked issue when available.
posthogmcp_error_tracking_issues_list List all error tracking issues in the project. Returns issues with id, status, name, first seen timestamp, and assignee info. 2 params
List all error tracking issues in the project. Returns issues with id, status, name, first seen timestamp, and assignee info.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_error_tracking_issues_merge_create Merge one or more error tracking issues into an existing target issue. Provide the target issue as `id` and the issues to merge into it as `ids`. 2 params
Merge one or more error tracking issues into an existing target issue. Provide the target issue as `id` and the issues to merge into it as `ids`.
id string required A UUID string identifying this error tracking issue. ids array required IDs of the issues to merge into the current issue. posthogmcp_error_tracking_issues_partial_update Update an error tracking issue. Can change status (active, resolved, suppressed), assign to a user, or update description. 7 params
Update an error tracking issue. Can change status (active, resolved, suppressed), assign to a user, or update description.
assignee object optional Assignee. description string optional Description. external_issues array optional External issues. first_seen string optional First seen. id string required A UUID string identifying this error tracking issue. name string optional Name. status string optional * 'archived' - Archived * 'active' - Active * 'resolved' - Resolved * 'pending_release' - Pending release * 'suppressed' - Suppressed posthogmcp_error_tracking_issues_retrieve Get a specific error tracking issue by ID. Returns full issue details including status, description, volume, and metadata. 1 param
Get a specific error tracking issue by ID. Returns full issue details including status, description, volume, and metadata.
id string required A UUID string identifying this error tracking issue. posthogmcp_error_tracking_issues_split_create Split one or more fingerprints out of an existing error tracking issue into new issues. Provide the source issue as `id` and the fingerprints to split as `fingerprints`, where each entry includes a required `fingerprint` and optional `name` or `description`. 2 params
Split one or more fingerprints out of an existing error tracking issue into new issues. Provide the source issue as `id` and the fingerprints to split as `fingerprints`, where each entry includes a required `fingerprint` and optional `name` or `description`.
fingerprints array optional Fingerprints to split into new issues. Each fingerprint becomes its own new issue. id string required A UUID string identifying this error tracking issue. posthogmcp_error_tracking_suppression_rules_list List error tracking suppression rules for the current project. Returns rules in evaluation order with their filters, sampling rate, and disabled state. Supports pagination with `limit` and `offset`. 2 params
List error tracking suppression rules for the current project. Returns rules in evaluation order with their filters, sampling rate, and disabled state. Supports pagination with `limit` and `offset`.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_evaluation_create Create a new LLM analytics evaluation. Two types are supported: 'llm_judge' uses an LLM to score generations against a prompt you define (for subjective checks like tone, helpfulness, hallucination detection), and 'hog' runs deterministic code against each generation (for rule-based checks like format validation, keyword detection, length limits). For llm_judge evaluations, provide a prompt in evaluation_config and a model_configuration. For hog evaluations, provide source code in evaluation_config. 8 params
Create a new LLM analytics evaluation. Two types are supported: 'llm_judge' uses an LLM to score generations against a prompt you define (for subjective checks like tone, helpfulness, hallucination detection), and 'hog' runs deterministic code against each generation (for rule-based checks like format validation, keyword detection, length limits). For llm_judge evaluations, provide a prompt in evaluation_config and a model_configuration. For hog evaluations, provide source code in evaluation_config.
description string optional Description of what this evaluation checks. enabled boolean optional Whether the evaluation runs automatically on new generations. Defaults to false. evaluation_config object required Configuration for the evaluation. Provide "prompt" for llm_judge or "source" for hog type. evaluation_type string required Type of evaluation. "llm_judge" uses an LLM to score generations against a prompt. "hog" runs deterministic Hog code. model_configuration object optional LLM model configuration (required for llm_judge evaluations). name string required Name of the evaluation. output_config object optional Output config. output_type string optional Output type. Currently only "boolean" is supported. posthogmcp_evaluation_delete Delete an LLM analytics evaluation (soft delete). The evaluation will be marked as deleted and will no longer run. 1 param
Delete an LLM analytics evaluation (soft delete). The evaluation will be marked as deleted and will no longer run.
evaluationId string required The UUID of the evaluation to delete. posthogmcp_evaluation_get Get a specific LLM analytics evaluation by its UUID. Returns full details including name, type (llm_judge or hog), configuration, conditions, and enabled status. 1 param
Get a specific LLM analytics evaluation by its UUID. Returns full details including name, type (llm_judge or hog), configuration, conditions, and enabled status.
evaluationId string required The UUID of the evaluation to retrieve. posthogmcp_evaluation_run Trigger an evaluation run on a specific $ai_generation event. This executes the evaluation (either LLM judge or Hog code) against the target event asynchronously via a background workflow. The run is async — it returns a workflow_id and status 'started'. Results are written as '$ai_evaluation' events once complete. To check results after triggering a run, query events with: SELECT properties.$ai_evaluation_result as result, properties.$ai_evaluation_reasoning as reasoning FROM events WHERE event = '$ai_evaluation' AND properties.$ai_evaluation_id = '<evaluation_uuid>' AND properties.$ai_target_event_id = '<generation_event_uuid>' ORDER BY timestamp DESC LIMIT 1. 5 params
Trigger an evaluation run on a specific $ai_generation event. This executes the evaluation (either LLM judge or Hog code) against the target event asynchronously via a background workflow. The run is async — it returns a workflow_id and status 'started'. Results are written as '$ai_evaluation' events once complete. To check results after triggering a run, query events with: SELECT properties.$ai_evaluation_result as result, properties.$ai_evaluation_reasoning as reasoning FROM events WHERE event = '$ai_evaluation' AND properties.$ai_evaluation_id = '<evaluation_uuid>' AND properties.$ai_target_event_id = '<generation_event_uuid>' ORDER BY timestamp DESC LIMIT 1.
distinct_id string optional Distinct ID of the event (optional, improves lookup performance). evaluationId string required The UUID of the evaluation to run. event string optional Event name. Defaults to "$ai_generation". target_event_id string required The UUID of the $ai_generation event to evaluate. timestamp string required ISO 8601 timestamp of the target event (needed for efficient lookup). posthogmcp_evaluation_test_hog Test Hog evaluation code against recent $ai_generation events without persisting results. Compiles the provided Hog source code and runs it against a sample of recent events (up to 10 from the last 7 days). Returns per-event results with input/output previews, pass/fail verdicts, and any errors. Use this to validate Hog evaluation logic before enabling it. 4 params
Test Hog evaluation code against recent $ai_generation events without persisting results. Compiles the provided Hog source code and runs it against a sample of recent events (up to 10 from the last 7 days). Returns per-event results with input/output previews, pass/fail verdicts, and any errors. Use this to validate Hog evaluation logic before enabling it.
allows_na boolean optional Whether the evaluation can return N/A for non-applicable generations. conditions array optional Optional trigger conditions to filter which events are sampled. sample_count integer optional Number of recent $ai_generation events to test against (1-10, default 5). source string required Hog source code to test. Must return a boolean (true = pass, false = fail). posthogmcp_evaluation_update Update an existing LLM analytics evaluation. You can change the name, description, enabled status, evaluation config (prompt or source code), and output config. Use this to enable/disable evaluations or modify their scoring logic. 6 params
Update an existing LLM analytics evaluation. You can change the name, description, enabled status, evaluation config (prompt or source code), and output config. Use this to enable/disable evaluations or modify their scoring logic.
description string optional Updated description. enabled boolean optional Enable or disable the evaluation. evaluationId string required The UUID of the evaluation to update. evaluation_config object optional Updated evaluation configuration. name string optional Updated name. output_config object optional Updated output configuration. posthogmcp_evaluations_get List LLM analytics evaluations for the project. Evaluations automatically score AI generations for quality, relevance, safety, and other criteria. Supports optional search by name/description and filtering by enabled status. Evaluation results are stored as '$ai_evaluation' events — to query results, use the execute-sql or query-run tool with a HogQL query filtering on event = '$ai_evaluation'. Key properties: $ai_evaluation_id (evaluation UUID), $ai_evaluation_name, $ai_target_event_id (generation event UUID), $ai_trace_id, $ai_evaluation_result (boolean pass/fail), $ai_evaluation_reasoning (text), $ai_evaluation_applicable (boolean, false = N/A). 2 params
List LLM analytics evaluations for the project. Evaluations automatically score AI generations for quality, relevance, safety, and other criteria. Supports optional search by name/description and filtering by enabled status. Evaluation results are stored as '$ai_evaluation' events — to query results, use the execute-sql or query-run tool with a HogQL query filtering on event = '$ai_evaluation'. Key properties: $ai_evaluation_id (evaluation UUID), $ai_evaluation_name, $ai_target_event_id (generation event UUID), $ai_trace_id, $ai_evaluation_result (boolean pass/fail), $ai_evaluation_reasoning (text), $ai_evaluation_applicable (boolean, false = N/A).
enabled boolean optional Filter by enabled status. search string optional Search evaluations by name or description. posthogmcp_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'. 2 params
Update event definition metadata. Can update description, tags, mark status as verified or hidden. Use exact event name like '$pageview' or 'user_signed_up'.
data object required The event definition data to update eventName string required The name of the event to update (e.g. "$pageview", "user_signed_up") posthogmcp_event_definitions_list List all event definitions in the project with optional filtering. Can filter by search term. 3 params
List all event definitions in the project with optional filtering. Can filter by search term.
limit integer optional Limit. offset integer optional Offset. q string optional Search query to filter event names. Only use if there are lots of events. posthogmcp_experiment_archive Archive an ended experiment to hide it from the default list view. Returns 400 if the experiment is already archived or has not ended. 1 param
Archive an ended experiment to hide it from the default list view. Returns 400 if the experiment is already archived or has not ended.
id number required A unique integer value identifying this experiment. posthogmcp_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, provide the series array with EventsNode entries for each step 6) Configure variants (default 50/50 control/test unless they specify otherwise) 7) Set targeting criteria if needed. 10 params
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, provide the series array with EventsNode entries for each step 6) Configure variants (default 50/50 control/test unless they specify otherwise) 7) Set targeting criteria if needed.
allow_unknown_events boolean optional Allow unknown events. description string optional Description of the experiment hypothesis and expected outcomes. exposure_criteria object optional Exposure configuration including filter test accounts and custom exposure events. feature_flag_key string required Unique key for the experiment's feature flag. Letters, numbers, hyphens, and underscores only. Search existing flags with the feature-flags-get-all tool first — reuse an existing flag when possible. holdout_id number optional ID of a holdout group to exclude from the experiment. metrics array optional Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project. metrics_secondary array optional Secondary metrics for additional measurements. Same format as primary metrics. name string required Name of the experiment. parameters object optional Variant definitions and statistical configuration. Set feature_flag_variants to customize the split (default: 50/50 control/test). Each variant needs a key and rollout_percentage; percentages must sum to 100. Set minimum_detectable_effect (percentage, suggest 20-30) to control statistical power. type string optional Experiment type: web for frontend UI changes, product for backend/API changes. * 'web' - web * 'product' - product posthogmcp_experiment_delete Delete an experiment by ID. 1 param
Delete an experiment by ID.
id number required A unique integer value identifying this experiment. posthogmcp_experiment_end End a running experiment. Sets end_date to now but does NOT modify the feature flag. Optionally provide a conclusion and comment. Returns 400 if the experiment is not running. 3 params
End a running experiment. Sets end_date to now but does NOT modify the feature flag. Optionally provide a conclusion and comment. Returns 400 if the experiment is not running.
conclusion string optional The conclusion of the experiment. * 'won' - won * 'lost' - lost * 'inconclusive' - inconclusive * 'stopped_early' - stopped_early * 'invalid' - invalid conclusion_comment string optional Optional comment about the experiment conclusion. id number required A unique integer value identifying this experiment. posthogmcp_experiment_get Get details of a specific experiment by ID. 1 param
Get details of a specific experiment by ID.
id number required A unique integer value identifying this experiment. posthogmcp_experiment_get_all Get all experiments in the project. 2 params
Get all experiments in the project.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_experiment_launch Launch a draft experiment. Activates the linked feature flag, sets start_date to now, and transitions the experiment to running. Returns 400 if the experiment has already been launched. 1 param
Launch a draft experiment. Activates the linked feature flag, sets start_date to now, and transitions the experiment to running. Returns 400 if the experiment has already been launched.
id number required A unique integer value identifying this experiment. posthogmcp_experiment_pause Pause a running experiment by deactivating its feature flag. Users fall back to the default experience and no new exposures are recorded. Returns 400 if the experiment is not running or is already paused. 1 param
Pause a running experiment by deactivating its feature flag. Users fall back to the default experience and no new exposures are recorded. Returns 400 if the experiment is not running or is already paused.
id number required A unique integer value identifying this experiment. posthogmcp_experiment_reset Reset an experiment back to draft state. Clears start/end dates, conclusion, and archived flag. The feature flag is left unchanged. Returns 400 if the experiment is already in draft state. 1 param
Reset an experiment back to draft state. Clears start/end dates, conclusion, and archived flag. The feature flag is left unchanged. Returns 400 if the experiment is already in draft state.
id number required A unique integer value identifying this experiment. posthogmcp_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). 2 params
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).
experimentId number required The ID of the experiment to get comprehensive results for refresh boolean required Force refresh of results instead of using cached values posthogmcp_experiment_resume Resume a paused experiment by reactivating its feature flag. Returns 400 if the experiment is not paused. 1 param
Resume a paused experiment by reactivating its feature flag. Returns 400 if the experiment is not paused.
id number required A unique integer value identifying this experiment. posthogmcp_experiment_ship_variant Ship a variant to 100% of users and optionally end the experiment. Requires variant_key. Can include conclusion and conclusion_comment. Returns 400 if the experiment is in draft state. 4 params
Ship a variant to 100% of users and optionally end the experiment. Requires variant_key. Can include conclusion and conclusion_comment. Returns 400 if the experiment is in draft state.
conclusion string optional The conclusion of the experiment. * 'won' - won * 'lost' - lost * 'inconclusive' - inconclusive * 'stopped_early' - stopped_early * 'invalid' - invalid conclusion_comment string optional Optional comment about the experiment conclusion. id number required A unique integer value identifying this experiment. variant_key string required The key of the variant to ship to 100% of users. posthogmcp_experiment_update Update an existing experiment by ID. Can update name, description, variants, metrics, and other properties. Use lifecycle tools for state transitions: experiment-launch to start, experiment-end to stop, experiment-reset to return to draft, experiment-pause/experiment-resume to temporarily halt. NOTE: feature_flag_key cannot be changed after creation. 10 params
Update an existing experiment by ID. Can update name, description, variants, metrics, and other properties. Use lifecycle tools for state transitions: experiment-launch to start, experiment-end to stop, experiment-reset to return to draft, experiment-pause/experiment-resume to temporarily halt. NOTE: feature_flag_key cannot be changed after creation.
archived boolean optional Whether the experiment is archived. conclusion string optional Experiment conclusion: won, lost, inconclusive, stopped_early, or invalid. * 'won' - won * 'lost' - lost * 'inconclusive' - inconclusive * 'stopped_early' - stopped_early * 'invalid' - invalid conclusion_comment string optional Comment about the experiment conclusion. description string optional Description of the experiment hypothesis and expected outcomes. exposure_criteria object optional Exposure configuration including filter test accounts and custom exposure events. id number required A unique integer value identifying this experiment. metrics array optional Primary experiment metrics. Each metric must have kind='ExperimentMetric' and a metric_type: 'mean' (set source to an EventsNode with an event name), 'funnel' (set series to an array of EventsNode steps), 'ratio' (set numerator and denominator EventsNode entries), or 'retention' (set start_event and completion_event). Use the event-definitions-list tool to find available events in the project. metrics_secondary array optional Secondary metrics for additional measurements. Same format as primary metrics. name string optional Name of the experiment. parameters object optional Variant definitions and statistical configuration. Set feature_flag_variants to customize the split (default: 50/50 control/test). Each variant needs a key and rollout_percentage; percentages must sum to 100. Set minimum_detectable_effect (percentage, suggest 20-30) to control statistical power. posthogmcp_feature_flag_get_all Get feature flags in the current project. Supports list filters including search by feature flag key or name (case-insensitive), then use the returned ID for get/update/delete tools. 10 params
Get feature flags in the current project. Supports list filters including search by feature flag key or name (case-insensitive), then use the returned ID for get/update/delete tools.
active string optional Active. created_by_id string optional The User ID which initially created the feature flag. evaluation_runtime string optional Filter feature flags by their evaluation runtime. excluded_properties string optional JSON-encoded list of feature flag keys to exclude from the results. has_evaluation_contexts string optional Filter feature flags by presence of evaluation contexts. 'true' returns only flags with at least one evaluation context, 'false' returns only flags without. limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. search string optional Search by feature flag key or name (case-insensitive). Use this to find the flag ID for get/update/delete tools. tags string optional JSON-encoded list of tag names to filter feature flags by. type string optional Type. posthogmcp_feature_flag_get_definition Get a feature flag by ID. 1 param
Get a feature flag by ID.
id number required A unique integer value identifying this feature flag. posthogmcp_feature_flags_activity_retrieve Get the audit trail for a specific feature flag by ID. Returns a paginated list of changes including who made changes, what was changed, and when. Use limit and page query params for pagination. 3 params
Get the audit trail for a specific feature flag by ID. Returns a paginated list of changes including who made changes, what was changed, and when. Use limit and page query params for pagination.
id number required A unique integer value identifying this feature flag. limit number optional Number of items per page page number optional Page number posthogmcp_feature_flags_copy_flags_create Copy a feature flag from one project to other projects within the same organization. Provide the flag key, source project ID, and a list of target project IDs. Optionally copy scheduled changes with copy_schedule. Returns lists of successful and failed copies. 4 params
Copy a feature flag from one project to other projects within the same organization. Provide the flag key, source project ID, and a list of target project IDs. Optionally copy scheduled changes with copy_schedule. Returns lists of successful and failed copies.
copy_schedule boolean optional Whether to also copy scheduled changes for this flag feature_flag_key string required Key of the feature flag to copy from_project number required Source project ID to copy the flag from target_project_ids array required List of target project IDs to copy the flag to posthogmcp_feature_flags_dependent_flags_retrieve Get other active feature flags that depend on this flag. Use this to understand flag dependency chains before making changes to a flag's rollout conditions or disabling it. 1 param
Get other active feature flags that depend on this flag. Use this to understand flag dependency chains before making changes to a flag's rollout conditions or disabling it.
id number required A unique integer value identifying this feature flag. posthogmcp_feature_flags_evaluation_reasons_retrieve Debug why feature flags evaluate a certain way for a given user. Provide a distinct_id and optionally groups to see each flag's evaluated value and the reason for that evaluation (e.g. condition_match, no_condition_match, disabled). 2 params
Debug why feature flags evaluate a certain way for a given user. Provide a distinct_id and optionally groups to see each flag's evaluated value and the reason for that evaluation (e.g. condition_match, no_condition_match, disabled).
distinct_id string required User distinct ID groups string optional Groups for feature flag evaluation (JSON object string) posthogmcp_feature_flags_status_retrieve Check the health and evaluation status of a feature flag by ID. Returns a status (active, stale, deleted, or unknown) and a human-readable reason explaining the status. 1 param
Check the health and evaluation status of a feature flag by ID. Returns a status (active, stale, deleted, or unknown) and a human-readable reason explaining the status.
id number required A unique integer value identifying this feature flag. posthogmcp_feature_flags_user_blast_radius_create Assess the impact of a feature flag release condition before applying it. Provide a condition object and optionally a group_type_index to see how many users would be affected relative to the total user count. 2 params
Assess the impact of a feature flag release condition before applying it. Provide a condition object and optionally a group_type_index to see how many users would be affected relative to the total user count.
condition object required The release condition to evaluate group_type_index number optional Group type index for group-based flags (null for person-based flags) posthogmcp_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. 2 params
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.
days number optional Days. projectId integer required Projectid. posthogmcp_insight_create Create a new saved insight from a name and query definition. Test queries with query-trends / query-funnel / query-retention / query-paths / query-stickiness / query-lifecycle first to confirm the shape, then save. Returns insight metadata only — after creating, call the insight-query tool with the returned `short_id` if you want to see the computed results. 6 params
Create a new saved insight from a name and query definition. Test queries with query-trends / query-funnel / query-retention / query-paths / query-stickiness / query-lifecycle first to confirm the shape, then save. Returns insight metadata only — after creating, call the insight-query tool with the returned `short_id` if you want to see the computed results.
dashboards array optional Dashboard IDs this insight should belong to. This is a full replacement — always include all existing dashboard IDs when adding a new one. description string optional Description. favorited boolean optional Favorited. name string optional Name. query object required Query. tags array optional Tags. posthogmcp_insight_delete Soft-delete an insight by ID. The insight will be marked as deleted and no longer appear in lists. 1 param
Soft-delete an insight by ID. The insight will be marked as deleted and no longer appear in lists.
id number required Numeric primary key or 8-character 'short_id' (for example 'AaVQ8Ijw') identifying the insight. posthogmcp_insight_get Fetch a saved insight by its numeric `id` or 8-character `short_id`. Returns the insight metadata and query definition, but NOT the query results. To retrieve the actual data, call the insight-query tool with the same identifier. 1 param
Fetch a saved insight by its numeric `id` or 8-character `short_id`. Returns the insight metadata and query definition, but NOT the query results. To retrieve the actual data, call the insight-query tool with the same identifier.
id number required Numeric primary key or 8-character 'short_id' (for example 'AaVQ8Ijw') identifying the insight. posthogmcp_insight_query Execute a saved insight's query and return results. THIS IS THE ONLY WAY TO RETRIEVE INSIGHT RESULTS — the insights-list, insight-get, insight-create, and insight-update tools all return metadata and query definitions but never the actual data. Call insight-query whenever the user asks to see, analyze, summarize, or compare data from a saved insight, and immediately after creating or updating an insight if they want to verify the output. Supports two output formats: 'optimized' (default) returns a human-readable summary from server-side formatters ideal for analysis, while 'json' returns the raw query results. 2 params
Execute a saved insight's query and return results. THIS IS THE ONLY WAY TO RETRIEVE INSIGHT RESULTS — the insights-list, insight-get, insight-create, and insight-update tools all return metadata and query definitions but never the actual data. Call insight-query whenever the user asks to see, analyze, summarize, or compare data from a saved insight, and immediately after creating or updating an insight if they want to verify the output. Supports two output formats: 'optimized' (default) returns a human-readable summary from server-side formatters ideal for analysis, while 'json' returns the raw query results.
insightId string required The insight ID or short_id to run. output_format string optional Output format. "optimized" returns a human-readable summary from server-side formatters (recommended for analysis). "json" returns the raw query results as JSON. posthogmcp_insight_update Update a saved insight by numeric `id` or `short_id`. Can update name, description, query, tags, favorited status, and dashboards. Returns insight metadata only — after updating the query, call the insight-query tool with the same identifier if you want to see the recomputed results. 7 params
Update a saved insight by numeric `id` or `short_id`. Can update name, description, query, tags, favorited status, and dashboards. Returns insight metadata only — after updating the query, call the insight-query tool with the same identifier if you want to see the recomputed results.
dashboards array optional Dashboard IDs this insight should belong to. This is a full replacement — always include all existing dashboard IDs when adding a new one. description string optional Description. favorited boolean optional Favorited. id number required Numeric primary key or 8-character 'short_id' (for example 'AaVQ8Ijw') identifying the insight. name string optional Name. query object optional Query. tags array optional Tags. posthogmcp_insights_list List saved insights in the project with optional filtering by favorited status or search term. Returns metadata only (name, description, tags, dashboards, ownership) — NOT the query results. To retrieve the actual data for any insight in the list, call the insight-query tool with its `short_id` or numeric `id`. 3 params
List saved insights in the project with optional filtering by favorited status or search term. Returns metadata only (name, description, tags, dashboards, ownership) — NOT the query results. To retrieve the actual data for any insight in the list, call the insight-query tool with its `short_id` or numeric `id`.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. short_id string optional Short id. posthogmcp_integration_delete Permanently delete an integration by ID. This removes the connection to the third-party service. Any features relying on this integration (alerts, workflow destinations, etc.) will stop working. 1 param
Permanently delete an integration by ID. This removes the connection to the third-party service. Any features relying on this integration (alerts, workflow destinations, etc.) will stop working.
id number required A unique integer value identifying this integration. posthogmcp_integration_get Get a specific integration by ID. Returns the full integration details including kind, display name, non-sensitive configuration, error status, and creation metadata. Does not expose sensitive credentials. 1 param
Get a specific integration by ID. Returns the full integration details including kind, display name, non-sensitive configuration, error status, and creation metadata. Does not expose sensitive credentials.
id number required A unique integer value identifying this integration. posthogmcp_integrations_list List all third-party integrations configured in the current project. Returns each integration's type (kind), display name, non-sensitive configuration, error status, and creation metadata. Common kinds include slack, github, hubspot, salesforce, and various ad platforms. When authenticated via personal API key, only GitHub integrations are returned. 2 params
List all third-party integrations configured in the current project. Returns each integration's type (kind), display name, non-sensitive configuration, error status, and creation metadata. Common kinds include slack, github, hubspot, salesforce, and various ad platforms. When authenticated via personal API key, only GitHub integrations are returned.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_llm_analytics_clustering_jobs_list List all clustering job configurations for the current team (max 5 per team). Each job defines an analysis level (trace or generation) and event filters that scope which traces are included in clustering runs. Cluster results are stored as $ai_trace_clusters and $ai_generation_clusters events — use docs-search or execute-sql to query them. 2 params
List all clustering job configurations for the current team (max 5 per team). Each job defines an analysis level (trace or generation) and event filters that scope which traces are included in clustering runs. Cluster results are stored as $ai_trace_clusters and $ai_generation_clusters events — use docs-search or execute-sql to query them.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_llm_analytics_clustering_jobs_retrieve Retrieve a specific clustering job configuration by ID. Returns the job name, analysis level (trace or generation), event filters, enabled status, and timestamps. 1 param
Retrieve a specific clustering job configuration by ID. Returns the job name, analysis level (trace or generation), event filters, enabled status, and timestamps.
id string required A UUID string identifying this clustering job. posthogmcp_llm_analytics_evaluation_summary_create Generate an AI-powered summary of LLM evaluation results for a given evaluation config. Pass an evaluation_id and an optional filter ("all", "pass", "fail", or "na") to scope which runs are analyzed. Returns an overall assessment, pattern groups for passing, failing, and N/A runs (each with title, description, frequency, and example generation IDs), actionable recommendations, and run statistics. Optionally pass generation_ids to restrict the analysis to specific runs. Results are cached for one hour — use force_refresh to recompute. Rate-limited; requires AI data processing approval for the organization. 4 params
Generate an AI-powered summary of LLM evaluation results for a given evaluation config. Pass an evaluation_id and an optional filter ("all", "pass", "fail", or "na") to scope which runs are analyzed. Returns an overall assessment, pattern groups for passing, failing, and N/A runs (each with title, description, frequency, and example generation IDs), actionable recommendations, and run statistics. Optionally pass generation_ids to restrict the analysis to specific runs. Results are cached for one hour — use force_refresh to recompute. Rate-limited; requires AI data processing approval for the organization.
evaluation_id string required UUID of the evaluation config to summarize filter string optional Filter type to apply ('all', 'pass', 'fail', or 'na') * 'all' - all * 'pass' - pass * 'fail' - fail * 'na' - na force_refresh boolean optional If true, bypass cache and generate a fresh summary generation_ids array optional Optional: specific generation IDs to include in summary (max 250) posthogmcp_llm_analytics_sentiment_create Classify sentiment of LLM trace or generation user messages as positive, neutral, or negative. Pass a list of trace or generation IDs and an analysis_level ("trace" or "generation"). Returns per-ID sentiment labels with confidence scores and per-message breakdowns. Results are cached — use force_refresh to recompute. Rate-limited. 5 params
Classify sentiment of LLM trace or generation user messages as positive, neutral, or negative. Pass a list of trace or generation IDs and an analysis_level ("trace" or "generation"). Returns per-ID sentiment labels with confidence scores and per-message breakdowns. Results are cached — use force_refresh to recompute. Rate-limited.
analysis_level string optional * 'trace' - trace * 'generation' - generation date_from string optional Date from. date_to string optional Date to. force_refresh boolean optional Force refresh. ids array required Ids. posthogmcp_llm_analytics_summarization_create Generate an AI-powered summary of an LLM trace or generation. Pass a trace_id or generation_id with a date_from — the backend fetches the data and returns a structured summary with title, flow diagram, summary bullets, and interesting notes. Results are cached. Use mode "minimal" (default) for 3-5 points or "detailed" for 5-10 points. Rate-limited. 9 params
Generate an AI-powered summary of an LLM trace or generation. Pass a trace_id or generation_id with a date_from — the backend fetches the data and returns a structured summary with title, flow diagram, summary bullets, and interesting notes. Results are cached. Use mode "minimal" (default) for 3-5 points or "detailed" for 5-10 points. Rate-limited.
data object optional Data to summarize. For traces: {trace, hierarchy}. For events: {event}. Not required when using trace_id or generation_id. date_from string optional Start of date range for ID-based lookup (e.g. '-7d' or '2026-01-01'). Defaults to -30d. date_to string optional End of date range for ID-based lookup. Defaults to now. force_refresh boolean optional Force regenerate summary, bypassing cache generation_id string optional Generation event UUID to summarize. The backend fetches the event data automatically. Requires date_from for efficient lookup. mode string optional Summary detail level: 'minimal' for 3-5 points, 'detailed' for 5-10 points * 'minimal' - minimal * 'detailed' - detailed model string optional LLM model to use (defaults based on provider) summarize_type string optional Type of entity to summarize. Inferred automatically when using trace_id or generation_id. * 'trace' - trace * 'event' - event trace_id string optional Trace ID to summarize. The backend fetches the trace data automatically. Requires date_from for efficient lookup. posthogmcp_logs_attribute_values_list List values for a specific log attribute key. Use to discover what values exist before building filters. Defaults to attribute_type "log" (log-level attributes). To get values for resource-level attributes (e.g. service.name, k8s.pod.name), you MUST explicitly pass attribute_type: "resource". Accepts optional serviceNames, dateRange, and filterGroup to narrow which logs are scanned. 6 params
List values for a specific log attribute key. Use to discover what values exist before building filters. Defaults to attribute_type "log" (log-level attributes). To get values for resource-level attributes (e.g. service.name, k8s.pod.name), you MUST explicitly pass attribute_type: "resource". Accepts optional serviceNames, dateRange, and filterGroup to narrow which logs are scanned.
attribute_type string optional Type of attribute: "log" or "resource". Defaults to "log". * 'log' - log * 'resource' - resource dateRange object optional Date range to search within. Defaults to last hour. filterGroup array optional Property filters to narrow which logs are scanned for values. key string required The attribute key to get values for serviceNames array optional Filter values to those appearing in logs from these services. value string optional Search filter for attribute values posthogmcp_logs_attributes_list List available log attribute names for filtering. Defaults to attribute_type "log" (log-level attributes). To search resource-level attributes (e.g. k8s.pod.name, k8s.namespace.name), you MUST explicitly pass attribute_type: "resource" — it will NOT return resource attributes unless you do. Accepts optional serviceNames, dateRange, and filterGroup to narrow which logs are scanned. 7 params
List available log attribute names for filtering. Defaults to attribute_type "log" (log-level attributes). To search resource-level attributes (e.g. k8s.pod.name, k8s.namespace.name), you MUST explicitly pass attribute_type: "resource" — it will NOT return resource attributes unless you do. Accepts optional serviceNames, dateRange, and filterGroup to narrow which logs are scanned.
attribute_type string optional Type of attributes: "log" for log attributes, "resource" for resource attributes. Defaults to "log". * 'log' - log * 'resource' - resource dateRange object optional Date range to search within. Defaults to last hour. filterGroup array optional Property filters to narrow which logs are scanned for attributes. limit number optional Max results (default: 100) offset number optional Pagination offset (default: 0) search string optional Search filter for attribute names serviceNames array optional Filter attributes to those appearing in logs from these services. posthogmcp_logs_sparkline_query Get a time-bucketed sparkline of log volume, broken down by severity or service. Use this to understand log volume patterns before querying individual log entries — it is much cheaper than a full log query.
All parameters must be nested inside a `query` object.
# Parameters
## query.dateRange
Date range for the sparkline. Defaults to the last hour (`-1h`).
- `date_from`: Start of the range. Accepts ISO 8601 timestamps or relative formats: `-1h`, `-6h`, `-1d`, `-7d`.
- `date_to`: End of the range. Same format. Omit or null for "now".
## query.serviceNames
Filter by service names.
## query.severityLevels
Filter by log severity: `trace`, `debug`, `info`, `warn`, `error`, `fatal`. Omit to include all levels.
## query.searchTerm
Full-text search across log bodies.
## query.filterGroup
Property filters to narrow results. Same format as `query-logs` filters.
## query.sparklineBreakdownBy
Break down the sparkline by `"severity"` (default) or `"service"`. Use `"service"` to see which services are producing the most logs.
# Examples
## Error volume over the last day
```json
{
"query": {
"serviceNames": ["api-gateway"],
"severityLevels": ["error", "fatal"],
"dateRange": { "date_from": "-1d" }
}
}
```
## Log volume by service
```json
{
"query": {
"serviceNames": ["api-gateway"],
"sparklineBreakdownBy": "service",
"dateRange": { "date_from": "-6h" }
}
}
```
## Log volume by severity
```json
{
"query": {
"serviceNames": ["api-gateway"],
"sparklineBreakdownBy": "severity",
"dateRange": { "date_from": "-1d" }
}
}
``` 1 param
Get a time-bucketed sparkline of log volume, broken down by severity or service. Use this to understand log volume patterns before querying individual log entries — it is much cheaper than a full log query. All parameters must be nested inside a `query` object. # Parameters ## query.dateRange Date range for the sparkline. Defaults to the last hour (`-1h`). - `date_from`: Start of the range. Accepts ISO 8601 timestamps or relative formats: `-1h`, `-6h`, `-1d`, `-7d`. - `date_to`: End of the range. Same format. Omit or null for "now". ## query.serviceNames Filter by service names. ## query.severityLevels Filter by log severity: `trace`, `debug`, `info`, `warn`, `error`, `fatal`. Omit to include all levels. ## query.searchTerm Full-text search across log bodies. ## query.filterGroup Property filters to narrow results. Same format as `query-logs` filters. ## query.sparklineBreakdownBy Break down the sparkline by `"severity"` (default) or `"service"`. Use `"service"` to see which services are producing the most logs. # Examples ## Error volume over the last day ```json { "query": { "serviceNames": ["api-gateway"], "severityLevels": ["error", "fatal"], "dateRange": { "date_from": "-1d" } } } ``` ## Log volume by service ```json { "query": { "serviceNames": ["api-gateway"], "sparklineBreakdownBy": "service", "dateRange": { "date_from": "-6h" } } } ``` ## Log volume by severity ```json { "query": { "serviceNames": ["api-gateway"], "sparklineBreakdownBy": "severity", "dateRange": { "date_from": "-1d" } } } ```
query object required The sparkline query to execute. posthogmcp_notebooks_create Create a new notebook. Provide a title and content. Content is a JSON object representing the notebook's rich text document structure (ProseMirror-based). Returns the created notebook with its short_id. 5 params
Create a new notebook. Provide a title and content. Content is a JSON object representing the notebook's rich text document structure (ProseMirror-based). Returns the created notebook with its short_id.
content object optional Notebook content as a ProseMirror JSON document structure. deleted boolean optional Whether the notebook has been soft-deleted. text_content string optional Plain text representation of the notebook content for search. title string optional Title of the notebook. version number optional Version number for optimistic concurrency control. Must match the current version when updating content. posthogmcp_notebooks_destroy Delete a notebook by short_id. The notebook will be soft-deleted and no longer appear in lists. 1 param
Delete a notebook by short_id. The notebook will be soft-deleted and no longer appear in lists.
short_id string required Short id. posthogmcp_notebooks_list List all notebooks in the project. Supports filtering by search term, created_by, last_modified_by, date_from, date_to, and contains. Returns title, short_id, and creation/modification metadata. 7 params
List all notebooks in the project. Supports filtering by search term, created_by, last_modified_by, date_from, date_to, and contains. Returns title, short_id, and creation/modification metadata.
contains string optional Filter for notebooks that match a provided filter. Each match pair is separated by a colon, multiple match pairs can be sent separated by a space or a comma created_by string optional The UUID of the Notebook's creator date_from string optional Filter for notebooks created after this date & time date_to string optional Filter for notebooks created before this date & time limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. user string optional If any value is provided for this parameter, return notebooks created by the logged in user. posthogmcp_notebooks_partial_update Update an existing notebook by short_id. Can update title, content, and deleted status. IMPORTANT: when updating the content field, you must provide the current version number for optimistic concurrency control. Retrieve the notebook first to get the latest version. 6 params
Update an existing notebook by short_id. Can update title, content, and deleted status. IMPORTANT: when updating the content field, you must provide the current version number for optimistic concurrency control. Retrieve the notebook first to get the latest version.
content object optional Notebook content as a ProseMirror JSON document structure. deleted boolean optional Whether the notebook has been soft-deleted. short_id string required Short id. text_content string optional Plain text representation of the notebook content for search. title string optional Title of the notebook. version number optional Version number for optimistic concurrency control. Must match the current version when updating content. posthogmcp_notebooks_retrieve Get a specific notebook by its short_id. Returns the full notebook including title, content, version, and creation/modification metadata. 1 param
Get a specific notebook by its short_id. Returns the full notebook including title, content, version, and creation/modification metadata.
short_id string required Short id. posthogmcp_org_members_list List all members of the current organization with their names, emails, membership levels (member, admin, owner), and last login times. 3 params
List all members of the current organization with their names, emails, membership levels (member, admin, owner), and last login times.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. order string optional Sort order. Defaults to '-joined_at'. posthogmcp_organization_get Get details of an organization by ID including name, membership level, member count, teams, and projects. If no ID is provided, returns the active organization. 1 param
Get details of an organization by ID including name, membership level, member count, teams, and projects. If no ID is provided, returns the active organization.
id string optional Organization ID. If omitted, uses the active organization. posthogmcp_organizations_list List all organizations the user has access to. Returns org ID, name, slug, and membership level. Use the ID with organization-get for details or switch-organization to change context. 2 params
List all organizations the user has access to. Returns org ID, name, slug, and membership level. Use the ID with organization-get for details or switch-organization to change context.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_persons_bulk_delete Delete up to 1000 persons by PostHog person UUIDs or distinct IDs. Optionally delete associated events and recordings. Pass either `ids` (person UUIDs) or `distinct_ids`. Returns 202 Accepted. This operation is irreversible. 5 params
Delete up to 1000 persons by PostHog person UUIDs or distinct IDs. Optionally delete associated events and recordings. Pass either `ids` (person UUIDs) or `distinct_ids`. Returns 202 Accepted. This operation is irreversible.
delete_events boolean optional If true, queue deletion of all events associated with these persons. delete_recordings boolean optional If true, queue deletion of all recordings associated with these persons. distinct_ids array optional A list of distinct IDs whose associated persons will be deleted (max 1000). ids array optional A list of PostHog person UUIDs to delete (max 1000). keep_person boolean optional If true, keep the person records but delete their events and recordings. posthogmcp_persons_cohorts_retrieve Get all cohorts that a specific person belongs to. Requires the person_id query parameter. 1 param
Get all cohorts that a specific person belongs to. Requires the person_id query parameter.
person_id string required The person ID or UUID to get cohorts for. posthogmcp_persons_list List persons in the current project. Supports search by email (full text) or distinct ID (exact match), and filtering by email or distinct_id query parameters. Returns paginated results with person properties and distinct IDs. 5 params
List persons in the current project. Supports search by email (full text) or distinct ID (exact match), and filtering by email or distinct_id query parameters. Returns paginated results with person properties and distinct IDs.
distinct_id string optional Filter list by distinct id. email string optional Filter persons by email (exact match) limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. search string optional Search persons, either by email (full text search) or distinct_id (exact match). posthogmcp_persons_property_delete Remove a single property from a person by key. The property is deleted asynchronously via the event pipeline ($unset). 2 params
Remove a single property from a person by key. The property is deleted asynchronously via the event pipeline ($unset).
id string required A unique value identifying this person. Accepts both numeric ID and UUID. unset string required The property key to remove from this person. posthogmcp_persons_property_set Set a single property on a person. The property is updated asynchronously via the event pipeline ($set). Returns 202 Accepted. 3 params
Set a single property on a person. The property is updated asynchronously via the event pipeline ($set). Returns 202 Accepted.
id string required A unique value identifying this person. Accepts both numeric ID and UUID. key string required The property key to set. value object required The property value. Can be a string, number, boolean, or object. posthogmcp_persons_retrieve Retrieve a single person by numeric ID or UUID. Returns the person's properties, distinct IDs, and metadata. 1 param
Retrieve a single person by numeric ID or UUID. Returns the person's properties, distinct IDs, and metadata.
id string required A unique value identifying this person. Accepts both numeric ID and UUID. posthogmcp_persons_values_retrieve Get distinct values for a person property key. Useful for discovering what values exist for properties like 'plan', 'role', or 'company'. Provide the property key and optionally a search value to filter results. 2 params
Get distinct values for a person property key. Useful for discovering what values exist for properties like 'plan', 'role', or 'company'. Provide the property key and optionally a search value to filter results.
key string required The person property key to get values for (e.g., 'email', 'plan', 'role'). value string optional Optional search string to filter values (case-insensitive substring match). posthogmcp_projects_get Fetches projects that the user has access to in the current organization. 0 params
Fetches projects that the user has access to in the current organization.
posthogmcp_prompt_create Create a new LLM prompt for the current team. Requires a unique name and prompt content (string or JSON object). 2 params
Create a new LLM prompt for the current team. Requires a unique name and prompt content (string or JSON object).
name string required Unique prompt name using letters, numbers, hyphens, and underscores only. prompt object required Prompt payload as JSON or string data. posthogmcp_prompt_duplicate Duplicate an existing LLM prompt under a new name. Copies the latest version's content to create a new prompt at version 1. Useful for forking a prompt or as a way to rename since names are immutable after creation. 2 params
Duplicate an existing LLM prompt under a new name. Copies the latest version's content to create a new prompt at version 1. Useful for forking a prompt or as a way to rename since names are immutable after creation.
new_name string required Name for the duplicated prompt. Must be unique and use only letters, numbers, hyphens, and underscores. prompt_name string required Prompt name. posthogmcp_prompt_get Get a specific LLM prompt by name. Uses the cached endpoint for fast retrieval.
The response always includes `outline`, a flat list of markdown headings parsed from the prompt — useful
as a lightweight table of contents. Pass `content=none` to get the outline without the prompt payload,
or `content=preview` for a short `prompt_preview` snippet instead of the full prompt. 3 params
Get a specific LLM prompt by name. Uses the cached endpoint for fast retrieval. The response always includes `outline`, a flat list of markdown headings parsed from the prompt — useful as a lightweight table of contents. Pass `content=none` to get the outline without the prompt payload, or `content=preview` for a short `prompt_preview` snippet instead of the full prompt.
content string optional Controls how much prompt content is included in the response. 'full' includes the full prompt, 'preview' includes a short prompt_preview, and 'none' omits prompt content entirely. The outline field is always included. * 'full' - full * 'preview' - preview * 'none' - none prompt_name string required Prompt name. version number optional Specific prompt version to fetch. If omitted, the latest version is returned. posthogmcp_prompt_list List all LLM prompts stored for the current team. Optionally filter by name. Returns paginated prompt summaries. By default, only prompt metadata is returned, not full prompt content. Every result also includes `outline`, a flat list of markdown headings parsed from the prompt — use it as a lightweight table of contents, and pair with `content=none` to keep responses small. 2 params
List all LLM prompts stored for the current team. Optionally filter by name. Returns paginated prompt summaries. By default, only prompt metadata is returned, not full prompt content. Every result also includes `outline`, a flat list of markdown headings parsed from the prompt — use it as a lightweight table of contents, and pair with `content=none` to keep responses small.
content string optional Controls how much prompt content is included in list results. 'full' includes the full prompt, 'preview' includes a short prompt_preview, and 'none' omits prompt content entirely. search string optional Optional substring filter applied to prompt names and prompt content. posthogmcp_prompt_update Publish a new version of an existing LLM prompt by name. Name is immutable after creation.
You can either provide the full prompt content via 'prompt', or use 'edits' for incremental
find/replace updates. Each edit must have 'old' (text to find, must match exactly once) and
'new' (replacement text). Edits are applied sequentially. Only one of 'prompt' or 'edits'
may be provided. 4 params
Publish a new version of an existing LLM prompt by name. Name is immutable after creation. You can either provide the full prompt content via 'prompt', or use 'edits' for incremental find/replace updates. Each edit must have 'old' (text to find, must match exactly once) and 'new' (replacement text). Edits are applied sequentially. Only one of 'prompt' or 'edits' may be provided.
base_version number optional Latest version you are editing from. Used for optimistic concurrency checks. edits array optional List of find/replace operations to apply to the current prompt version. Each edit's 'old' text must match exactly once. Edits are applied sequentially. Mutually exclusive with prompt. prompt object optional Full prompt payload to publish as a new version. Mutually exclusive with edits. prompt_name string required Prompt name. posthogmcp_properties_list List properties for events or persons. If fetching event properties, you must provide an event name. 5 params
List properties for events or persons. If fetching event properties, you must provide an event name.
eventName string optional Event name to filter properties by, required for event type includePredefinedProperties boolean optional Whether to include predefined properties limit integer optional Limit. offset integer optional Offset. type string required Type of properties to get posthogmcp_proxy_create Create a new managed reverse proxy for a custom domain. Provide the domain (e.g. 'e.example.com') that will proxy requests to PostHog. The response includes the CNAME target — the user must add a CNAME DNS record pointing their domain to this target. Once DNS propagates, the proxy is automatically verified and an SSL certificate is issued. The proxy starts in 'waiting' status until DNS is verified. 1 param
Create a new managed reverse proxy for a custom domain. Provide the domain (e.g. 'e.example.com') that will proxy requests to PostHog. The response includes the CNAME target — the user must add a CNAME DNS record pointing their domain to this target. Once DNS propagates, the proxy is automatically verified and an SSL certificate is issued. The proxy starts in 'waiting' status until DNS is verified.
domain string required The custom domain to proxy through, e.g. 'e.example.com'. Must be a valid subdomain you control. posthogmcp_proxy_delete Delete a managed reverse proxy. For proxies still being set up (waiting, erroring, timed_out), the record is removed immediately. For active proxies, a cleanup workflow is started to remove the provisioned infrastructure. 1 param
Delete a managed reverse proxy. For proxies still being set up (waiting, erroring, timed_out), the record is removed immediately. For active proxies, a cleanup workflow is started to remove the provisioned infrastructure.
id string required A UUID string identifying this proxy record. posthogmcp_proxy_get Get full details of a specific reverse proxy by ID. Returns the domain, CNAME target (the DNS record value the user needs to configure), current provisioning status, and any error or warning messages. Use this to debug why a proxy isn't working or to check DNS verification status. 1 param
Get full details of a specific reverse proxy by ID. Returns the domain, CNAME target (the DNS record value the user needs to configure), current provisioning status, and any error or warning messages. Use this to debug why a proxy isn't working or to check DNS verification status.
id string required A UUID string identifying this proxy record. posthogmcp_proxy_list List all managed reverse proxies configured for the current organization. Returns each proxy's domain, CNAME target, provisioning status, and the maximum number of proxies allowed by the current plan. Use this to check whether a reverse proxy is set up before recommending one. 0 params
List all managed reverse proxies configured for the current organization. Returns each proxy's domain, CNAME target, provisioning status, and the maximum number of proxies allowed by the current plan. Use this to check whether a reverse proxy is set up before recommending one.
posthogmcp_proxy_retry Retry provisioning a reverse proxy that has failed. Only works for proxies in 'erroring' or 'timed_out' status. Resets the proxy to 'waiting' and restarts the DNS verification and certificate provisioning workflow. 1 param
Retry provisioning a reverse proxy that has failed. Only works for proxies in 'erroring' or 'timed_out' status. Resets the proxy to 'waiting' and restarts the DNS verification and certificate provisioning workflow.
id string required A UUID string identifying this proxy record. posthogmcp_query_error_tracking_issues Query error tracking issues to find, filter, and inspect errors in the project. Returns aggregated metrics per issue including occurrence count, affected users, sessions, and volume data.
Use 'read-data-schema' to discover available events, actions, and properties for filters.
This is a unified query tool — use it both to list issues and to get details on a specific issue:
- **List issues**: omit `issueId` to get a filtered, sorted list of error tracking issues.
- **Get issue details**: provide `issueId` to get aggregated metrics for a single issue.
Use `error-tracking-issues-retrieve` to get the full issue model (description, assignee, external references) and `error-tracking-issues-partial-update` to change status or assignee.
CRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.
# Data narrowing
## Property filters
Use property filters via the `filterGroup` field to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional filtering and always use the minimum set of property filters needed.
IMPORTANT: Do not check if a property is set unless the user explicitly asks for it.
When using a property filter, you should:
- **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `$browser`, `$os`, or `$geoip_country_code`.
- **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group.
- After selecting a property, **validate that the property value accurately reflects the intended criteria**.
- **Find the suitable operator for type** (e.g., `contains`, `is set`).
- If the operator requires a value, use the `read-data-schema` tool to find the property values.
Infer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group.
Supported operators for the String type are:
- equals (exact)
- doesn't equal (is_not)
- contains (icontains)
- doesn't contain (not_icontains)
- matches regex (regex)
- doesn't match regex (not_regex)
- is set
- is not set
Supported operators for the Numeric type are:
- equals (exact)
- doesn't equal (is_not)
- greater than (gt)
- less than (lt)
- is set
- is not set
Supported operators for the DateTime type are:
- equals (is_date_exact)
- doesn't equal (is_not for existence check)
- before (is_date_before)
- after (is_date_after)
- is set
- is not set
Supported operators for the Boolean type are:
- equals
- doesn't equal
- is set
- is not set
All operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array).
## Time period
You should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, the default is the last 7 days.
# Parameters
## issueId (optional)
When provided, returns aggregated metrics for a single error tracking issue. When omitted, returns a paginated list of issues matching the filters.
## status
Filter by issue status. Available values: `active`, `resolved`, `suppressed`, `pending_release`, `archived`, `all`. Defaults to `active`.
## orderBy
Field to sort results by: `occurrences`, `last_seen`, `first_seen`, `users`, `sessions`. Defaults to `occurrences`.
## searchQuery
Free-text search across exception type, message, and stack frames. Use this when the user is looking for a specific error by name or message content.
## assignee
Filter issues by assignee. The value is a user ID. Use this when the user asks to see errors assigned to a specific person.
## filterGroup
A flat list of property filters to narrow results. Each filter specifies a property key, operator, type (event/person/session/group), and value. See the "Property filters" section above for usage guidelines and supported operators.
## volumeResolution
Controls the granularity of the volume chart data returned with each issue. Use `1` (default) for list views where you want a volume sparkline. Use `0` when you only need aggregate counts without volume data.
## dateRange
Date range to filter results. Defaults to the last 7 days (`-7d`).
- `date_from`: Start of the range. Accepts ISO 8601 timestamps (e.g., `2024-01-15T00:00:00Z`) or relative formats: `-7d`, `-2w`, `-1m`, `-1h`, `-1mStart`, `-1yStart`.
- `date_to`: End of the range. Same format. Omit or null for "now".
## limit / offset
Pagination controls. `limit` defaults to 50.
# Examples
## List all active errors sorted by occurrence count
```json
{}
```
All defaults apply: `status: "active"`, `orderBy: "occurrences"`, `dateRange: { "date_from": "-7d" }`.
## Search for a specific error
```json
{
"searchQuery": "TypeError: Cannot read property",
"limit": 10
}
```
## Get details for a specific issue
```json
{
"issueId": "01234567-89ab-cdef-0123-456789abcdef",
"volumeResolution": 0
}
```
## List resolved errors from the last 30 days
```json
{
"status": "resolved",
"dateRange": { "date_from": "-30d" },
"orderBy": "last_seen"
}
```
## Find most recent errors
```json
{
"orderBy": "first_seen",
"orderDirection": "DESC",
"dateRange": { "date_from": "-24h" }
}
```
## Errors from Chrome users only
```json
{
"filterGroup": [{ "key": "$browser", "operator": "exact", "type": "event", "value": ["Chrome"] }]
}
```
## Errors from US users in the last 30 days
```json
{
"filterGroup": [{ "key": "$geoip_country_code", "operator": "exact", "type": "event", "value": ["US"] }],
"dateRange": { "date_from": "-30d" }
}
```
# Reminders
- Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details.
- Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution. 13 params
Query error tracking issues to find, filter, and inspect errors in the project. Returns aggregated metrics per issue including occurrence count, affected users, sessions, and volume data. Use 'read-data-schema' to discover available events, actions, and properties for filters. This is a unified query tool — use it both to list issues and to get details on a specific issue: - **List issues**: omit `issueId` to get a filtered, sorted list of error tracking issues. - **Get issue details**: provide `issueId` to get aggregated metrics for a single issue. Use `error-tracking-issues-retrieve` to get the full issue model (description, assignee, external references) and `error-tracking-issues-partial-update` to change status or assignee. CRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization. # Data narrowing ## Property filters Use property filters via the `filterGroup` field to narrow results. Only include property filters when they are essential to directly answer the user's question. Avoid adding them if the question can be addressed without additional filtering and always use the minimum set of property filters needed. IMPORTANT: Do not check if a property is set unless the user explicitly asks for it. When using a property filter, you should: - **Prioritize properties directly related to the context or objective of the user's query.** Avoid using properties for identification like IDs. Instead, prioritize filtering based on general properties like `$browser`, `$os`, or `$geoip_country_code`. - **Ensure that you find both the property group and name.** Property groups should be one of the following: event, person, session, group. - After selecting a property, **validate that the property value accurately reflects the intended criteria**. - **Find the suitable operator for type** (e.g., `contains`, `is set`). - If the operator requires a value, use the `read-data-schema` tool to find the property values. Infer the property groups from the user's request. If your first guess doesn't yield any results, try to adjust the property group. Supported operators for the String type are: - equals (exact) - doesn't equal (is_not) - contains (icontains) - doesn't contain (not_icontains) - matches regex (regex) - doesn't match regex (not_regex) - is set - is not set Supported operators for the Numeric type are: - equals (exact) - doesn't equal (is_not) - greater than (gt) - less than (lt) - is set - is not set Supported operators for the DateTime type are: - equals (is_date_exact) - doesn't equal (is_not for existence check) - before (is_date_before) - after (is_date_after) - is set - is not set Supported operators for the Boolean type are: - equals - doesn't equal - is set - is not set All operators take a single value except for `equals` and `doesn't equal` which can take one or more values (as an array). ## Time period You should not filter events by time using property filters. Instead, use the `dateRange` field. If the question doesn't mention time, the default is the last 7 days. # Parameters ## issueId (optional) When provided, returns aggregated metrics for a single error tracking issue. When omitted, returns a paginated list of issues matching the filters. ## status Filter by issue status. Available values: `active`, `resolved`, `suppressed`, `pending_release`, `archived`, `all`. Defaults to `active`. ## orderBy Field to sort results by: `occurrences`, `last_seen`, `first_seen`, `users`, `sessions`. Defaults to `occurrences`. ## searchQuery Free-text search across exception type, message, and stack frames. Use this when the user is looking for a specific error by name or message content. ## assignee Filter issues by assignee. The value is a user ID. Use this when the user asks to see errors assigned to a specific person. ## filterGroup A flat list of property filters to narrow results. Each filter specifies a property key, operator, type (event/person/session/group), and value. See the "Property filters" section above for usage guidelines and supported operators. ## volumeResolution Controls the granularity of the volume chart data returned with each issue. Use `1` (default) for list views where you want a volume sparkline. Use `0` when you only need aggregate counts without volume data. ## dateRange Date range to filter results. Defaults to the last 7 days (`-7d`). - `date_from`: Start of the range. Accepts ISO 8601 timestamps (e.g., `2024-01-15T00:00:00Z`) or relative formats: `-7d`, `-2w`, `-1m`, `-1h`, `-1mStart`, `-1yStart`. - `date_to`: End of the range. Same format. Omit or null for "now". ## limit / offset Pagination controls. `limit` defaults to 50. # Examples ## List all active errors sorted by occurrence count ```json {} ``` All defaults apply: `status: "active"`, `orderBy: "occurrences"`, `dateRange: { "date_from": "-7d" }`. ## Search for a specific error ```json { "searchQuery": "TypeError: Cannot read property", "limit": 10 } ``` ## Get details for a specific issue ```json { "issueId": "01234567-89ab-cdef-0123-456789abcdef", "volumeResolution": 0 } ``` ## List resolved errors from the last 30 days ```json { "status": "resolved", "dateRange": { "date_from": "-30d" }, "orderBy": "last_seen" } ``` ## Find most recent errors ```json { "orderBy": "first_seen", "orderDirection": "DESC", "dateRange": { "date_from": "-24h" } } ``` ## Errors from Chrome users only ```json { "filterGroup": [{ "key": "$browser", "operator": "exact", "type": "event", "value": ["Chrome"] }] } ``` ## Errors from US users in the last 30 days ```json { "filterGroup": [{ "key": "$geoip_country_code", "operator": "exact", "type": "event", "value": ["US"] }], "dateRange": { "date_from": "-30d" } } ``` # Reminders - Ensure that any properties included are directly relevant to the context and objectives of the user's question. Avoid unnecessary or unrelated details. - Avoid overcomplicating the response with excessive property filters. Focus on the simplest solution.
assignee object optional Filter by assignee. dateRange object optional Date range to filter results. filterGroup array optional Property filters for the query filterTestAccounts boolean optional Whether to filter out test accounts. issueId string optional Filter to a specific error tracking issue by ID. kind string optional Kind. limit integer optional Limit. offset integer optional Offset. orderBy string optional Field to sort results by. orderDirection string optional Sort direction. searchQuery string optional Free-text search across exception type, message, and stack frames. status string optional Filter by issue status. volumeResolution integer optional Controls volume chart granularity. Use 1 for sparklines, 0 for counts only. posthogmcp_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 easily readable format. You should also offer to save the query as an insight if the user wants to. 1 param
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 easily readable format. You should also offer to save the query as an insight if the user wants to.
question string required Your natural language query describing the SQL insight (max 1000 characters). posthogmcp_query_logs Query log entries with filtering by severity, service name, date range, search term, and structured attribute filters. Supports cursor-based pagination. Returns log entries with timestamp, body, level, service_name, trace_id, and attributes.
Use `logs-attributes-list` and `logs-attribute-values-list` to discover available attributes before building filters.
# Workflow — follow this order every time
1. **Discover services first.** Call `logs-attribute-values-list` with `key: "service.name"` and `attribute_type: "resource"` to see available services.
2. **Explore resource attributes.** Call `logs-attributes-list` with `attribute_type: "resource"` to discover resource-level attributes (e.g. `k8s.pod.name`, `k8s.namespace.name`). Then call `logs-attribute-values-list` with `attribute_type: "resource"` for relevant attributes to validate what data exists.
3. **Explore log attributes if needed.** Call `logs-attributes-list` (defaults to log attributes) and `logs-attribute-values-list` to discover log-level attributes.
4. **Check volume with a sparkline.** Call `logs-sparkline-query` with the discovered `serviceNames` and filters to see log volume over time. This confirms there is data and shows patterns before you pull individual entries.
5. **Only then query logs.** Once you have confirmed the service name, volume looks right, and relevant filters are set, call `query-logs` with `serviceNames` and any additional filters.
10 attribute/value queries and 1 sparkline query are cheaper than 1 log query. Prefer thorough exploration over speculative log searches.
CRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization.
MANDATORY: Never call query-logs without setting `serviceNames` or at least one `log_resource_attribute` filter. Unfiltered log queries are too broad, expensive, and noisy. If the user hasn't specified a service, use the workflow above to discover services first, then ask or infer.
All parameters must be nested inside a `query` object.
# Data narrowing
## Property filters
Use property filters via the `query.filterGroup` field to narrow results. Only include property filters when they are essential to directly answer the user's question.
When using a property filter, you should:
- **Choose the right type.** Log property types are:
- `log` — filters the log body/message. Use key "message" for this type.
- `log_attribute` — filters log-level attributes (e.g. "k8s.container.name", "http.method").
- `log_resource_attribute` — filters resource-level attributes (e.g. k8s labels, deployment info).
- **Use `logs-attributes-list` to discover available attribute keys** before building filters.
- **Use `logs-attribute-values-list` to discover valid values** for a specific attribute key.
- **Find the suitable operator for the value type** (see supported operators below).
**Important:** The `logs-attributes-list` and `logs-attribute-values-list` tools default to `attribute_type: "log"` (log-level attributes). To search resource-level attributes (e.g. `k8s.pod.name`, `k8s.namespace.name`), you must explicitly pass `attribute_type: "resource"`. Forgetting this will return log-level attributes when you intended resource-level ones.
Supported operators:
- String: `exact`, `is_not`, `icontains`, `not_icontains`, `regex`, `not_regex`
- Numeric: `exact`, `gt`, `lt`
- Date: `is_date_exact`, `is_date_before`, `is_date_after`
- Existence (no value needed): `is_set`, `is_not_set`
The `value` field accepts a string, number, or array of strings depending on the operator. Omit `value` for `is_set`/`is_not_set`.
## Time period
Use the `query.dateRange` field to control the time window. If the question doesn't mention time, the default is the last hour (`-1h`). Examples of relative dates: `-1h`, `-6h`, `-1d`, `-7d`, `-30d`.
# Parameters
All parameters go inside `query`.
## query.severityLevels
Filter by log severity: `trace`, `debug`, `info`, `warn`, `error`, `fatal`. Omit to include all levels.
## query.serviceNames
Filter by service names. Use `logs-attribute-values-list` with `key: "service.name"` and `attribute_type: "resource"` to discover available services.
## query.searchTerm
Full-text search across log bodies. Use this when the user is looking for specific text in log messages.
## query.orderBy
Sort by timestamp: `latest` (default) or `earliest`.
## query.filterGroup
A list of property filters to narrow results. Each filter specifies `key`, `operator`, `type` (log/log_attribute/log_resource_attribute), and optionally `value`. See the "Property filters" section above.
## query.dateRange
Date range to filter results. Defaults to the last hour (`-1h`).
- `date_from`: Start of the range. Accepts ISO 8601 timestamps or relative formats: `-1h`, `-6h`, `-1d`, `-7d`, `-30d`.
- `date_to`: End of the range. Same format. Omit or null for "now".
## query.limit
Maximum number of results (1-1000). Defaults to 100.
## query.after
Cursor for pagination. Use the `nextCursor` value from the previous response.
# Examples
## List recent error logs
```json
{
"query": {
"severityLevels": ["error", "fatal"],
"serviceNames": ["<service>"]
}
}
```
## Search for a specific log message
```json
{
"query": {
"searchTerm": "connection refused",
"serviceNames": ["<service>"],
"dateRange": { "date_from": "-6h" }
}
}
```
## Filter logs from a specific service
```json
{
"query": {
"serviceNames": ["api-gateway"],
"dateRange": { "date_from": "-1d" }
}
}
```
## Filter by a log attribute
```json
{
"query": {
"serviceNames": ["<service>"],
"filterGroup": [{ "key": "http.status_code", "operator": "exact", "type": "log_attribute", "value": "500" }],
"dateRange": { "date_from": "-1d" }
}
}
```
## Combine severity and attribute filters
```json
{
"query": {
"severityLevels": ["error"],
"filterGroup": [
{ "key": "k8s.container.name", "operator": "exact", "type": "log_resource_attribute", "value": "web" }
],
"dateRange": { "date_from": "-12h" }
}
}
```
## Filter by log body content using property filter
```json
{
"query": {
"serviceNames": ["<service>"],
"filterGroup": [{ "key": "message", "operator": "icontains", "type": "log", "value": "timeout" }]
}
}
```
## Check if an attribute exists
```json
{
"query": {
"serviceNames": ["<service>"],
"filterGroup": [{ "key": "trace_id", "operator": "is_set", "type": "log_attribute" }]
}
}
```
# Reminders
- Always set `serviceNames` or a resource attribute filter. Never run a broad unfiltered log query.
- Limit `dateRange` to at most `-1d` (24 hours) unless the user explicitly requests a longer range.
- When using `logs-attributes-list` or `logs-attribute-values-list`, remember they default to `attribute_type: "log"`. Pass `attribute_type: "resource"` to search resource-level attributes.
- Ensure that any property filters are directly relevant to the user's question. Avoid unnecessary filtering.
- Use `logs-attributes-list` and `logs-attribute-values-list` to discover attributes before guessing filter keys/values.
- Prefer `searchTerm` for simple text matching; use `filterGroup` with type `log` and key `message` for regex or exact matching. 1 param
Query log entries with filtering by severity, service name, date range, search term, and structured attribute filters. Supports cursor-based pagination. Returns log entries with timestamp, body, level, service_name, trace_id, and attributes. Use `logs-attributes-list` and `logs-attribute-values-list` to discover available attributes before building filters. # Workflow — follow this order every time 1. **Discover services first.** Call `logs-attribute-values-list` with `key: "service.name"` and `attribute_type: "resource"` to see available services. 2. **Explore resource attributes.** Call `logs-attributes-list` with `attribute_type: "resource"` to discover resource-level attributes (e.g. `k8s.pod.name`, `k8s.namespace.name`). Then call `logs-attribute-values-list` with `attribute_type: "resource"` for relevant attributes to validate what data exists. 3. **Explore log attributes if needed.** Call `logs-attributes-list` (defaults to log attributes) and `logs-attribute-values-list` to discover log-level attributes. 4. **Check volume with a sparkline.** Call `logs-sparkline-query` with the discovered `serviceNames` and filters to see log volume over time. This confirms there is data and shows patterns before you pull individual entries. 5. **Only then query logs.** Once you have confirmed the service name, volume looks right, and relevant filters are set, call `query-logs` with `serviceNames` and any additional filters. 10 attribute/value queries and 1 sparkline query are cheaper than 1 log query. Prefer thorough exploration over speculative log searches. CRITICAL: Be minimalist. Only include filters and settings that are essential to answer the user's specific question. Default settings are usually sufficient unless the user explicitly requests customization. MANDATORY: Never call query-logs without setting `serviceNames` or at least one `log_resource_attribute` filter. Unfiltered log queries are too broad, expensive, and noisy. If the user hasn't specified a service, use the workflow above to discover services first, then ask or infer. All parameters must be nested inside a `query` object. # Data narrowing ## Property filters Use property filters via the `query.filterGroup` field to narrow results. Only include property filters when they are essential to directly answer the user's question. When using a property filter, you should: - **Choose the right type.** Log property types are: - `log` — filters the log body/message. Use key "message" for this type. - `log_attribute` — filters log-level attributes (e.g. "k8s.container.name", "http.method"). - `log_resource_attribute` — filters resource-level attributes (e.g. k8s labels, deployment info). - **Use `logs-attributes-list` to discover available attribute keys** before building filters. - **Use `logs-attribute-values-list` to discover valid values** for a specific attribute key. - **Find the suitable operator for the value type** (see supported operators below). **Important:** The `logs-attributes-list` and `logs-attribute-values-list` tools default to `attribute_type: "log"` (log-level attributes). To search resource-level attributes (e.g. `k8s.pod.name`, `k8s.namespace.name`), you must explicitly pass `attribute_type: "resource"`. Forgetting this will return log-level attributes when you intended resource-level ones. Supported operators: - String: `exact`, `is_not`, `icontains`, `not_icontains`, `regex`, `not_regex` - Numeric: `exact`, `gt`, `lt` - Date: `is_date_exact`, `is_date_before`, `is_date_after` - Existence (no value needed): `is_set`, `is_not_set` The `value` field accepts a string, number, or array of strings depending on the operator. Omit `value` for `is_set`/`is_not_set`. ## Time period Use the `query.dateRange` field to control the time window. If the question doesn't mention time, the default is the last hour (`-1h`). Examples of relative dates: `-1h`, `-6h`, `-1d`, `-7d`, `-30d`. # Parameters All parameters go inside `query`. ## query.severityLevels Filter by log severity: `trace`, `debug`, `info`, `warn`, `error`, `fatal`. Omit to include all levels. ## query.serviceNames Filter by service names. Use `logs-attribute-values-list` with `key: "service.name"` and `attribute_type: "resource"` to discover available services. ## query.searchTerm Full-text search across log bodies. Use this when the user is looking for specific text in log messages. ## query.orderBy Sort by timestamp: `latest` (default) or `earliest`. ## query.filterGroup A list of property filters to narrow results. Each filter specifies `key`, `operator`, `type` (log/log_attribute/log_resource_attribute), and optionally `value`. See the "Property filters" section above. ## query.dateRange Date range to filter results. Defaults to the last hour (`-1h`). - `date_from`: Start of the range. Accepts ISO 8601 timestamps or relative formats: `-1h`, `-6h`, `-1d`, `-7d`, `-30d`. - `date_to`: End of the range. Same format. Omit or null for "now". ## query.limit Maximum number of results (1-1000). Defaults to 100. ## query.after Cursor for pagination. Use the `nextCursor` value from the previous response. # Examples ## List recent error logs ```json { "query": { "severityLevels": ["error", "fatal"], "serviceNames": ["<service>"] } } ``` ## Search for a specific log message ```json { "query": { "searchTerm": "connection refused", "serviceNames": ["<service>"], "dateRange": { "date_from": "-6h" } } } ``` ## Filter logs from a specific service ```json { "query": { "serviceNames": ["api-gateway"], "dateRange": { "date_from": "-1d" } } } ``` ## Filter by a log attribute ```json { "query": { "serviceNames": ["<service>"], "filterGroup": [{ "key": "http.status_code", "operator": "exact", "type": "log_attribute", "value": "500" }], "dateRange": { "date_from": "-1d" } } } ``` ## Combine severity and attribute filters ```json { "query": { "severityLevels": ["error"], "filterGroup": [ { "key": "k8s.container.name", "operator": "exact", "type": "log_resource_attribute", "value": "web" } ], "dateRange": { "date_from": "-12h" } } } ``` ## Filter by log body content using property filter ```json { "query": { "serviceNames": ["<service>"], "filterGroup": [{ "key": "message", "operator": "icontains", "type": "log", "value": "timeout" }] } } ``` ## Check if an attribute exists ```json { "query": { "serviceNames": ["<service>"], "filterGroup": [{ "key": "trace_id", "operator": "is_set", "type": "log_attribute" }] } } ``` # Reminders - Always set `serviceNames` or a resource attribute filter. Never run a broad unfiltered log query. - Limit `dateRange` to at most `-1d` (24 hours) unless the user explicitly requests a longer range. - When using `logs-attributes-list` or `logs-attribute-values-list`, remember they default to `attribute_type: "log"`. Pass `attribute_type: "resource"` to search resource-level attributes. - Ensure that any property filters are directly relevant to the user's question. Avoid unnecessary filtering. - Use `logs-attributes-list` and `logs-attribute-values-list` to discover attributes before guessing filter keys/values. - Prefer `searchTerm` for simple text matching; use `filterGroup` with type `log` and key `message` for regex or exact matching.
query object required The logs query to execute. posthogmcp_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, paths or HogQL query. Where possible, use a trend, funnel or paths query rather than a HogQL query, unless you know the HogQL is correct (e.g. it came from a previous insight.). Use PathsQuery to visualize user flows and navigation patterns — set includeEventTypes to ['hogql'] with a pathsHogQLExpression for custom path steps. 1 param
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, paths or HogQL query. Where possible, use a trend, funnel or paths query rather than a HogQL query, unless you know the HogQL is correct (e.g. it came from a previous insight.). Use PathsQuery to visualize user flows and navigation patterns — set includeEventTypes to ['hogql'] with a pathsHogQLExpression for custom path steps.
query object required Query object. For analytics charts use InsightVizNode: {kind: 'InsightVizNode', source: TrendsQuery|FunnelsQuery|PathsQuery}. For SQL use DataVisualizationNode: {kind: 'DataVisualizationNode', source: {kind: 'HogQLQuery', query: 'SELECT ...'}}. TrendsQuery and FunnelsQuery require series: [{kind: 'EventsNode', event: 'event_name', custom_name: 'Label'}]. PathsQuery supports pathsFilter for controlling steps and edge limits. posthogmcp_role_get Get details of a specific role including its name, creation date, and creator. 1 param
Get details of a specific role including its name, creation date, and creator.
id string required A UUID string identifying this role. posthogmcp_role_members_list List all members assigned to a specific role. Shows who has which role in the organization. 3 params
List all members assigned to a specific role. Shows who has which role in the organization.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. role_id string required Role id. posthogmcp_roles_list List all roles defined in the organization. Roles group members and can be used in approval policies and access control rules. 2 params
List all roles defined in the organization. Roles group members and can be used in approval policies and access control rules.
limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. posthogmcp_scheduled_changes_create Schedule a future change to a feature flag. Supported operations: 'update_status' (enable/disable), 'add_release_condition', and 'update_variants'. Provide the flag ID as record_id, model_name as "FeatureFlag", a payload with the operation and value, and a scheduled_at datetime. 8 params
Schedule a future change to a feature flag. Supported operations: 'update_status' (enable/disable), 'add_release_condition', and 'update_variants'. Provide the flag ID as record_id, model_name as "FeatureFlag", a payload with the operation and value, and a scheduled_at datetime.
cron_expression string optional Cron expression. end_date string optional Optional ISO 8601 datetime after which a recurring schedule stops executing. is_recurring boolean optional Whether this schedule repeats. Only the 'update_status' operation supports recurring schedules. model_name string required The type of record to modify. Currently only "FeatureFlag" is supported. * 'FeatureFlag' - feature flag payload object required The change to apply. Must include an 'operation' key and a 'value' key. Supported operations: 'update_status' (value: true/false to enable/disable the flag), 'add_release_condition' (value: object with 'groups', 'payloads', and 'multivariate' keys), 'update_variants' (value: object with 'variants' and 'payloads' keys). record_id string required The ID of the record to modify (e.g. the feature flag ID). recurrence_interval string optional How often the schedule repeats. Required when is_recurring is true. One of: daily, weekly, monthly, yearly. * 'daily' - daily * 'weekly' - weekly * 'monthly' - monthly * 'yearly' - yearly scheduled_at string required ISO 8601 datetime when the change should be applied (e.g. '2025-06-01T14:00:00Z'). posthogmcp_scheduled_changes_delete Delete a scheduled change by ID. This permanently removes the scheduled change and it will not be executed. 1 param
Delete a scheduled change by ID. This permanently removes the scheduled change and it will not be executed.
id number required A unique integer value identifying this scheduled change. posthogmcp_scheduled_changes_get Get a single scheduled change by ID. Returns the full details including the payload, schedule timing, execution status, and any failure reason. 1 param
Get a single scheduled change by ID. Returns the full details including the payload, schedule timing, execution status, and any failure reason.
id number required A unique integer value identifying this scheduled change. posthogmcp_scheduled_changes_list List scheduled changes in the current project. Filter by model_name=FeatureFlag and record_id to see schedules for a specific flag. Returns pending, executed, and failed schedules with their payloads and timing. Use this to check what changes are queued for a feature flag before modifying it. 4 params
List scheduled changes in the current project. Filter by model_name=FeatureFlag and record_id to see schedules for a specific flag. Returns pending, executed, and failed schedules with their payloads and timing. Use this to check what changes are queued for a feature flag before modifying it.
limit number optional Number of results to return per page. model_name string optional Filter by model type. Use "FeatureFlag" to see feature flag schedules. offset number optional The initial index from which to return the results. record_id string optional Filter by the ID of a specific feature flag. posthogmcp_scheduled_changes_update Update a pending scheduled change by ID. You can modify the payload, scheduled_at time, or recurrence settings. Cannot change the target record (record_id) or model type (model_name). 9 params
Update a pending scheduled change by ID. You can modify the payload, scheduled_at time, or recurrence settings. Cannot change the target record (record_id) or model type (model_name).
cron_expression string optional Cron expression. end_date string optional Optional ISO 8601 datetime after which a recurring schedule stops executing. id number required A unique integer value identifying this scheduled change. is_recurring boolean optional Whether this schedule repeats. Only the 'update_status' operation supports recurring schedules. model_name string optional The type of record to modify. Currently only "FeatureFlag" is supported. * 'FeatureFlag' - feature flag payload object optional The change to apply. Must include an 'operation' key and a 'value' key. Supported operations: 'update_status' (value: true/false to enable/disable the flag), 'add_release_condition' (value: object with 'groups', 'payloads', and 'multivariate' keys), 'update_variants' (value: object with 'variants' and 'payloads' keys). record_id string optional The ID of the record to modify (e.g. the feature flag ID). recurrence_interval string optional How often the schedule repeats. Required when is_recurring is true. One of: daily, weekly, monthly, yearly. * 'daily' - daily * 'weekly' - weekly * 'monthly' - monthly * 'yearly' - yearly scheduled_at string optional ISO 8601 datetime when the change should be applied (e.g. '2025-06-01T14:00:00Z'). posthogmcp_session_recording_delete Delete a session recording by ID. This permanently removes the recording data. Use for privacy or compliance workflows. 1 param
Delete a session recording by ID. This permanently removes the recording data. Use for privacy or compliance workflows.
id string required A UUID string identifying this session recording. posthogmcp_session_recording_get Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, person info, and viewing status. 1 param
Get a specific session recording by ID. Returns full recording metadata including duration, interaction counts, console log counts, person info, and viewing status.
id string required A UUID string identifying this session recording. posthogmcp_session_recording_playlist_create Create a new session recording playlist. Set type to 'collection' for a manually curated list or 'filters' for a saved filter view. Collections cannot have filters, and filter playlists must include at least one filter criterion. 7 params
Create a new session recording playlist. Set type to 'collection' for a manually curated list or 'filters' for a saved filter view. Collections cannot have filters, and filter playlists must include at least one filter criterion.
deleted boolean optional Set to true to soft-delete the playlist. derived_name string optional Derived name. description string optional Optional description of the playlist's purpose or contents. filters object optional JSON object with recording filter criteria. Only used when type is 'filters'. Defines which recordings match this saved filter view. When updating a filters-type playlist, you must include the existing filters alongside any other changes — omitting filters will be treated as removing them. name string optional Human-readable name for the playlist. pinned boolean optional Whether this playlist is pinned to the top of the list. type string optional Playlist type: 'collection' for manually curated recordings, 'filters' for saved filter views. Required on create, cannot be changed after. * 'collection' - Collection * 'filters' - Filters posthogmcp_session_recording_playlist_get Get a specific session recording playlist by short_id. Returns full playlist metadata including name, description, filters, type, and recording counts. 1 param
Get a specific session recording playlist by short_id. Returns full playlist metadata including name, description, filters, type, and recording counts.
short_id string required Short id. posthogmcp_session_recording_playlist_update Update an existing session recording playlist by short_id. Can update name, description, pinned status, and filters. Set deleted to true to soft-delete. The type field cannot be changed after creation. When updating a filters-type playlist, you must include the existing filters alongside other field changes, otherwise the update will fail. 7 params
Update an existing session recording playlist by short_id. Can update name, description, pinned status, and filters. Set deleted to true to soft-delete. The type field cannot be changed after creation. When updating a filters-type playlist, you must include the existing filters alongside other field changes, otherwise the update will fail.
deleted boolean optional Set to true to soft-delete the playlist. derived_name string optional Derived name. description string optional Optional description of the playlist's purpose or contents. filters object optional JSON object with recording filter criteria. Only used when type is 'filters'. Defines which recordings match this saved filter view. When updating a filters-type playlist, you must include the existing filters alongside any other changes — omitting filters will be treated as removing them. name string optional Human-readable name for the playlist. pinned boolean optional Whether this playlist is pinned to the top of the list. short_id string required Short id. posthogmcp_session_recording_playlists_list List session recording playlists in the project. Returns both user-created and synthetic (system-generated) playlists with their metadata and recording counts. 4 params
List session recording playlists in the project. Returns both user-created and synthetic (system-generated) playlists with their metadata and recording counts.
created_by number optional Created by. limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. short_id string optional Short id. posthogmcp_subscriptions_create Create a new subscription to receive scheduled deliveries of an insight or dashboard. Requires either an insight ID or dashboard ID. Set target_type to email, slack, or webhook and target_value to the recipient(s). For email: comma-separated addresses. For slack: requires an integration_id for a connected Slack workspace plus a channel name in target_value. For webhook: a URL. Set frequency (daily, weekly, monthly, yearly) and optionally interval, byweekday, start_date, and until_date. Dashboard subscriptions also require dashboard_export_insights (list of insight IDs from that dashboard, max 6). 18 params
Create a new subscription to receive scheduled deliveries of an insight or dashboard. Requires either an insight ID or dashboard ID. Set target_type to email, slack, or webhook and target_value to the recipient(s). For email: comma-separated addresses. For slack: requires an integration_id for a connected Slack workspace plus a channel name in target_value. For webhook: a URL. Set frequency (daily, weekly, monthly, yearly) and optionally interval, byweekday, start_date, and until_date. Dashboard subscriptions also require dashboard_export_insights (list of insight IDs from that dashboard, max 6).
bysetpos number optional Position within byweekday set for monthly frequency (e.g. 1 for first, -1 for last). byweekday array optional Days of week for weekly subscriptions: monday, tuesday, wednesday, thursday, friday, saturday, sunday. count number optional Total number of deliveries before the subscription stops. Null for unlimited. dashboard number optional Dashboard ID to subscribe to (mutually exclusive with insight on create). dashboard_export_insights array optional List of insight IDs from the dashboard to include. Required for dashboard subscriptions, max 6. deleted boolean optional Set to true to soft-delete. Subscriptions cannot be hard-deleted. frequency string required How often to deliver: daily, weekly, monthly, or yearly. * 'daily' - Daily * 'weekly' - Weekly * 'monthly' - Monthly * 'yearly' - Yearly insight number optional Insight ID to subscribe to (mutually exclusive with dashboard on create). integration_id number optional ID of a connected Slack integration. Required when target_type is slack. interval number optional Interval multiplier (e.g. 2 with weekly frequency means every 2 weeks). Default 1. invite_message string optional Optional message included in the invitation email when adding new recipients. start_date string required When to start delivering (ISO 8601 datetime). summary_enabled boolean optional Summary enabled. summary_prompt_guide string optional Summary prompt guide. target_type string required Delivery channel: email, slack, or webhook. * 'email' - Email * 'slack' - Slack * 'webhook' - Webhook target_value string required Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook. title string optional Human-readable name for this subscription. until_date string optional When to stop delivering (ISO 8601 datetime). Null for indefinite. posthogmcp_subscriptions_list List subscriptions for the project. Returns scheduled email, Slack, or webhook deliveries of insight or dashboard snapshots. Each subscription includes its schedule (frequency, interval, byweekday), next_delivery_date, and a human-readable summary. 9 params
List subscriptions for the project. Returns scheduled email, Slack, or webhook deliveries of insight or dashboard snapshots. Each subscription includes its schedule (frequency, interval, byweekday), next_delivery_date, and a human-readable summary.
created_by string optional Filter by creator user UUID. dashboard number optional Filter by dashboard ID. insight number optional Filter by insight ID. limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. ordering string optional Which field to use when ordering the results. resource_type string optional Filter by subscription resource: insight vs dashboard export. search string optional A search term. target_type string optional Filter by delivery channel (email, Slack, or webhook). posthogmcp_subscriptions_partial_update Update an existing subscription by ID. Can change target_type, target_value, frequency, interval, byweekday, start_date, until_date, title, or deleted status. Set deleted to true to deactivate a subscription (subscriptions are soft-deleted). Changing target_value triggers notifications to new recipients. 19 params
Update an existing subscription by ID. Can change target_type, target_value, frequency, interval, byweekday, start_date, until_date, title, or deleted status. Set deleted to true to deactivate a subscription (subscriptions are soft-deleted). Changing target_value triggers notifications to new recipients.
bysetpos number optional Position within byweekday set for monthly frequency (e.g. 1 for first, -1 for last). byweekday array optional Days of week for weekly subscriptions: monday, tuesday, wednesday, thursday, friday, saturday, sunday. count number optional Total number of deliveries before the subscription stops. Null for unlimited. dashboard number optional Dashboard ID to subscribe to (mutually exclusive with insight on create). dashboard_export_insights array optional List of insight IDs from the dashboard to include. Required for dashboard subscriptions, max 6. deleted boolean optional Set to true to soft-delete. Subscriptions cannot be hard-deleted. frequency string optional How often to deliver: daily, weekly, monthly, or yearly. * 'daily' - Daily * 'weekly' - Weekly * 'monthly' - Monthly * 'yearly' - Yearly id number required A unique integer value identifying this subscription. insight number optional Insight ID to subscribe to (mutually exclusive with dashboard on create). integration_id number optional ID of a connected Slack integration. Required when target_type is slack. interval number optional Interval multiplier (e.g. 2 with weekly frequency means every 2 weeks). Default 1. invite_message string optional Optional message included in the invitation email when adding new recipients. start_date string optional When to start delivering (ISO 8601 datetime). summary_enabled boolean optional Summary enabled. summary_prompt_guide string optional Summary prompt guide. target_type string optional Delivery channel: email, slack, or webhook. * 'email' - Email * 'slack' - Slack * 'webhook' - Webhook target_value string optional Recipient(s): comma-separated email addresses for email, Slack channel name/ID for slack, or full URL for webhook. title string optional Human-readable name for this subscription. until_date string optional When to stop delivering (ISO 8601 datetime). Null for indefinite. posthogmcp_subscriptions_retrieve Get a specific subscription by ID. Returns the full subscription configuration including target type and value, schedule details, next delivery date, and associated insight or dashboard. 1 param
Get a specific subscription by ID. Returns the full subscription configuration including target type and value, schedule details, next delivery date, and associated insight or dashboard.
id number required A unique integer value identifying this subscription. posthogmcp_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. 12 params
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.
appearance object optional Survey appearance customization. description string optional Survey description. enable_partial_responses boolean optional When at least one question is answered, the response is stored (true). The response is stored when all questions are answered (false). iteration_count number optional For a recurring schedule, this field specifies the number of times the survey should be shown to the user. Use 1 for 'once every X days', higher numbers for multiple repetitions. Works together with iteration_frequency_days to determine the overall survey schedule. iteration_frequency_days number optional For a recurring schedule, this field specifies the interval in days between each survey instance shown to the user, used alongside iteration_count for precise scheduling. linked_flag_id number optional The feature flag linked to this survey. name string required Survey name. questions array optional The 'array' of questions included in the survey. Each question must conform to one of the defined question types: Basic, Link, Rating, or Multiple Choice. Basic (open-ended question) - 'id': The question ID - 'type': 'open' - 'question': The text of the question. - 'description': Optional description of the question. - 'descriptionContentType': Content type of the description ('html' or 'text'). - 'optional': Whether the question is optional ('boolean'). - 'buttonText': Text displayed on the submit button. - 'branching': Branching logic for the question. See branching types below for details. Link (a question with a link) - 'id': The question ID - 'type': 'link' - 'question': The text of the question. - 'description': Optional description of the question. - 'descriptionContentType': Content type of the description ('html' or 'text'). - 'optional': Whether the question is optional ('boolean'). - 'buttonText': Text displayed on the submit button. - 'link': The URL associated with the question. - 'branching': Branching logic for the question. See branching types below for details. Rating (a question with a rating scale) - 'id': The question ID - 'type': 'rating' - 'question': The text of the question. - 'description': Optional description of the question. - 'descriptionContentType': Content type of the description ('html' or 'text'). - 'optional': Whether the question is optional ('boolean'). - 'buttonText': Text displayed on the submit button. - 'display': Display style of the rating ('number' or 'emoji'). - 'scale': The scale of the rating ('number'). - 'lowerBoundLabel': Label for the lower bound of the scale. - 'upperBoundLabel': Label for the upper bound of the scale. - 'isNpsQuestion': Whether the question is an NPS rating. - 'branching': Branching logic for the question. See branching types below for details. Multiple choice - 'id': The question ID - 'type': 'single_choice' or 'multiple_choice' - 'question': The text of the question. - 'description': Optional description of the question. - 'descriptionContentType': Content type of the description ('html' or 'text'). - 'optional': Whether the question is optional ('boolean'). - 'buttonText': Text displayed on the submit button. - 'choices': An array of choices for the question. - 'shuffleOptions': Whether to shuffle the order of the choices ('boolean'). - 'hasOpenChoice': Whether the question allows an open-ended response ('boolean'). - 'branching': Branching logic for the question. See branching types below for details. Branching logic can be one of the following types: Next question: Proceeds to the next question '''json { "type": "next_question" } ''' End: Ends the survey, optionally displaying a confirmation message. '''json { "type": "end" } ''' Response-based: Branches based on the response values. Available for the 'rating' and 'single_choice' question types. '''json { "type": "response_based", "responseValues": { "responseKey": "value" } } ''' Specific question: Proceeds to a specific question by index. '''json { "type": "specific_question", "index": 2 } ''' Translations: Each question can include inline translations. - 'translations': Object mapping language codes to translated fields. - Language codes: Any string - allows customers to use their own language keys (e.g., "es", "es-MX", "english", "french") - Translatable fields: 'question', 'description', 'buttonText', 'choices', 'lowerBoundLabel', 'upperBoundLabel', 'link' Example with translations: '''json { "id": "uuid", "type": "rating", "question": "How satisfied are you?", "lowerBoundLabel": "Not satisfied", "upperBoundLabel": "Very satisfied", "translations": { "es": { "question": "¿Qué tan satisfecho estás?", "lowerBoundLabel": "No satisfecho", "upperBoundLabel": "Muy satisfecho" }, "fr": { "question": "Dans quelle mesure êtes-vous satisfait?" } } } ''' responses_limit number optional The maximum number of responses before automatically stopping the survey. start_date string optional Setting this will launch the survey immediately. Don't add a start_date unless explicitly requested to do so. targeting_flag_filters object optional Target specific users based on their properties. Example: {groups: [{properties: [{key: 'email', value: ['@company.com'], operator: 'icontains'}], rollout_percentage: 100}]} type string required Survey type. * 'popover' - popover * 'widget' - widget * 'external_survey' - external survey * 'api' - api posthogmcp_survey_delete Delete a survey by ID (soft delete - marks as archived). 1 param
Delete a survey by ID (soft delete - marks as archived).
id string required A UUID string identifying this survey. posthogmcp_survey_get Get a specific survey by ID. Returns the survey configuration including questions, targeting, and scheduling details. 1 param
Get a specific survey by ID. Returns the survey configuration including questions, targeting, and scheduling details.
id string required A UUID string identifying this survey. posthogmcp_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. 3 params
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.
date_from string optional Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z) date_to string optional Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z) id string required A UUID string identifying this survey. posthogmcp_survey_update Update an existing survey by ID. Can update name, description, questions, scheduling, and other survey properties. 19 params
Update an existing survey by ID. Can update name, description, questions, scheduling, and other survey properties.
appearance object optional Survey appearance customization. archived boolean optional Archive state for the survey. conditions object optional Display and targeting conditions for the survey. description string optional Survey description. enable_partial_responses boolean optional When at least one question is answered, the response is stored (true). The response is stored when all questions are answered (false). end_date string optional When the survey stopped being shown to users. Setting this will complete the survey. id string required A UUID string identifying this survey. iteration_count number optional For a recurring schedule, this field specifies the number of times the survey should be shown to the user. Use 1 for 'once every X days', higher numbers for multiple repetitions. Works together with iteration_frequency_days to determine the overall survey schedule. iteration_frequency_days number optional For a recurring schedule, this field specifies the interval in days between each survey instance shown to the user, used alongside iteration_count for precise scheduling. linked_flag_id number optional The feature flag linked to this survey. name string optional Survey name. questions array optional The 'array' of questions included in the survey. Each question must conform to one of the defined question types: Basic, Link, Rating, or Multiple Choice. Basic (open-ended question) - 'id': The question ID - 'type': 'open' - 'question': The text of the question. - 'description': Optional description of the question. - 'descriptionContentType': Content type of the description ('html' or 'text'). - 'optional': Whether the question is optional ('boolean'). - 'buttonText': Text displayed on the submit button. - 'branching': Branching logic for the question. See branching types below for details. Link (a question with a link) - 'id': The question ID - 'type': 'link' - 'question': The text of the question. - 'description': Optional description of the question. - 'descriptionContentType': Content type of the description ('html' or 'text'). - 'optional': Whether the question is optional ('boolean'). - 'buttonText': Text displayed on the submit button. - 'link': The URL associated with the question. - 'branching': Branching logic for the question. See branching types below for details. Rating (a question with a rating scale) - 'id': The question ID - 'type': 'rating' - 'question': The text of the question. - 'description': Optional description of the question. - 'descriptionContentType': Content type of the description ('html' or 'text'). - 'optional': Whether the question is optional ('boolean'). - 'buttonText': Text displayed on the submit button. - 'display': Display style of the rating ('number' or 'emoji'). - 'scale': The scale of the rating ('number'). - 'lowerBoundLabel': Label for the lower bound of the scale. - 'upperBoundLabel': Label for the upper bound of the scale. - 'isNpsQuestion': Whether the question is an NPS rating. - 'branching': Branching logic for the question. See branching types below for details. Multiple choice - 'id': The question ID - 'type': 'single_choice' or 'multiple_choice' - 'question': The text of the question. - 'description': Optional description of the question. - 'descriptionContentType': Content type of the description ('html' or 'text'). - 'optional': Whether the question is optional ('boolean'). - 'buttonText': Text displayed on the submit button. - 'choices': An array of choices for the question. - 'shuffleOptions': Whether to shuffle the order of the choices ('boolean'). - 'hasOpenChoice': Whether the question allows an open-ended response ('boolean'). - 'branching': Branching logic for the question. See branching types below for details. Branching logic can be one of the following types: Next question: Proceeds to the next question '''json { "type": "next_question" } ''' End: Ends the survey, optionally displaying a confirmation message. '''json { "type": "end" } ''' Response-based: Branches based on the response values. Available for the 'rating' and 'single_choice' question types. '''json { "type": "response_based", "responseValues": { "responseKey": "value" } } ''' Specific question: Proceeds to a specific question by index. '''json { "type": "specific_question", "index": 2 } ''' Translations: Each question can include inline translations. - 'translations': Object mapping language codes to translated fields. - Language codes: Any string - allows customers to use their own language keys (e.g., "es", "es-MX", "english", "french") - Translatable fields: 'question', 'description', 'buttonText', 'choices', 'lowerBoundLabel', 'upperBoundLabel', 'link' Example with translations: '''json { "id": "uuid", "type": "rating", "question": "How satisfied are you?", "lowerBoundLabel": "Not satisfied", "upperBoundLabel": "Very satisfied", "translations": { "es": { "question": "¿Qué tan satisfecho estás?", "lowerBoundLabel": "No satisfecho", "upperBoundLabel": "Muy satisfecho" }, "fr": { "question": "Dans quelle mesure êtes-vous satisfait?" } } } ''' remove_targeting_flag boolean optional Set to true to completely remove all targeting filters from the survey, making it visible to all users (subject to other display conditions like URL matching). responses_limit number optional The maximum number of responses before automatically stopping the survey. schedule string optional Survey scheduling behavior: 'once' = show once per user (default), 'recurring' = repeat based on iteration_count and iteration_frequency_days settings, 'always' = show every time conditions are met (mainly for widget surveys) * 'once' - once * 'recurring' - recurring * 'always' - always start_date string optional Setting this will launch the survey immediately. Don't add a start_date unless explicitly requested to do so. targeting_flag_filters object optional Target specific users based on their properties. Example: {groups: [{properties: [{key: 'email', value: ['@company.com'], operator: 'icontains'}], rollout_percentage: 100}]} targeting_flag_id number optional An existing targeting flag to use for this survey. type string optional Survey type. * 'popover' - popover * 'widget' - widget * 'external_survey' - external survey * 'api' - api posthogmcp_surveys_get_all Get all surveys in the project with optional filtering. Can filter by search term or use pagination. 4 params
Get all surveys in the project with optional filtering. Can filter by search term or use pagination.
archived boolean optional Archived. limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. search string optional A search term. posthogmcp_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. 2 params
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.
date_from string optional Optional ISO timestamp for start date (e.g. 2024-01-01T00:00:00Z) date_to string optional Optional ISO timestamp for end date (e.g. 2024-01-31T23:59:59Z) posthogmcp_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. 1 param
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.
orgId string required Orgid. posthogmcp_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. 1 param
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.
projectId integer required Projectid. posthogmcp_update_feature_flag Update a feature flag by ID in the current project. 7 params
Update a feature flag by ID in the current project.
active boolean optional Whether the feature flag is active. evaluation_contexts array optional Evaluation contexts that control where this flag evaluates at runtime. filters object optional Feature flag targeting configuration. id number required A unique integer value identifying this feature flag. key string optional Feature flag key. name string optional Feature flag description (stored in the 'name' field for backwards compatibility). tags array optional Organizational tags for this feature flag. posthogmcp_view_create Create a new data warehouse saved query (view). If a view with the same name already exists, it will be updated instead (upsert behavior). The query must be valid HogQL. After creation, the view can be referenced by name in other HogQL queries. 5 params
Create a new data warehouse saved query (view). If a view with the same name already exists, it will be updated instead (upsert behavior). The query must be valid HogQL. After creation, the view can be referenced by name in other HogQL queries.
dag_id string optional Optional DAG to place this view into folder_id string optional Optional folder ID used to organize this view in the SQL editor sidebar. is_test boolean optional Whether this view is for testing only and will auto-expire. name string required Unique name for the view. Used as the table name in HogQL queries. Must not conflict with existing table names. query object optional HogQL query definition as a JSON object. Must contain a "query" key with the SQL string. Example: {"query": "SELECT * FROM events LIMIT 100"} posthogmcp_view_delete Delete a data warehouse saved query (view) by ID. This is a soft delete — the view is marked as deleted and will no longer appear in lists or be queryable in HogQL. Any materialization schedule is also removed. Cannot delete views that have downstream dependencies or views from managed viewsets. 1 param
Delete a data warehouse saved query (view) by ID. This is a soft delete — the view is marked as deleted and will no longer appear in lists or be queryable in HogQL. Any materialization schedule is also removed. Cannot delete views that have downstream dependencies or views from managed viewsets.
id string required A UUID string identifying this data warehouse saved query. posthogmcp_view_get Get a specific data warehouse saved query (view) by ID. Returns the full view definition including the HogQL query, column schema, materialization status, sync frequency, and run history metadata. 1 param
Get a specific data warehouse saved query (view) by ID. Returns the full view definition including the HogQL query, column schema, materialization status, sync frequency, and run history metadata.
id string required A UUID string identifying this data warehouse saved query. posthogmcp_view_list List all data warehouse saved queries (views) in the project. Returns each view's name, materialization status, sync frequency, column schema, latest error, and last run timestamp. Use this to discover available views before querying them in HogQL. 2 params
List all data warehouse saved queries (views) in the project. Returns each view's name, materialization status, sync frequency, column schema, latest error, and last run timestamp. Use this to discover available views before querying them in HogQL.
page number optional A page number within the paginated result set. search string optional A search term. posthogmcp_view_materialize Enable materialization for a saved query. This creates a physical table from the view's query and sets up a 24-hour sync schedule to keep it refreshed. Materialized views are faster to query but use storage. Use 'view-unmaterialize' to undo. Rate limited. 9 params
Enable materialization for a saved query. This creates a physical table from the view's query and sets up a 24-hour sync schedule to keep it refreshed. Materialized views are faster to query but use storage. Use 'view-unmaterialize' to undo. Rate limited.
dag_id string optional Optional DAG to place this view into deleted boolean optional Deleted. edited_history_id string optional Activity log ID from the last known edit. Used for conflict detection. folder_id string optional Optional folder ID used to organize this view in the SQL editor sidebar. id string required A UUID string identifying this data warehouse saved query. is_test boolean optional Whether this view is for testing only and will auto-expire. name string required Unique name for the view. Used as the table name in HogQL queries and the node name in the data modeling Node. query object optional HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key containing the query type. Example: {"query": "SELECT * FROM events LIMIT 100", "kind": "HogQLQuery"} soft_update boolean optional If true, skip column inference and validation. For saving drafts. posthogmcp_view_run Trigger a manual materialization run for a saved query. This immediately refreshes the materialized table with the latest data. The view must already be materialized. Use 'view-run-history' to check run status. 9 params
Trigger a manual materialization run for a saved query. This immediately refreshes the materialized table with the latest data. The view must already be materialized. Use 'view-run-history' to check run status.
dag_id string optional Optional DAG to place this view into deleted boolean optional Deleted. edited_history_id string optional Activity log ID from the last known edit. Used for conflict detection. folder_id string optional Optional folder ID used to organize this view in the SQL editor sidebar. id string required A UUID string identifying this data warehouse saved query. is_test boolean optional Whether this view is for testing only and will auto-expire. name string required Unique name for the view. Used as the table name in HogQL queries and the node name in the data modeling Node. query object optional HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key containing the query type. Example: {"query": "SELECT * FROM events LIMIT 100", "kind": "HogQLQuery"} soft_update boolean optional If true, skip column inference and validation. For saving drafts. posthogmcp_view_run_history Get the 5 most recent materialization run statuses for a saved query. Each entry includes the run status and timestamp. Use this to monitor whether materialization is running successfully. 1 param
Get the 5 most recent materialization run statuses for a saved query. Each entry includes the run status and timestamp. Use this to monitor whether materialization is running successfully.
id string required A UUID string identifying this data warehouse saved query. posthogmcp_view_unmaterialize Undo materialization for a saved query. Deletes the materialized table and removes the sync schedule, reverting the view back to a virtual query that runs on each access. The view definition itself is preserved. Rate limited. 9 params
Undo materialization for a saved query. Deletes the materialized table and removes the sync schedule, reverting the view back to a virtual query that runs on each access. The view definition itself is preserved. Rate limited.
dag_id string optional Optional DAG to place this view into deleted boolean optional Deleted. edited_history_id string optional Activity log ID from the last known edit. Used for conflict detection. folder_id string optional Optional folder ID used to organize this view in the SQL editor sidebar. id string required A UUID string identifying this data warehouse saved query. is_test boolean optional Whether this view is for testing only and will auto-expire. name string required Unique name for the view. Used as the table name in HogQL queries and the node name in the data modeling Node. query object optional HogQL query definition as a JSON object with a "query" key containing the SQL string and a "kind" key containing the query type. Example: {"query": "SELECT * FROM events LIMIT 100", "kind": "HogQLQuery"} soft_update boolean optional If true, skip column inference and validation. For saving drafts. posthogmcp_view_update Update an existing data warehouse saved query (view). Can change the name, HogQL query, or sync frequency. Changing the query triggers column re-inference and sets the status to 'modified'. Use sync_frequency to control materialization schedule: '24hour', '12hour', '6hour', '1hour', '30min', or 'never'. IMPORTANT: when updating the query field, you must first retrieve the view to get its latest_history_id, then pass that value as edited_history_id for conflict detection. 7 params
Update an existing data warehouse saved query (view). Can change the name, HogQL query, or sync frequency. Changing the query triggers column re-inference and sets the status to 'modified'. Use sync_frequency to control materialization schedule: '24hour', '12hour', '6hour', '1hour', '30min', or 'never'. IMPORTANT: when updating the query field, you must first retrieve the view to get its latest_history_id, then pass that value as edited_history_id for conflict detection.
dag_id string optional Optional DAG to place this view into edited_history_id string optional Required when updating the query field. Get this from latest_history_id on the retrieve response. Used for optimistic concurrency control. folder_id string optional Optional folder ID used to organize this view in the SQL editor sidebar. id string required A UUID string identifying this data warehouse saved query. is_test boolean optional Whether this view is for testing only and will auto-expire. name string optional Unique name for the view. Used as the table name in HogQL queries. Must not conflict with existing table names. query object optional HogQL query definition as a JSON object. Must contain a "query" key with the SQL string. Example: {"query": "SELECT * FROM events LIMIT 100"} posthogmcp_workflows_get Get a specific workflow by ID. Returns the full workflow definition including trigger, edges, actions, exit condition, and variables. 1 param
Get a specific workflow by ID. Returns the full workflow definition including trigger, edges, actions, exit condition, and variables.
id string required A UUID string identifying this hog flow. posthogmcp_workflows_list List all workflows in the project. Returns workflows with their name, description, status (draft/active/archived), version, trigger configuration, and timestamps. 6 params
List all workflows in the project. Returns workflows with their name, description, status (draft/active/archived), version, trigger configuration, and timestamps.
created_at string optional Created at. created_by number optional Created by. id string optional Id. limit number optional Number of results to return per page. offset number optional The initial index from which to return the results. updated_at string optional Updated at.