PostHog MCP Server
Lets your AI agent query product analytics, feature flags, experiments, errors and session replays in PostHog.
41k stars on GitHubby PostHogLicense NOASSERTIONUpdated 18 days ago
How to install
This MCP is remote: it runs in the cloud.
Nothing to install. Copy the address and paste it into your AI app:
Server address
https://mcp.posthog.com/mcp
- βΊClaude (site or app): Settings β Connectors β Add custom connector.
- βΊChatGPT: Settings β Apps β Create app (developer mode), and paste the address.
- βΊClaude Code, Cursor, VS Code and Windsurf: pick your app below.
Paste in the terminal:
claude mcp add --transport http posthog https://mcp.posthog.com/mcp --header "Authorization: <your value>"
What to fill in
| Name | What it is | Required |
|---|---|---|
Authorization | Bearer token with your PostHog personal API key. Create one at https://us.posthog.com/settings/user-api-keys with the 'MCP Server' preset. | Yes |
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Which pages had the most rage clicks this week?
Create a feature flag that rolls out to 10 percent of users.
What it is
PostHog stores analytics, errors, session replays and other product data so you and your agent can query it. The official MCP server connects your agent to it. You can ask for insights, SQL, replays and feature flag changes.
What it can do
- Product and web analytics insights
- SQL queries over your data
- Feature flags and experiments
- Error tracking
- Session replays
- Surveys and logs
When to use
- βΊWhen you want to know why a metric dropped.
- βΊWhen you want to roll out a feature to some users with a feature flag.
- βΊWhen you want to find the errors affecting your users.
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
analyzing-experiment-session-replaysTeaches your agent to watch session replays across A/B test variants and compare how users behave in each group.scanning-experiments-with-replay-visionTeaches your agent to set up a Replay Vision scanner that watches an experiment's recordings and compares what happens in each variant.posthog-instrumentationLets your agent add PostHog analytics to your app, including event tracking, user identification and feature flags.Frequently asked questions
How do I install it?
Run npx @posthog/wizard mcp add. It installs into Claude Code, Cursor, Codex, VS Code, Zed or PostHog Desktop.
Is it free?
PostHog has a monthly free tier per product and the README says no card is required.
Where is the server?
At https://mcp.posthog.com/mcp. It routes to the US or EU region when you log in.
Can I self-host PostHog?
Yes, with a one-line hobby deploy on Linux with Docker. The README says it is for roughly 100k events per month.
Does self-hosting come with support?
No. The README says they do not provide support or guarantees for open source deployments.
Is it official?
Yes. The registry describes it as the official PostHog MCP server.
If it does not work
- βΊRun npx @posthog/wizard mcp add again if the server is missing from your client.
- βΊMake sure you log in to the right region, US or EU.
- βΊRestart your agent fully after adding the server.
5 new skills a week. 1 minute to read.