Connect Posthog to AI agents

Connect Posthog to Claude, Codex, Cursor, or other AI agents for your entire team. Metorial security, governance, observability, and gives your team a unified Magic MCP url to connect.

Supported Tools

create_experiment

Create Experiment

Create a new A/B test experiment. Experiments run on top of feature flags. The feature flag must be implemented in your code first.

list_session_recordings

List Session Recordings

List session recording metadata. Supports filtering by person, date range, and pagination. Note: This returns metadata only, not the raw replay data. Use the PostHog UI to view full replays.

list_insights

List Insights

List analytics insights (trends, funnels, retention, paths, stickiness, lifecycle). Supports searching by name and filtering to saved insights only.

list_property_definitions

List Property Definitions

List all property definitions in the project. Property definitions describe the possible properties that can be attached to events or persons. Use this to discover available properties for filtering, grouping, and analysis.

list_cohorts

List Cohorts

List all cohorts in the project. Cohorts are groups of users that match specific criteria. Static cohorts are manually managed lists, while dynamic cohorts are automatically updated every 24 hours.

capture_event

Capture Event

Send one or more events to PostHog. Supports single event capture or batch capture of multiple events. Use this to track pageviews, custom events, screen views, identify users (`$identify`), create aliases (`$create_alias`), or send any custom event. Person properties can be set or updated via the `set` and `setOnce` fields.

get_feature_flag

Get Feature Flag

Retrieve detailed information about a specific feature flag by its ID.

get_experiment

Get Experiment

Retrieve detailed information about a specific A/B test experiment including its configuration, metrics, and results.

delete_feature_flag

Delete Feature Flag

Permanently delete a feature flag. This cannot be undone.

delete_survey

Delete Survey

Permanently delete a survey.

get_insight

Get Insight

Retrieve detailed information and results for a specific insight by its ID.

create_dashboard

Create Dashboard

Create a new dashboard for organizing insights and analytics visualizations.

list_projects

List Projects

List projects accessible with the current credentials. Provide organizationId to use PostHog's current organization-scoped project endpoint.

list_event_definitions

List Event Definitions

List all event definitions in the project. Event definitions describe the possible event names that have been captured. Use this to discover which events are available for querying, filtering, and analysis.

list_persons

List Persons

Search and list person profiles in PostHog. Supports filtering by search query and person properties. Returns paginated results with person details including distinct IDs and properties.

delete_annotation

Delete Annotation

Delete an annotation from charts/dashboards.

create_cohort

Create Cohort

Create a new cohort. Static cohorts are manually managed user lists; dynamic cohorts automatically include users matching specified criteria.

update_dashboard

Update Dashboard

Update an existing dashboard's name, description, pinned status, or tags.

update_experiment

Update Experiment

Update an existing A/B test experiment's name, description, dates, or configuration. Only provided fields will be updated.

delete_dashboard

Delete Dashboard

Permanently delete a dashboard.

get_dashboard

Get Dashboard

Retrieve detailed information about a specific dashboard by its ID, including its tiles and configuration.

update_survey

Update Survey

Update an existing survey's name, description, questions, targeting, or dates. Only provided fields will be updated.

list_feature_flags

List Feature Flags

List all feature flags in the project. Supports searching by flag key or name. Returns flag configuration including key, active status, rollout percentage, and targeting rules.

get_session_recording

Get Session Recording

Retrieve metadata about a specific session recording by its ID. Returns timing, activity metrics, and user information. Does not include the raw replay JSON.

create_survey

Create Survey

Create a new survey with questions and optional targeting. Surveys can be of various types (e.g. popover) and can be linked to feature flags.

list_annotations

List Annotations

List annotations on charts/dashboards. Annotations mark significant events or deployments with text notes at specific dates.

create_annotation

Create Annotation

Create a new annotation to mark a significant event or deployment on PostHog charts and dashboards.

evaluate_feature_flags

Evaluate Feature Flags

Evaluate all feature flags for a specific user (distinct ID). Returns the computed flag values based on the user's properties and targeting rules. Optionally pass person properties and group properties inline for server-side evaluation without requiring prior identification.

update_feature_flag

Update Feature Flag

Update an existing feature flag's name, active status, rollout percentage, or targeting configuration. Only provided fields will be updated.

get_person

Get Person

Retrieve detailed information about a specific person by their PostHog person ID. Returns the person's distinct IDs, all properties, and creation timestamp.

get_survey

Get Survey

Retrieve detailed information about a specific survey by its ID, including questions, targeting, and status.

create_feature_flag

Create Feature Flag

Create a new feature flag. Supports boolean flags, multivariate flags (for A/B test variants), and remote config flags. Provide the key, name, and optionally configure rollout percentage and targeting filters.

list_experiments

List Experiments

List A/B test experiments in the project. Returns experiment metadata, status, and associated feature flag keys.

get_cohort

Get Cohort

Retrieve detailed information about a specific cohort by its ID.

list_surveys

List Surveys

List all surveys in the project with their configuration, questions, and status.

list_dashboards

List Dashboards

List all dashboards in the project. Supports searching by name.

run_query

Run HogQL Query

Execute an ad-hoc HogQL query against your PostHog data. HogQL is PostHog's SQL-like query language that supports querying events, persons, sessions, and more. Use this for custom analytics queries, aggregations, and data exploration that go beyond predefined insights.

delete_person

Delete Person

Permanently delete a person profile from PostHog. This removes the person and all their associated data. To create or update persons, use the Capture Event tool with `$identify` event and `set`/`setOnce` properties instead.

get_annotation

Get Annotation

Retrieve a specific PostHog annotation by ID.

update_group_property

Update Group Property

Set or update properties for a PostHog group.

create_action

Create Action

Create a PostHog action from event, selector, URL, or property matching steps.

create_group

Create Group

Create or update a PostHog group for a configured group type.

delete_cohort

Delete Cohort

Permanently delete a cohort from PostHog.

delete_action

Delete Action

Delete a PostHog action.

get_action

Get Action

Retrieve a specific PostHog action by ID, including its step rules.

list_actions

List Actions

List PostHog actions. Actions group one or more event patterns into reusable analytics definitions.

list_group_types

List Group Types

List configured PostHog group types. Use the returned groupTypeIndex with group list/find/update tools.

update_annotation

Update Annotation

Update an annotation's content, date marker, or scope.

list_groups

List Groups

List groups for a specific PostHog group type. Uses PostHog's forward-only cursor pagination.

update_cohort

Update Cohort

Update an existing cohort's name, description, static state, or filter groups.

get_current_user

Get Current User

Retrieve the current PostHog user, current organization, and current team/project context.

delete_experiment

Delete Experiment

Permanently delete an experiment from PostHog.

delete_group_property

Delete Group Property

Delete one or more properties from a PostHog group.

update_action

Update Action

Update a PostHog action's metadata, tags, deletion state, or step rules.

list_organizations

List Organizations

List PostHog organizations accessible with the current credentials. Use an organization ID with List Projects for the current documented project API.

find_group

Find Group

Find a specific PostHog group by group type index and group key.

More integrations teams use with Posthog

GitHub

Manage repositories, issues, and pull requests. Create and configure branches, star repositories, review code, and merge changes. Automate CI/CD workflows with GitHub Actions, manage workflow runs, secrets, and artifacts. Track issues with labels, milestones, and assignees. Search across code, repositories, issues, and users. Manage organizations, teams, and memberships. Create and manage projects, gists, packages, deployments, and environments. Access security alerts including code scanning, secret scanning, and Dependabot alerts. Read and write file contents in repositories. Manage webhooks, notifications, and codespaces.

Sharepoint

Manage SharePoint sites, document libraries, lists, and files. Create, read, update, and delete lists and list items with custom columns. Upload, download, move, copy, and version files in document libraries. Search across sites, files, folders, lists, and list items using Microsoft Search. Manage permissions at site, list, and item levels with granular access control. Define and manage content types and site columns. Subscribe to webhooks for list and library change notifications. Retrieve site properties and search for sites across Microsoft 365.

Salesforce

Manage CRM data including Accounts, Contacts, Leads, Opportunities, Cases, and custom objects. Create, read, update, and delete records. Query data using SOQL and search across objects using SOSL. Perform bulk data operations for large-scale imports, exports, and migrations. Execute composite requests to batch multiple operations in a single API call. Access analytics, reports, and dashboards. Manage files and attachments associated with records. Interact with Chatter feeds, posts, and groups for social collaboration. Subscribe to real-time change events via Change Data Capture and Platform Events. Manage org metadata including custom objects, fields, layouts, and workflows. Query data using GraphQL for precise data retrieval across related objects.

Airtable

Create, read, update, and delete records in Airtable bases and tables. Manage base schemas including creating tables and fields. Filter records using formulas, sort by fields, and scope queries to specific views. Upsert records to find, create, or update in a single call. Upload attachments to records, read and write record comments, list accessible bases, and receive real-time base change events through webhooks.

Bitbucket

Manage Git repositories, pull requests, and CI/CD pipelines on Bitbucket Cloud. Create, fork, and configure repositories within workspaces and projects. Create, review, approve, merge, and decline pull requests with inline code comments. Browse source code, list commits, and manage branches and tags. Track issues with the built-in issue tracker. Trigger, monitor, and manage Bitbucket Pipelines. List workspace members, configure repository default reviewers and branch restrictions, create and manage repository webhooks, and search code across repositories.

Heroku

Deploy, manage, and scale applications on Heroku's cloud platform. Create and configure apps, scale dynos, provision add-ons (databases, caching, etc.), manage configuration variables, build and release code, add custom domains and SSL certificates, manage collaborators and team permissions, configure pipelines for continuous delivery, set up log drains, and sync data with Salesforce via Heroku Connect. Subscribe to webhooks for real-time notifications on app changes, builds, releases, dyno lifecycle events, and more.

Technical notes for Posthog

Capture and analyze product usage events, manage feature flags, run A/B test experiments, and create user surveys. Track persons and groups, evaluate feature flags for specific users, query analytics data using HogQL, and manage cohorts. Retrieve session recording metadata, create and manage insights and dashboards (trends, funnels, retention, paths). Manage projects, organizations, annotations, actions, and event/property definitions.

Connect Posthog to production AI agents

See how Metorial gives Posthog access the governance, tracing, and security controls teams need.

Frequently asked questions

Common questions about connecting Posthog to AI agents with Metorial.

  1. Can Metorial connect Posthog to AI agents?
    Yes. Metorial connects AI agents to Posthog through a governed integration layer, so teams can use the provider while keeping access controlled and observable.
  2. Metorial is MCP compatible and lets teams expose approved provider tools to MCP-capable agents and clients through a controlled access layer.
  3. Metorial applies policies across users, groups, providers, agents, and individual tools, then records the context around every agent interaction.
  4. Yes. Metorial records provider activity so teams can inspect tool calls, troubleshoot integrations, and give security teams the visibility they need.