PostHog MCP Server
Published · Updated
At a glance
- Category
- Data & analytics
- GitHub repository
- PostHog/posthog
- Watch out for
- The archived PostHog/mcp repository is out of date; use the hosted server.
PostHog's MCP server is hosted at mcp.posthog.com. Its code used to live in a separate PostHog/mcp repository, which is now archived; it has moved into the main PostHog repository, which is why this page links there.
It connects an agent to most of what PostHog does. According to PostHog's docs, that includes error tracking (error groups, stack traces, resolving issues and assignment rules), analytics queries, feature flags and experiments, SQL queries in HogQL, CDP destinations, support ticket triage and governed metrics from the semantic layer. For a developer, the strongest uses are probably checking a feature flag's rollout while writing code, and pulling the stack trace of a new error straight into the editor.
Sign-in routes you automatically to the right data region, US or EU, based on your account, so there is one URL for everyone. PostHog says connecting and calling tools is free, but some tools use LLMs internally and may count as PostHog AI spend, and those AI-powered tools only work when AI data processing is enabled in your organisation settings.
How it connects
Your AI app
An assistant or agent that supports MCP
PostHog MCP Server
Runs as
- npx (Node.js)
- Remote (HTTP)
Gives the agent
- Error tracking
- Feature flags and experiments
- Analytics and SQL
- CDP and support
- Governed metrics
PostHog
The data or system the tools act on
What it can do
- Error tracking
- Read error groups and stack traces, mark issues resolved and manage assignment rules.
- Feature flags and experiments
- Inspect and manage flags and experiments, for example checking rollout percentages while you code.
- Analytics and SQL
- Run analytics queries and HogQL SQL against your PostHog data.
- CDP and support
- Work with CDP destinations and triage support tickets.
- Governed metrics
- Query metrics defined in PostHog's semantic layer, so numbers match what your team already uses.
Setting it up
The fastest route is PostHog's wizard: npx @posthog/wizard mcp add, which installs the server into PostHog Desktop, Cursor, Claude Code, Claude Desktop, Codex, VS Code and Zed. Manual setup pages also cover Windsurf, Lovable, Replit and v0. To add it by hand, configure an HTTP server at https://mcp.posthog.com/mcp and sign in when prompted; you are routed to your region automatically. PostHog's documentation has manual setup pages for each client and an FAQ on authentication, scoping and safety. Enable AI data processing in your organisation if you want the AI-powered tools.
Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)
Where it helps
- Pulling the stack trace of a new production error into your editor
- Checking or changing a feature flag's rollout during development
- Answering a product question with a HogQL query
- Triaging new support tickets and linking them to errors
Limitations and things to watch
- The archived PostHog/mcp repository is out of date; use the hosted server.
- Some tools use LLMs internally and can count toward PostHog AI spend.
- AI-powered tools require AI data processing to be enabled for your organisation.
- Write actions such as changing flags affect real users; review before letting the agent change rollouts.
Sources
Written from the project's own documentation, checked November 2026.
- github.com /PostHog/posthog
- posthog.com /docs/model-context-protocol
- github.com /PostHog/posthog/tree/master/services/mcp
- github.com /PostHog/mcp
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.