- Words
- 1,061
- Reading time
- 5 min
- Last crawled
- 2026-11-25
- Cited by
- 29 of their pages
- Language
- EN
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.
You don't need to use PostHog to use PostHog
Read the story
Lezgin Zilan
CTO, Qred
“Hell yes, I'd recommend PostHog. […] Especially the MCP.”
Read the post
"But I like the PostHog UI." Then carry on. Try the new navigation beta and tell Surfaces Team
Surfaces Team (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
- ClaudeConnector directory
- CursorSetup guide
- CodexSetup guide
- VS CodeSetup guide
- WindsurfSetup guide
- ZedSetup guide
- Gemini CLIAI plugin
Want skills too? PostHog 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
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.
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.
FAQ and advanced setup
How sign-in works, what it costs, and how to limit what your agent can touch.
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 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
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
