PostHog MCP server: setup, EU region, read-only mode and tools
PostHog's official MCP server is hosted at mcp.posthog.com with an EU endpoint at mcp-eu.posthog.com. This guide covers the setup wizard and Claude Code, OAuth vs personal API keys, read-only mode, limiting tools with features and project pinning, and what it costs.
PostHog answers the product questions: how many people used the new feature, where they drop off, which flag is on for whom, what errors they hit. The PostHog MCP server lets an AI agent ask those questions directly from Claude, Claude Code or Cursor, and in the other direction lets a developer create a feature flag or check an experiment without leaving the editor. This guide covers setup, the EU endpoint, how to limit the server, and costs. If MCP is new to you, start with what an MCP server is.
Facts are from PostHog's MCP documentation as of October 2026.
What the server is
PostHog's MCP server is official and hosted by PostHog:
| Region | Endpoint |
|---|---|
| US | https://mcp.posthog.com/mcp |
| EU | https://mcp-eu.posthog.com/mcp |
The standalone PostHog/mcp GitHub repository was archived in January 2026; the server now lives in PostHog's main repository under services/mcp. Tutorials that install from the old repo are out of date.
For PostHog EU Cloud, PostHog says OAuth through the main URL routes you to the correct region automatically. If your organization is on EU Cloud, using the EU endpoint directly makes the choice explicit.
Setup
The wizard configures Claude, Claude Code, Cursor, VS Code and Zed in one step:
npx @posthog/wizard@latest mcp add
Claude Code by hand, for all your projects:
claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s user
Or the EU endpoint:
claude mcp add --transport http posthog https://mcp-eu.posthog.com/mcp -s user
Run /mcp in a session to sign in. PostHog also publishes a Claude Code plugin (claude plugin install posthog). Claude Desktop, Cursor, Codex, VS Code, Windsurf and Zed are documented too; our Cursor MCP guide covers the general steps.
OAuth or a personal API key
OAuth is recommended and what the wizard uses. For CI or a headless setup, create a personal API key with the MCP Server preset, scoped to the projects it needs, and send it as a header:
Authorization: Bearer phx_...
A personal API key acts as you across the projects it covers, so give it an expiry and keep it in a secrets manager.
Limiting what it can do
PostHog has the most flexible controls of any MCP server we cover. Combine them in the URL or as headers:
| Control | URL parameter or header | Effect |
|---|---|---|
| Read-only | ?readonly=true or x-posthog-read-only: true | Only read tools |
| Feature groups | ?features=insights,dashboards,flags | Only these areas (40+ available) |
| Specific tools | ?tools=dashboard-get,execute-sql | Only these tools (combines with features) |
| One project | x-posthog-project-id: <id> | Pinned to one project, switch tools removed |
| One organization | x-posthog-organization-id: <id> | Pinned to one organization |
A sensible default for analysts and product managers:
https://mcp-eu.posthog.com/mcp?readonly=true&features=insights,dashboards,flags,experiments,sql
Feature areas include insights, dashboards, flags, experiments, error_tracking, sql, replay, surveys, cohorts, persons, llm_analytics and workflows, among others. Leaving out persons and replay reduces how much individual user data the agent reaches when the questions are about aggregates. Note that sql can query any table the project exposes, persons included, so leave it out too where that matters.
The tools
| Area | What the agent can do |
|---|---|
| Insights and dashboards | Trends, funnels and retention insights; dashboards (for example dashboard-get) |
| SQL | HogQL queries with execute-sql |
| Feature flags | Flags (for example feature-flag-get-all) |
| Experiments | Experiments and their results |
| Error tracking | Errors and issues |
| Surveys, cohorts, persons, replay | The matching PostHog objects |
| CDP and support | Destinations and support tickets |
With readonly=true only the read side of each area is exposed; without it, the agent can also create and change objects such as flags, insights and dashboards.
The full, current list is in PostHog's tool reference.
What people use it for
- Product questions. "How many weekly active users used the new export feature in its first two weeks, and how does that compare with the old one?"
- Funnel check. "Show the signup funnel for the last 30 days and where the biggest drop is."
- Flags from the editor. In Claude Code, while building a feature: "Create a feature flag new-billing-page, rolled out to 10% of EU users." (Needs write access.)
- Error and release. "Which errors increased after yesterday's release?"
Recurring analyses, such as the Monday product review, belong in a skill so they run the same way every week.
Costs and limits
Connecting and calling tools is free, and normal PostHog API rate limits apply per project. Some tools use an LLM inside PostHog; those are billed as PostHog AI usage and only appear when AI data processing is enabled in your organization settings.
Self-hosted PostHog
There is no hosted MCP path for self-hosted PostHog. You run the server yourself from the PostHog repository (it needs Redis) and point it at your instance with POSTHOG_API_BASE_URL.
Privacy
PostHog data is behavioural data about real people. What the agent reads, such as person properties, event payloads or replay content, goes into the conversation and on to your model provider. Read-only mode, feature groups that exclude persons, replay and sql, and project pinning are the controls that keep a question about aggregates from becoming a transfer of individual data. The general rules are in MCP security best practices.
Running it for a team
For a product team, you want the same read-only defaults, the same feature groups, and one log across PostHog, the CRM and support tools. That is the job of an MCP gateway. Walma AI Hub runs approved MCP servers like PostHog behind one policy and one audit log, with the models in the customer's own Azure tenant in an EU region, which pairs naturally with PostHog's EU Cloud. Related: Google Analytics MCP and the MCP directory.
Frequently asked questions
Does PostHog have an MCP server?+
Yes. PostHog maintains an official hosted MCP server at https://mcp.posthog.com/mcp, with an EU endpoint at https://mcp-eu.posthog.com/mcp. It gives AI clients access to product analytics, insights, HogQL SQL, feature flags, experiments, dashboards, error tracking, session replay, surveys and more. The old standalone PostHog/mcp repository is archived; the code now lives in the PostHog monorepo.
How do I add PostHog MCP to Claude Code?+
Run npx @posthog/wizard@latest mcp add and choose Claude Code, or add it directly with claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s user and sign in with OAuth. PostHog also publishes a Claude Code plugin.
Does PostHog MCP work with PostHog EU Cloud?+
Yes. PostHog says OAuth through the main URL routes you to the correct data region, US or EU, automatically. There is also a dedicated EU endpoint, https://mcp-eu.posthog.com/mcp, which you can use directly if your organization is on PostHog's EU cloud.
Can I make PostHog MCP read-only?+
Yes. Add ?readonly=true to the URL, or send the header x-posthog-read-only: true, and the server only exposes read tools. You can narrow it further with ?features= (for example insights,dashboards,flags) or ?tools= with exact tool names, and pin it to one project with the x-posthog-project-id header.
Is the PostHog MCP server free?+
Connecting and calling tools is free, and normal PostHog API rate limits apply. Some tools use LLMs internally; those are billed as PostHog AI usage and only appear when AI data processing is enabled in your organization settings.
The same tools, in your EU region, under your control
A 20-minute walkthrough with an engineer. We map it to your tools, your MCP servers and your budget model.