Capture events, manage feature flags, and run experiments in PostHog — AI-driven product analytics and A/B testing.
Use with AI AssistantsMCP
Connect Claude, Cursor, or any MCP-compatible client — then call tools directly
① Add This MCP Server
Paste into your AI client config — then all its tools are available instantly.
{
"mcpServers": {
"posthog": {
"url": "https://mcp.aerostack.dev/s/aerostack/mcp-posthog",
"headers": {
"Authorization": "Bearer YOUR_AEROSTACK_TOKEN"
}
}
}
}Replace YOUR_AEROSTACK_TOKEN with your API token from the dashboard.
② Call a Tool
Ask your AI assistant to call a specific tool, or send raw JSON-RPC:
Natural Language Prompt
“Use the _ping tool to verify posthog credentials by calling a lightweight read endpoint. used internally by aerostack to validate credentials”
Using a Workspace?
Add this MCP to your Workspace — your team shares one token, secrets are stored securely, and every AI agent in the workspace can call it without per-user setup.
Capture events, evaluate feature flags, manage cohorts, and query analytics from your AI agents.
PostHog is the open-source product analytics suite with built-in feature flags, A/B testing, and session recording. This MCP server lets your AI agents capture analytics events from server-side workflows, evaluate which feature flags are active for a user, and query insights, cohorts, and experiments — turning PostHog into a live data source for intelligent product workflows.
Live endpoint: https://mcp.aerostack.dev/s/aerostack/mcp-posthog
| Tool | Description |
|---|---|
capture_event | Capture a custom analytics event for a user |
identify_user | Identify a user and set their properties |
get_feature_flags | Evaluate which feature flags are active for a user |
list_persons | List persons with optional email or name search |
get_person | Get full details for a person by ID |
list_feature_flags | List all feature flags (optionally filter by active status) |
get_insights | List insights reports (TRENDS, FUNNELS, RETENTION, PATHS) |
list_cohorts | List all cohorts with member counts |
get_experiments | List all A/B experiments and their variants |
| Variable | Required | Description | How to Get |
|---|---|---|---|
POSTHOG_API_KEY | Yes | Personal API key for REST API access | app.posthog.com → Settings → Personal API Keys → Create personal API key |
POSTHOG_PROJECT_ID | Yes | Numeric project ID | app.posthog.com → Your Project → Settings → Project → copy Project ID |
POSTHOG_PROJECT_API_KEY | Yes | Project API key for event capture (starts with phc_) | app.posthog.com → Your Project → Settings → Project → copy Project API Key |
Once added, every AI agent in your workspace can call PostHog tools automatically — no per-user setup needed.
"Check which feature flags are enabled for user distinct_id_12345"
"List all active A/B experiments and their current variant assignments"
"Capture a subscription_upgraded event for user u_98765 with property plan: enterprise"
curl -X POST https://mcp.aerostack.dev/s/aerostack/mcp-posthog \
-H 'Content-Type: application/json' \
-H 'X-Mcp-Secret-POSTHOG-API-KEY: your-personal-api-key' \
-H 'X-Mcp-Secret-POSTHOG-PROJECT-ID: 12345' \
-H 'X-Mcp-Secret-POSTHOG-PROJECT-API-KEY: phc_yourprojectkey' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_feature_flags","arguments":{}}}'
MIT
Live Endpoint
https://mcp.aerostack.dev/s/aerostack/mcp-posthog
Sub-50ms globally · Zero cold start
@aerostack
Pre-built functions for the most common MCP tool patterns. Clone, extend, and deploy.
by @aerostack
Discover and invoke any MCP, Function, or Skill published to the Aerostack marketplace — the universal AI capability hub.
by @aerostack
Search indexes, manage records, browse data, and configure ranking in Algolia — AI-native instant search access.
by @aerostack
Query documents, run AQL, traverse graphs, and manage collections in your ArangoDB database — AI-native multi-model database access.
by @aerostack
Post, schedule, and analyze social media across 13 platforms — Facebook, Instagram, X, LinkedIn, TikTok, Bluesky, Threads, Reddit, Pinterest, YouTube, Telegram, Snapchat, Google Business.
by @aerostack
Manage projects, to-dos, messages, schedules, and campfire chats in Basecamp — AI-native project management.
by @aerostack
Run SQL queries, list datasets and tables, inspect schemas, and export results from Google BigQuery — AI-native data warehouse access.
Yes. Use capture_event to log any custom action and identify_user to associate it with a profile. Claude can build full event pipelines without touching your codebase directly.
Call get_feature_flags with a distinct_id. Claude returns the flag keys and their evaluated values, letting you gate features or debug why a flag isn't rolling out as expected.
Yes. get_experiments returns all A/B tests with their status, variants, and metrics. Claude can summarize conversion differences between control and test groups in plain language.
list_cohorts returns all saved cohorts. Combine with list_persons to inspect membership. Claude can cross-reference cohort data with get_insights to build targeted analysis.