[Analytics MCP servers](/about/analytics-mcp-servers) November 16, 2026

# PostHog MCP server: setup, tools and limits

Add PostHog’s official MCP server to Claude Code, Claude, Cursor or VS Code, see what it reads and changes, and lock it to read-only before you ask.

![](/images/65d75b0ae8d69ef95785a5d6_david-pombar.webp)

**[David Pombar](/authors-guides/david-pombar)** Swiss army knife at Trackingplan

7 min read · 1452 words

> **TL;DR** The PostHog MCP is PostHog’s own server, hosted at `https://mcp.posthog.com/mcp`. In Claude Code it’s one command, `claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s user`, and a browser sign-in. It reads and writes: insights, dashboards, flags, experiments, SQL. Add `?readonly=true` before you hand it to anyone. And remember what it can’t see: whether the events it queries were tracked right.

PostHog publishes one MCP server, hosts it, and keeps a setup page for each client. The install takes a minute. The decision that takes longer is how much of PostHog the model should be allowed to touch.

This guide is part of our series on [analytics MCP servers](/guides/analytics-mcp-servers). It covers the setup in each client, the tools, the switches that make it safer, and the limit no server fixes.

![Diagram of the PostHog MCP: one hosted server at mcp.posthog.com reached from Claude Code with one command, from Claude through the connector directory, from Cursor, VS Code or Zed through PostHog’s wizard, and scoped with read-only mode, feature filters and project pinning.](/images/posthog-mcp-routes.webp)

One hosted server, several ways in. The scope you set decides what the model can change.

## What the PostHog MCP server is

It’s an official, remote MCP server that PostHog runs. You don’t install code; your client connects over HTTP to `https://mcp.posthog.com/mcp` and you sign in with your PostHog account.

Three facts from [PostHog’s docs](https://posthog.com/docs/model-context-protocol) worth knowing before you start:

-   **One URL for both regions.** The sign-in routes you to US or EU based on your account. An account in each region needs its own connection.
-   **It’s a proxy.** PostHog’s FAQ says the server doesn’t store analytics data; it calls PostHog for you.
-   **The old repo is archived.** The `github.com/posthog/mcp` repository was archived on 19 January 2026. The code moved to the PostHog monorepo, under `services/mcp`. Guides that tell you to clone the old repo are out of date.

## How to use the PostHog MCP with Claude Code

Run one command, then sign in. In a terminal:

```bash
claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s user
```

The first time Claude Code calls PostHog, it asks you to log in through the browser. `-s user` makes the server available in every project on your machine.

PostHog’s [Claude Code page](https://posthog.com/docs/model-context-protocol/claude-code) lists two alternatives:

1.  **The wizard.** `npx @posthog/wizard mcp add` detects your clients and installs the server in each.
2.  **The plugin.** `claude plugin install posthog` adds the same tools plus slash commands such as `/posthog:flags`, `/posthog:insights`, `/posthog:errors` and `/posthog:experiments`. Run `/mcp` afterwards to log in.

Claude Code is the better fit when the answer feeds code: a funnel that explains why a feature flag should stay off, an error that points at a file in the same repository.

## Claude, Cursor and the other clients

| Client | How PostHog documents it |
| --- | --- |
| Claude (web and desktop) | The PostHog connector in Claude’s directory: **Connect**, then sign in |
| Claude Desktop, manual | `npx -y mcp-remote@latest https://mcp.posthog.com/mcp` in `claude_desktop_config.json` |
| Cursor, VS Code, Zed, Codex | `npx @posthog/wizard mcp add`, or each client’s own page |
| Windsurf, PostHog Desktop | Their own setup pages in PostHog’s docs |

On Claude Team or Enterprise, an organization owner can set up enterprise-managed authorization, so members don’t sign in one by one. If your client can’t do OAuth, PostHog’s FAQ describes a personal API key with the **MCP Server** preset, scoped to one project and sent as `Authorization: Bearer`. OAuth is the route PostHog recommends.

## What it can read and change

A lot. PostHog’s [tools reference](https://posthog.com/docs/model-context-protocol/tools) groups the tools into more than 70 categories, from product analytics and SQL to feature flags, experiments, surveys, session replay, error tracking and the data warehouse. These are the ones an analyst reaches for first, from PostHog’s product analytics MCP page:

| Tool | Reads or writes | What it does |
| --- | --- | --- |
| `query-trends`, `query-funnel`, `query-retention` | Reads | Run a trends, funnel or retention query |
| `query-paths`, `query-stickiness`, `query-lifecycle` | Reads | Run paths, stickiness and lifecycle queries |
| `query-funnel-actors` and the other `-actors` tools | Reads | List the persons behind a data point |
| `execute-sql` | Reads | Run SQL against events and warehouse data |
| `read-data-schema` | Reads | List tables, columns, events and properties |
| `insight-create`, `insight-update`, `insight-delete` | Writes | Save, change or delete an insight |
| `dashboard-create`, `dashboard-update`, `dashboard-delete` | Writes | Build, change or delete a dashboard |
| `dashboards-bulk-delete` | Writes | Delete up to 100 dashboards in one request |
| `feature-flag-enable`, `feature-flag-disable` | Writes | Turn a flag on or off |
| `experiment-launch` | Writes | Launch an experiment |

Read that last third again. With default settings, a model that misreads a request can disable a flag in production or delete a hundred dashboards.

## Lock it down before the first question

PostHog gives you three switches, all set on the URL or as headers. From [PostHog’s FAQ](https://posthog.com/docs/model-context-protocol/faq):

1.  **Read-only.** `https://mcp.posthog.com/mcp?readonly=true`, or the header `x-posthog-read-only: true`. Every tool that creates, updates or deletes data drops out.
2.  **Only the features you need.** `?features=insights,dashboards,sql` keeps those categories; `?tools=execute-sql,dashboard-get` keeps exact tools. Used together, you get the union of both.
3.  **One project.** `?project_id=` (or `organization_id`) pins the connection, and the switch-project tools go away. One connection is one account and one active project; add separate entries for others.

PostHog’s own warning is the right one: “Be mindful of prompt injection”. Review tool calls before they run. In Claude, set any write tools you keep to **Needs approval**.

## Limits and cost

-   **Price.** Connecting and calling tools is free. Standard PostHog usage applies to the data your queries read. Some tools use an LLM internally, count as PostHog AI spend, and only work when AI data processing is on in your organization settings.
-   **Rate limits.** 480 requests a minute and 4,800 an hour per OAuth token or API key. Opening a session and listing tools count. Over the limit you get a `429` with `Retry-After`.
-   **Data first.** The analytics tools need a PostHog SDK already capturing events. The server reads what’s there; it doesn’t install anything.

## What to ask once it’s connected

-   “Where do users drop between `user_signed_up` and `project_created` this month?” (`query-funnel`)
-   “Which persons dropped at step two? List ten.” (`query-funnel-actors`)
-   “Run SQL for the ten most active users by event count this month.” (`execute-sql`)
-   “Which events and properties exist for checkout?” (`read-data-schema`)

Ask the model to show the query it ran. In PostHog, the same question can be a trends insight or a SQL query, and the two can count differently.

## Before you trust the answers

The PostHog MCP hands the model whatever PostHog stored. If a release renamed `checkout_completed`, if the event fires twice on a slow confirmation page, or if `plan` arrives as an empty string on iOS, `execute-sql` sums the damage and the model explains it as fluently as a correct number. It can’t tell. Nothing in the data says the event was wrong.

So validate the tracking before you give the data to an agent. Trackingplan watches the events your site and apps send to PostHog on real traffic, along with the dataLayer and the consent signals, and catches missing properties, duplicate fires and broken triggers as they appear ([PostHog in Trackingplan](/integrations/posthog)).

[Trackingplan MCP](/landings/mcp) brings that context into the same assistant: what fires, what’s broken, the consent state, attribution, and ad spend from connected ad accounts, next to what PostHog returns. You sign in as yourself, with no API key, and any change it proposes to the tracking plan waits for your approval. The [MCP endpoint docs](/docs/mcp-endpoint) have the setup.

If you’re choosing between servers, our [PostHog vs Mixpanel vs Amplitude MCP comparison](/guides/posthog-vs-mixpanel-vs-amplitude-mcp) puts them side by side, and the [Mixpanel MCP guide](/guides/mixpanel-mcp) covers the closest alternative.

## FAQ

### How do I use the PostHog MCP with Claude Code?

Run `claude mcp add --transport http posthog https://mcp.posthog.com/mcp -s user` in a terminal, then sign in to PostHog in the browser the first time Claude Code calls it. PostHog also offers `npx @posthog/wizard mcp add` and a Claude Code plugin, installed with `claude plugin install posthog`, that adds slash commands.

### Is the PostHog MCP server official?

Yes. PostHog builds and hosts it at mcp.posthog.com and documents it in its own docs. The old github.com/posthog/mcp repository was archived in January 2026; the code now lives in the PostHog monorepo.

### Can the PostHog MCP change or delete things?

Yes, unless you turn that off. Its tools create, update and delete insights, dashboards, feature flags, experiments and more. Add `?readonly=true` to the server URL, or send the `x-posthog-read-only` header, and the tools that create, update or delete data disappear.

### Does the PostHog MCP cost anything?

Connecting and calling tools is free, according to PostHog’s FAQ. Normal PostHog usage still applies to the data your queries read, and a few tools that use an LLM internally can count as PostHog AI spend.

### Does the PostHog MCP work for EU accounts?

Yes. The same URL routes you to the US or EU region based on the account you sign in with. An account in each region needs its own connection.

Part of[Analytics MCP servers: GA4, PostHog, Mixpanel and more](/guides/analytics-mcp-servers)

On this page

1.  [*01*What the PostHog MCP server is](#what-the-posthog-mcp-server-is)
2.  [*02*How to use the PostHog MCP with Claude Code](#how-to-use-the-posthog-mcp-with-claude-code)
3.  [*03*Claude, Cursor and the other clients](#claude-cursor-and-the-other-clients)
4.  [*04*What it can read and change](#what-it-can-read-and-change)
5.  [*05*Lock it down before the first question](#lock-it-down-before-the-first-question)
6.  [*06*Limits and cost](#limits-and-cost)
7.  [*07*What to ask once it’s connected](#what-to-ask-once-it-s-connected)
8.  [*08*Before you trust the answers](#before-you-trust-the-answers)
9.  [*09*FAQ](#faq)

**Stop babysitting tags**

Trackingplan audits your real user data around the clock and flags issues before they cost you.

[Start free trial →](https://app.trackingplan.com/signup)

![](/images/65d75b0ae8d69ef95785a5d6_david-pombar.webp)

**David Pombar** Swiss army knife at Trackingplan

Read more from David, a Senior Product Strategist with 18+ years in digital product development and an atypical error detection knack.

Share Copy link [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.trackingplan.com%2Fguides%2Fposthog-mcp) [X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.trackingplan.com%2Fguides%2Fposthog-mcp&text=PostHog%20MCP%20server%3A%20setup%2C%20tools%20and%20limits)

Read next

[All Guides →](/guides)

-   [
    
    6 minAnalytics MCP serversNovember 16, 2026
    
    ### Mixpanel MCP: connect Claude, ChatGPT and Cursor
    
    Turn on Mixpanel’s hosted MCP server, connect it to Claude, ChatGPT, Cursor or Codex, and see which of its tools read your data and which change it.
    
    by **David Pombar**](/guides/mixpanel-mcp)
-   [
    
    8 minAnalytics MCP serversNovember 16, 2026
    
    ### Amplitude MCP server: setup, tools and write access
    
    Connect Amplitude’s official MCP server to Claude, Cursor or Codex, see which tools it exposes and what it can change, and what it can’t see in your data.
    
    by **David Pombar**](/guides/amplitude-mcp)
-   [
    
    8 minAnalytics MCP serversNovember 16, 2026
    
    ### PostHog vs Mixpanel vs Amplitude MCP: which to use
    
    Compare the official PostHog, Mixpanel and Amplitude MCP servers: setup, auth, tools, write access, read-only options and limits, with a verdict by job.
    
    by **David Pombar**](/guides/posthog-vs-mixpanel-vs-amplitude-mcp)

Trackingplan

## See everything. Miss nothing.

Your implementations audited around the clock with real-time, real-user data. Real-time alerts about errors or changes in your data, campaigns, pixels, privacy and consent. Let AI flag issues before they cost you.

[Start free trial →](https://app.trackingplan.com/signup) [Book a demo](/demo)
