---
url: "https://posthog.com/mcp"
title: PostHog MCP server – Your product data in any AI agent
domain: posthog.com
locale: en
type: landing
words: 1061
cited_by: 25
indexed_by: stealpage
---

UsePostHog withoutthe browser

## PostHog, headless

The PostHog MCP pulls your product data into wherever your agents work. Query analytics, debug errors, roll out flags, and run experiments from any MCP-compatible client.

### Install the PostHog MCP

```
npx @posthog/wizard mcp add
```

Are you an agent? [Read the plain version](https://posthog.com/mcp.md).

## You don't need to use PostHog to use PostHog

![SoundBoost](https://posthog.com/static/soundboost-light-187338acb27e698cdd1d212d137cc32f.svg)
*Read the story*

Lezgin Zilan

CTO, Qred

> “Hell yes, I'd recommend PostHog. \[…\] Especially the MCP.”

[Read the story](https://posthog.com/customers/qred)

![PostHog](https://posthog.com/brand/posthog-logo.svg)
*Read the post*

**"But I like the PostHog UI."** Then carry on. Try the [new navigation beta](https://posthog.com/roadmap?feature=today-rail-nav) and tell [![Surfaces mini crest](https://res.cloudinary.com/dmukukwp6/image/upload/f_png,h_20,w_20,c_fill,g_auto,q_auto/posthog_code_mini_crest_693227eecb?_a=AXAH4nI0)Surfaces Team![Surfaces mini crest](https://res.cloudinary.com/dmukukwp6/image/upload/f_png,h_20,w_20,c_fill,g_auto,q_auto/posthog_code_mini_crest_693227eecb?_a=AXAH4nI0)Surfaces Team](https://posthog.com/teams/surfaces) (they'll be thrilled).

## What can you do with the PostHog MCP?

Your agent selects from 1300+ tools across 79 categories, then reads or updates your PostHog project for you.

claude — ~/hogflix

✻ Welcome to **Claude Code**!

cwd: ~/hogflix

\>

? for shortcuts

## Which agents can use it?

Any MCP client can connect. PostHog hosts the server, so you run nothing. Sign in with your PostHog account, and it sends you to your US or EU data region.

-   [ChatGPTPlugin](https://chatgpt.com/plugins/plugin_asdk_app_699caef2d680819188727b0ddbb349dd)
-   [ClaudeConnector directory](https://claude.ai/directory/connectors/posthog)
-   [CursorSetup guide](https://posthog.com/docs/model-context-protocol/cursor)
-   [CodexSetup guide](https://posthog.com/docs/model-context-protocol/codex)
-   [VS CodeSetup guide](https://posthog.com/docs/model-context-protocol/vscode)
-   [WindsurfSetup guide](https://posthog.com/docs/model-context-protocol/windsurf)
-   [ZedSetup guide](https://posthog.com/docs/model-context-protocol/zed)
-   [Gemini CLIAI plugin](https://github.com/PostHog/ai-plugin)

Want skills too? PostHog [skills](https://posthog.com/docs/skills) ship with the MCP server, so there's nothing extra to install. Once your agent is connected, it loads the skill it needs when a task calls for it.

Part of a balanced agent's [diet](https://posthog.com/mcp/leaderboard "MCP leaderboard")

## Your agent gets the full spread

Every product, read and write

Build, ship, and measure from one UI. Your agent can find a bug, ship the fix behind a flag, and check the result.

Uses your metric definitions

Ask for MRR, and get the real thing from your [semantic layer](https://posthog.com/docs/semantic-layer).

Light on context

Most agent clients only look up tools as needed (tokenminning is tokenwinning).

### MCP tools reference

Every tool your agent can call, sorted by product.

[See every tool →](https://posthog.com/docs/model-context-protocol/tools)

### FAQ and advanced setup

How sign-in works, what it costs, and how to limit what your agent can touch.

[Read the FAQ →](https://posthog.com/docs/model-context-protocol/faq)

## No PostHog in your app yet? Your agent can add it

Connect the MCP, then ask your agent to install PostHog in your GitHub repository. The [PostHog wizard](https://posthog.com/docs/ai-engineering/ai-wizard) runs in the cloud, makes the code changes, and opens a pull request for you to review.

### Install the PostHog MCP

```
npx @posthog/wizard mcp add
```

Some assembly required (by your agent)

## Questions people ask before connecting

The PostHog MCP is a free, hosted Model Context Protocol (MCP) server that lets your AI agent use PostHog. From Claude, Cursor, Codex, VS Code, and other MCP clients, your agent can query analytics, debug errors, roll out feature flags, and run experiments in plain English.

[Setup guide](https://posthog.com/docs/model-context-protocol)

Any AI tool that supports MCP works. We tested and documented setup for Claude Code, Claude Desktop, Cursor, Codex, VS Code, Windsurf, Zed, and PostHog Desktop.

[Supported clients](https://posthog.com/docs/model-context-protocol/faq#which-ai-clients-and-editors-are-supported)

Run npx @posthog/wizard mcp add in your terminal and select your client. The wizard adds the server and signs you in with OAuth. To set it up manually, add the server URL https://mcp.posthog.com/mcp to the MCP settings of your client.

[Client setup guides](https://posthog.com/docs/model-context-protocol)

You need a PostHog account, because your agent signs in to it. It is free to sign up. You do not need to install the PostHog SDK to connect the MCP. But to ask questions about your product data, your project must have events. If you do not send events yet, the PostHog Wizard can add the SDK to your app.

[Install PostHog](https://posthog.com/docs/getting-started/install)

Yes. Connecting to the MCP server and calling its tools is free. Standard PostHog usage and billing still apply to the data your queries use. Some tools use LLMs internally and can add PostHog AI spend. Those tools need AI data processing to be enabled in your organization, and they are hidden when it is off.

[Cost details](https://posthog.com/docs/model-context-protocol/faq#how-much-does-it-cost)

It can do both. Your agent can read data, for example to run queries, look at errors, or find session replays. It can also make changes, for example to create dashboards and insights, roll out or turn off feature flags, and set up experiments and surveys. If you want your agent to only read data, use read-only mode. It removes the tools that create, update, or delete data.

[All MCP tools](https://posthog.com/docs/model-context-protocol/tools)

PostHog AI is the AI agent inside the PostHog app. The PostHog MCP brings PostHog to the AI agent that you already use, such as Claude Code, Cursor, or Codex. Use PostHog AI when you work in PostHog. Use the MCP when you work in your editor, terminal, or chat client and want your agent to use your product data next to your code.

[About PostHog AI](https://posthog.com/docs/posthog-ai)

Review tool calls before they run, because an LLM can be tricked into following untrusted commands. You can also limit the session to read-only tools, filter the tools by feature or name, and pin the agent to one organization or project.

[Read-only mode](https://posthog.com/docs/model-context-protocol/faq#restricting-to-read-only-mcp-tools)

No. The server is a proxy to your PostHog instance, and it does not store your analytics data. It routes to the US or EU region of the account you sign in with. Queries run against your project, and the results go straight to your AI client.

[Data and privacy](https://posthog.com/docs/model-context-protocol/faq#where-is-my-data-sent)

Yes. The server allows 480 requests per minute and 4,800 per hour. The limits count per credential, which is the OAuth token or personal API key that your client uses. A request over the limit gets a 429 response with a Retry-After header.

[Rate limits](https://posthog.com/docs/model-context-protocol/faq#are-there-rate-limits)

No. OAuth is the recommended way, and the wizard sets it up. If your client does not support OAuth, use a personal API key with the MCP Server preset.

[API key setup](https://posthog.com/docs/model-context-protocol/faq#using-an-api-key-instead-of-oauth)

Yes, with one MCP connection for each. A single connection signs in as one account and has one active organization and project.

[Multiple accounts and projects](https://posthog.com/docs/model-context-protocol/faq#working-with-multiple-accounts-organizations-or-projects)

Yes, with the Scale or Enterprise platform add-on. Enterprise-managed authorization (ID-JAG) lets Okta, Entra ID, and other identity providers control MCP access, instead of per-user OAuth or API keys.

[Enterprise-managed authorization](https://posthog.com/docs/model-context-protocol/enterprise-managed-authorization)

## The waiting room

For agents waiting to be tool-called into the next chat window. Help yourself to something to read.

Go on, pick one up.

## Don't keep your agent waiting

**Get started – free.** One command connects the PostHog MCP to Claude Code, Codex, Cursor, VS Code, and Zed.

### Install the PostHog MCP

```
npx @posthog/wizard mcp add
```