# PostHog — MCP Server

> Ask product analytics questions and ship feature flags from chat.

**Source:** https://mcpplaygroundonline.com/mcp-servers/posthog  
**Transport:** http  
**Requires auth:** Yes

---

## What it does

The server covers most of what a product team does inside PostHog. Analytics is the core: an agent can run HogQL — PostHog’s SQL dialect over the event schema — or ask for an insight to be generated from a natural-language description, then read the result. It can list and create dashboards and insights, so an exploration that proves useful can be saved rather than repeated. Feature flags are fully managed: list them, read their definitions and rollout conditions, create new ones and update existing ones, which is what makes this practical for shipping rather than only reporting. Error tracking exposes recent errors and their details, experiments and surveys are reachable, and a documentation search tool answers questions about PostHog itself. Authentication is OAuth — the first connection opens a browser and the credentials are reused afterwards — and PostHog runs the server in both US and EU regions, so EU Cloud data stays in the EU.

## Tools exposed

- query-run — execute HogQL against your event data
- get-sql-insight — turn a natural-language question into a query and run it
- insights and dashboards — list, read and create saved analytics
- feature flags — list, read, create and update flags and their rollout conditions
- error tracking — list recent errors and inspect the details of one
- experiments and surveys — read and manage running experiments and surveys
- docs-search — search PostHog documentation from inside the conversation

## Example queries you can run

- "What is the signup-to-activation conversion rate this month versus last?"
- "Which errors started appearing after the release on Tuesday?"
- "Create a feature flag for the new checkout, rolled out to 5% of users."
- "Write a HogQL query for weekly retention by acquisition channel and run it."

## Details

- **Recommended model:** anthropic/claude-sonnet-4.5 — HogQL is SQL with PostHog-specific event semantics. Sonnet 4.5 gets the event and person joins right, where weaker models quietly produce a plausible wrong number.
- **Transport:** http
- **Authentication:** Required — OAuth — your client opens a browser on first connection and reuses the credentials after. EU Cloud projects use https://mcp-eu.posthog.com/mcp instead.
- **Hosted endpoint:** https://mcp.posthog.com/mcp
- **Official source:** [PostHog MCP — official documentation](https://posthog.com/docs/model-context-protocol)

## Frequently asked questions

### What is the PostHog MCP server?

It is PostHog’s official remote MCP server, hosted at mcp.posthog.com. It gives an AI assistant access to analytics and HogQL, dashboards and insights, feature flags, experiments, surveys, session replay and error tracking, with no local install.

### How do I authenticate?

OAuth. The first time your client connects it opens a browser window to sign in and authorise access, then reuses those credentials on later sessions. You never paste a personal API key into a config file.

### Is there an EU endpoint?

Yes. PostHog runs the MCP server in both US and EU regions — EU Cloud projects connect to mcp-eu.posthog.com instead of mcp.posthog.com, so the data does not leave the region.

### Can an agent actually change feature flags?

Yes, that is one of the reasons to use it — create and update are both available. Treat that accordingly: a flag change is a production change. Review what the agent proposes before approving it, especially on rollout percentages.

### What is HogQL?

PostHog’s SQL dialect over your event and person data, based on ClickHouse SQL. The MCP server can run it directly, which is how an agent answers questions that no pre-built insight covers.

---

_Test this server across 40+ models on MCP Playground: https://mcpplaygroundonline.com/mcp-servers/posthog — free, no install._
