PostHog Automation via Rube MCP
Automate PostHog product analytics and feature flag management through Composio's PostHog toolkit via Rube MCP.
Prerequisites
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active PostHog connection via
RUBE_MANAGE_CONNECTIONS with toolkit posthog
- Always call
RUBE_SEARCH_TOOLS first to get current tool schemas
Setup
Get Rube MCP: Add https://rube.app/mcp as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
- Verify Rube MCP is available by confirming
RUBE_SEARCH_TOOLS responds
- Call
RUBE_MANAGE_CONNECTIONS with toolkit posthog
- If connection is not ACTIVE, follow the returned auth link to complete PostHog authentication
- Confirm connection status shows ACTIVE before running any workflows
Core Workflows
1. Capture Events
When to use: User wants to send event data to PostHog for analytics tracking
Tool sequence:
POSTHOG_CAPTURE_EVENT - Send one or more events to PostHog [Required]
Key parameters:
event: Event name (e.g., '$pageview', 'user_signed_up', 'purchase_completed')
distinct_id: Unique user identifier (required)
properties: Object with event-specific properties
timestamp: ISO 8601 timestamp (optional; defaults to server time)
Pitfalls:
distinct_id is required for every event; identifies the user/device
- PostHog system events use
$ prefix (e.g., '$pageview', '$identify')
- Custom events should NOT use the
$ prefix
- Properties are freeform; maintain consistent schemas across events
- Events are processed asynchronously; ingestion delay is typically seconds
2. List and Filter Events
When to use: User wants to browse or search through captured events
Tool sequence:
POSTHOG_LIST_AND_FILTER_PROJECT_EVENTS - Query events with filters [Required]
Key parameters:
project_id: PostHog project ID (required)
event: Filter by event name
person_id: Filter by person ID
after: Events after this ISO 8601 timestamp
before: Events before this ISO 8601 timestamp
limit: Maximum events to return
offset: Pagination offset
Pitfalls:
project_id is required; resolve via LIST_PROJECTS first
- Date filters use ISO 8601 format (e.g., '2024-01-15T00:00:00Z')
- Large event volumes require pagination; use
offset and limit
- Results are returned in reverse chronological order by default
- Event properties are nested; parse carefully
3. Manage Feature Flags
When to use: User wants to create, view, or manage feature flags
Tool sequence:
POSTHOG_LIST_AND_MANAGE_PROJECT_FEATURE_FLAGS - List existing feature flags [Required]
POSTHOG_RETRIEVE_FEATURE_FLAG_DETAILS - Get detailed flag configuration [Optional]
POSTHOG_CREATE_FEATURE_FLAGS_FOR_PROJECT - Create a new feature flag [Optional]
Key parameters:
- For listing:
project_id (required)
- For details:
project_id, id (feature flag ID)
- For creation:
project_id: Target project
key: Flag key (e.g., 'new-dashboard-beta')
name: Human-readable name
filters: Targeting rules and rollout percentage
active: Whether the flag is enabled
Pitfalls:
- Feature flag
key must be unique within a project
- Flag keys should use kebab-case (e.g., 'my-feature-flag')
filters define targeting groups with properties and rollout percentages
- Creating a flag with
active: true immediately enables it for matching users
- Flag changes take effect within seconds due to PostHog's polling mechanism
4. Manage Projects
When to use: User wants to list or inspect PostHog projects and organizations
Tool sequence:
POSTHOG_LIST_PROJECTS_IN_ORGANIZATION_WITH_PAGINATION - List all projects [Required]
Key parameters:
organization_id: Organization identifier (may be optional depending on auth)
limit: Number of results per page
offset: Pagination offset
Pitfalls:
- Project IDs are numeric; used as parameters in most other endpoints
- Organization ID may be required; check your PostHog setup
- Pagination is offset-based; iterate until results are empty
- Project settings include API keys and configuration details
5. User Profile and Authentication
When to use: User wants to check current user details or verify API access
Tool sequence:
POSTHOG_WHOAMI - Get current API user information [Optional]
POSTHOG_RETRIEVE_CURRENT_USER_PROFILE - Get detailed user profile [Optional]
Key parameters:
- No required parameters for either call
- Returns current authenticated user's details, permissions, and organization info
Pitfalls:
- WHOAMI is a lightweight check; use for verifying API connectivity
- User profile includes organization membership and permissions
- These endpoints confirm the API key's access level and scope
Common Patterns
ID Resolution
Organization -> Project ID:
1. Call POSTHOG_LIST_PROJECTS_IN_ORGANIZATION_WITH_PAGINATION
2. Find project by name in results
3. Extract id (numeric) for use in other endpoints
Feature flag name -> Flag ID:
1. Call POSTHOG_LIST_AND_MANAGE_PROJECT_FEATURE_FLAGS with project_id
2. Find flag by key or name
3. Extract id for detailed operations
Feature Flag Targeting
Feature flags support sophisticated targeting:
{
"filters": {
"groups": [
{
"properties": [
{"key": "email", "value": "@company.com", "operator": "icontains"}
],
"rollout_percentage": 100
},
{
"properties": [],
"rollout_percentage": 10
}
]
}
}
- Groups are evaluated in order; first matching group determines the rollout
- Properties filter users by their traits
- Rollout percentage determines what fraction of matching users see the flag
Pagination
- Events: Use
offset and limit (offset-based)
- Feature flags: Use
offset and limit (offset-based)
- Projects: Use
offset and limit (offset-based)
- Continue until results array is empty or smaller than
limit
Known Pitfalls
Project IDs:
- Required for most API endpoints
- Always resolve project names to numeric IDs first
- Multiple projects can exist in one organization
Event Naming:
- System events use
$ prefix ($pageview, $identify, $autocapture)
- Custom events should NOT use
$ prefix
- Event names are case-sensitive; maintain consistency
Feature Flags:
- Flag keys must be unique within a project
- Use kebab-case for flag keys
- Changes propagate within seconds
- Deleting a flag is permanent; consider disabling instead
Rate Limits:
- Event ingestion has throughput limits
- Batch events where possible for efficiency
- API endpoints have per-minute rate limits
Response Parsing:
- Response data may be nested under
data or results key
- Paginated responses include
count, next, previous fields
- Event properties are nested objects; access carefully
- Parse defensively with fallbacks for optional fields
Quick Reference
| Task |
Tool Slug |
Key Params |
| Capture event |
POSTHOG_CAPTURE_EVENT |
event, distinct_id, properties |
| List events |
POSTHOG_LIST_AND_FILTER_PROJECT_EVENTS |
project_id, event, after, before |
| List feature flags |
POSTHOG_LIST_AND_MANAGE_PROJECT_FEATURE_FLAGS |
project_id |
| Get flag details |
POSTHOG_RETRIEVE_FEATURE_FLAG_DETAILS |
project_id, id |
| Create flag |
POSTHOG_CREATE_FEATURE_FLAGS_FOR_PROJECT |
project_id, key, filters |
| List projects |
POSTHOG_LIST_PROJECTS_IN_ORGANIZATION_WITH_PAGINATION |
organization_id |
| Who am I |
POSTHOG_WHOAMI |
(none) |
| User profile |
POSTHOG_RETRIEVE_CURRENT_USER_PROFILE |
(none) |
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: posthog-automation3description: "Automate PostHog tasks via Rube MCP (Composio): events, feature flags, projects, user profiles, annotations. Always search tools first for current schemas."4version: 1.0.05author:6 name: "sickn33 / Antigravity Community"7 github: sickn338tags: [posthog, automation, data]9category: data10platforms: [macos, linux, windows]11license: MIT12metadata:13 hermes:14 source: https://skillmd.com/skills/nous-hermeshub/posthog-automation15 upstream: "antigravity-awesome-skills"16 risk: "critical"17 date_added: "2026-02-27"18 original_author: "Antigravity Community"19---2021# PostHog Automation via Rube MCP2223Automate PostHog product analytics and feature flag management through Composio's PostHog toolkit via Rube MCP.2425## Prerequisites2627- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)28- Active PostHog connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `posthog`29- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas3031## Setup3233**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.3435361. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds372. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `posthog`383. If connection is not ACTIVE, follow the returned auth link to complete PostHog authentication394. Confirm connection status shows ACTIVE before running any workflows4041## Core Workflows4243### 1. Capture Events4445**When to use**: User wants to send event data to PostHog for analytics tracking4647**Tool sequence**:481. `POSTHOG_CAPTURE_EVENT` - Send one or more events to PostHog [Required]4950**Key parameters**:51- `event`: Event name (e.g., '$pageview', 'user_signed_up', 'purchase_completed')52- `distinct_id`: Unique user identifier (required)53- `properties`: Object with event-specific properties54- `timestamp`: ISO 8601 timestamp (optional; defaults to server time)5556**Pitfalls**:57- `distinct_id` is required for every event; identifies the user/device58- PostHog system events use `$` prefix (e.g., '$pageview', '$identify')59- Custom events should NOT use the `$` prefix60- Properties are freeform; maintain consistent schemas across events61- Events are processed asynchronously; ingestion delay is typically seconds6263### 2. List and Filter Events6465**When to use**: User wants to browse or search through captured events6667**Tool sequence**:681. `POSTHOG_LIST_AND_FILTER_PROJECT_EVENTS` - Query events with filters [Required]6970**Key parameters**:71- `project_id`: PostHog project ID (required)72- `event`: Filter by event name73- `person_id`: Filter by person ID74- `after`: Events after this ISO 8601 timestamp75- `before`: Events before this ISO 8601 timestamp76- `limit`: Maximum events to return77- `offset`: Pagination offset7879**Pitfalls**:80- `project_id` is required; resolve via LIST_PROJECTS first81- Date filters use ISO 8601 format (e.g., '2024-01-15T00:00:00Z')82- Large event volumes require pagination; use `offset` and `limit`83- Results are returned in reverse chronological order by default84- Event properties are nested; parse carefully8586### 3. Manage Feature Flags8788**When to use**: User wants to create, view, or manage feature flags8990**Tool sequence**:911. `POSTHOG_LIST_AND_MANAGE_PROJECT_FEATURE_FLAGS` - List existing feature flags [Required]922. `POSTHOG_RETRIEVE_FEATURE_FLAG_DETAILS` - Get detailed flag configuration [Optional]933. `POSTHOG_CREATE_FEATURE_FLAGS_FOR_PROJECT` - Create a new feature flag [Optional]9495**Key parameters**:96- For listing: `project_id` (required)97- For details: `project_id`, `id` (feature flag ID)98- For creation:99 - `project_id`: Target project100 - `key`: Flag key (e.g., 'new-dashboard-beta')101 - `name`: Human-readable name102 - `filters`: Targeting rules and rollout percentage103 - `active`: Whether the flag is enabled104105**Pitfalls**:106- Feature flag `key` must be unique within a project107- Flag keys should use kebab-case (e.g., 'my-feature-flag')108- `filters` define targeting groups with properties and rollout percentages109- Creating a flag with `active: true` immediately enables it for matching users110- Flag changes take effect within seconds due to PostHog's polling mechanism111112### 4. Manage Projects113114**When to use**: User wants to list or inspect PostHog projects and organizations115116**Tool sequence**:1171. `POSTHOG_LIST_PROJECTS_IN_ORGANIZATION_WITH_PAGINATION` - List all projects [Required]118119**Key parameters**:120- `organization_id`: Organization identifier (may be optional depending on auth)121- `limit`: Number of results per page122- `offset`: Pagination offset123124**Pitfalls**:125- Project IDs are numeric; used as parameters in most other endpoints126- Organization ID may be required; check your PostHog setup127- Pagination is offset-based; iterate until results are empty128- Project settings include API keys and configuration details129130### 5. User Profile and Authentication131132**When to use**: User wants to check current user details or verify API access133134**Tool sequence**:1351. `POSTHOG_WHOAMI` - Get current API user information [Optional]1362. `POSTHOG_RETRIEVE_CURRENT_USER_PROFILE` - Get detailed user profile [Optional]137138**Key parameters**:139- No required parameters for either call140- Returns current authenticated user's details, permissions, and organization info141142**Pitfalls**:143- WHOAMI is a lightweight check; use for verifying API connectivity144- User profile includes organization membership and permissions145- These endpoints confirm the API key's access level and scope146147## Common Patterns148149### ID Resolution150151**Organization -> Project ID**:152```1531. Call POSTHOG_LIST_PROJECTS_IN_ORGANIZATION_WITH_PAGINATION1542. Find project by name in results1553. Extract id (numeric) for use in other endpoints156```157158**Feature flag name -> Flag ID**:159```1601. Call POSTHOG_LIST_AND_MANAGE_PROJECT_FEATURE_FLAGS with project_id1612. Find flag by key or name1623. Extract id for detailed operations163```164165### Feature Flag Targeting166167Feature flags support sophisticated targeting:168```json169{170 "filters": {171 "groups": [172 {173 "properties": [174 {"key": "email", "value": "@company.com", "operator": "icontains"}175 ],176 "rollout_percentage": 100177 },178 {179 "properties": [],180 "rollout_percentage": 10181 }182 ]183 }184}185```186- Groups are evaluated in order; first matching group determines the rollout187- Properties filter users by their traits188- Rollout percentage determines what fraction of matching users see the flag189190### Pagination191192- Events: Use `offset` and `limit` (offset-based)193- Feature flags: Use `offset` and `limit` (offset-based)194- Projects: Use `offset` and `limit` (offset-based)195- Continue until results array is empty or smaller than `limit`196197## Known Pitfalls198199**Project IDs**:200- Required for most API endpoints201- Always resolve project names to numeric IDs first202- Multiple projects can exist in one organization203204**Event Naming**:205- System events use `$` prefix ($pageview, $identify, $autocapture)206- Custom events should NOT use `$` prefix207- Event names are case-sensitive; maintain consistency208209**Feature Flags**:210- Flag keys must be unique within a project211- Use kebab-case for flag keys212- Changes propagate within seconds213- Deleting a flag is permanent; consider disabling instead214215**Rate Limits**:216- Event ingestion has throughput limits217- Batch events where possible for efficiency218- API endpoints have per-minute rate limits219220**Response Parsing**:221- Response data may be nested under `data` or `results` key222- Paginated responses include `count`, `next`, `previous` fields223- Event properties are nested objects; access carefully224- Parse defensively with fallbacks for optional fields225226## Quick Reference227228| Task | Tool Slug | Key Params |229|------|-----------|------------|230| Capture event | POSTHOG_CAPTURE_EVENT | event, distinct_id, properties |231| List events | POSTHOG_LIST_AND_FILTER_PROJECT_EVENTS | project_id, event, after, before |232| List feature flags | POSTHOG_LIST_AND_MANAGE_PROJECT_FEATURE_FLAGS | project_id |233| Get flag details | POSTHOG_RETRIEVE_FEATURE_FLAG_DETAILS | project_id, id |234| Create flag | POSTHOG_CREATE_FEATURE_FLAGS_FOR_PROJECT | project_id, key, filters |235| List projects | POSTHOG_LIST_PROJECTS_IN_ORGANIZATION_WITH_PAGINATION | organization_id |236| Who am I | POSTHOG_WHOAMI | (none) |237| User profile | POSTHOG_RETRIEVE_CURRENT_USER_PROFILE | (none) |238239## When to Use240This skill is applicable to execute the workflow or actions described in the overview.241242## Limitations243- Use this skill only when the task clearly matches the scope described above.244- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.245- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.