Posthog MCP server
MCP server for PostHog — product analytics for AI assistants. Query events, persons, insights, da...
0 stars52 downloads/wk
Reviews
Write oneNobody has reviewed Posthog yet.
If you have run it, two minutes of your experience saves the next person an afternoon.
Posthog tools (13, 1 write)
write = sends, deletes, buys or postsRead from the package source without running it. The installed server may list more.
evaluate_feature_flagEvaluate a feature flag for a specific user. Returns whether the flag is enabled and its variant value.
execute_insightwrite actionExecute a saved PostHog insight by ID and return the results. Use list_dashboards to find insight IDs, or pass a raw insight definition.
get_dashboardGet a specific PostHog dashboard by ID, including its insights and widgets.
get_experimentGet detailed results for a specific PostHog experiment, including variants, metrics, and statistical significance.
get_personGet a PostHog person (user) by their distinct_id. Returns person properties, creation date, and event count.
get_project_infoGet basic information about the PostHog project — name, ID, created date, and available features.
list_actionsList PostHog event actions (custom event definitions). Shows name, steps, and creation date.
list_cohortsList all PostHog cohorts in the project. Shows name, type, person count, and creation date.
list_dashboardsList all PostHog dashboards in the project. Returns dashboard names, IDs, and widget counts.
list_eventsQuery events from PostHog. Filter by event name, person, date range, and properties. Returns recent events matching your criteria.
list_experimentsList all PostHog experiments (A/B tests) in the project. Shows name, status, and key results.
list_feature_flagsList all PostHog feature flags in the project. Shows name, key, active status, and rollout percentage.
list_personsList PostHog persons (users). Search by name or distinct_id, with pagination.
Public scan report
scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it
- Code scan5 source files scanned25/25
- –Live reliabilityno gateway calls yet and no remote to proben/a
- –Tool poisoningtools not inspected (local package is not executed); not countedn/a
- Auth qualitylocal package, no credentials required12/15
- Maintenancerepository archived0/15
- Maintainer identityregistry namespace matches repository owner6/10
Findings (1)
- highRepository is archived
maint.archived
How Posthog compares
Against every graded E-commerce MCP server, from our own scans and uptime checks. Updated after each scan run.
- Safety score
- 66/100
- higher than 28% of 2,174 E-commerce servers
- Tools
- 13
- the typical E-commerce server has 6
- Tools that change things
- 8%
- typical: 0%. Fewer write tools means less an agent can break
- Downloads a week
- 52
- more than 50% of 411 E-commerce servers with a package
What its tools let an agent do: 11 read · 2 run or deploy
Install Posthog in Claude Code, Cursor or VS Code
Runs npx -y posthog-mcp-server on your machine. Read the scan report first; the gateway never runs local packages.
claude mcp add posthog-mcp-server -- npx -y posthog-mcp-server
What the publisher says
From the Posthog repository's README, as published. We do not edit it. Read it on GitHub
PostHog MCP Server
Connect AI assistants to PostHog — query events, persons, insights, dashboards, feature flags, cohorts, and experiments through the Model Context Protocol.
Works with Claude Desktop, Cursor, Windsurf, Cline, Continue, and any MCP-compatible client.
Features
Quick Start
1. Get a PostHog API Key
Go to PostHog → Settings → Personal API Keys and create a key with read access.
Or visit: https://your-instance.posthog.com/settings/user-api-keys
2. Configure your MCP client
Claude Desktop — add to claudedesktopconfig.json:
{
"mcpServers": {
"posthog": {
"command": "npx",
"args": ["-y", "posthog-mcp-server"],
"env": {
"POSTHOG_API_KEY": "phx_YOUR_API_KEY_HERE",
"POSTHOG_HOST": "https://us.i.posthog.com",
"POSTHOG_PROJECT": "YOUR_PROJECT_ID"
}
}
}
}Cursor — add to MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"posthog": {
"command": "npx",
"args": ["-y", "posthog-mcp-server"],
"env": {
"POSTHOG_API_KEY": "phx_YOUR_API_KEY_HERE",
"POSTHOG_HOST": "https://us.i.posthog.com",
"POSTHOG_PROJECT": "YOUR_PROJECT_ID"
}
}
}
}3. Run manually (for testing)
# Clone and build
git clone https://github.com/friendlygeorge/posthog-mcp-server.git
cd posthog-mcp-server
npm install
npm run build
# Run
POSTHOG_API_KEY=phx_... POSTHOG_PROJECT=12345 node dist/index.jsEnvironment Variables
Self-hosted PostHog
If you run PostHog on your own infrastructure, set POSTHOG_HOST to your instance URL:
POSTHOG_HOST=https://posthog.yourcompany.comExample Queries
Once configured, ask your AI assistant:
- "Show me the last 20 pageview events"
- "Who are the most active users this week?"
- "What's the status of our signup conversion experiment?"
- "Is the new-checkout-flow feature flag enabled for user abc123?"
- "Show me all active dashboards"
- "Execute insight 42 and show me the trend"
- "List all feature flags that are currently active"
- "How many people are in the 'Power Users' cohort?"
API Reference
This server wraps the PostHog REST API (v1). Full documentation:
- PostHog API docs: https://posthog.com/docs/api
- MCP protocol: https://modelcontextprotocol.io
- PostHog: https://posthog.com
Development
Shortened. The full README is on GitHub.
Nothing above is checked by us. What we check is on the safety report.
Posthog: common questions
- Is Posthog MCP server safe?
- With care: it is graded C, so read the findings first (66/100). Read the Posthog safety report
- How do I install Posthog?
- It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
- Does Posthog need an API key?
- Not as far as the registry entry and our scan can tell: no credentials are declared or required.
- Is Posthog maintained?
- The last commit was 151 days ago (2026-06-06). The latest release is v1.0.0.
- What can I use instead of Posthog?
- Servers from other publishers that do the same job: Analook — Competitor Intelligence MCP server, TracePass MCP server and DebugBundle MCP server.
- How does Posthog compare with other E-commerce MCP servers?
- safety score 66/100 (higher than 28% of 2,174 E-commerce servers); tools 13 (the typical E-commerce server has 6); tools that change things 8% (typical: 0%. Fewer write tools means less an agent can break). Full comparison.
Alternatives to Posthog
Same job from other publishers: the closest match first, then the best rated.
Analook — Competitor IntelligenceCompetitor intelligence for AI agents — SEO, traffic, social, Product Hunt, pricing, AI insights.not reviewedGrowingB
TracePassManage products, EU Digital Product Passports, operator parties, and GS1 EPCIS supply-chain events.not reviewedGrowingA
DebugBundleDebugBundle MCP: runtime error reporting, incident response, health checks, and product analytics.not reviewedGrowingB- TikTok ShopRead-only TikTok Shop Partner API: orders, finance, products and analytics across shops.not reviewedGrowingA
- Loki ModeAutonomous spec-to-product coding-agent CLI with an MCP server exposing 39 tools over stdio.not reviewedEstablishedB