Model Context Protocol (MCP)
Contents
Get started in 30 seconds
What can you do with the PostHog MCP?
Go deeper
Next steps
The PostHog
Model Context Protocol (MCP)
server is a free, hosted endpoint that lets your AI agent use PostHog – with just plain text questions your agents can ship a feature flag from a prompt, dig into a stack trace without leaving your editor, run a HogQL query through Claude, triage a support ticket, set up a CDP destination, and much more.
It works with any MCP-compatible client, including
PostHog Desktop
, Claude Code, Claude Desktop, Cursor, Codex, VS Code, Windsurf, and Zed.
Connecting to the MCP server and calling its MCP tools is free, but some MCP tools use LLMs internally and may be billed as PostHog AI spend.

These AI-powered MCP tools are only available when
AI data processing is enabled
in your organization settings.
Get started in 30 seconds
The fastest way to setup the MCP is the
PostHog Wizard
, which installs the MCP server directly into
PostHog Desktop
,
Cursor
,
Claude Code
,
Claude Desktop
,
Codex
,
VS Code
, and
Zed
:
Install the PostHog MCP
Learn more
npx @posthog/wizard mcp add
Supports
Next.js, React, Python
, and
24
more
Claude
Cursor
VS Code
Windsurf
Codex
Zed
Lovable
Replit
v0
Using something else? Pick your client to set it up manually:
Code editors
PostHog Desktop
Claude Code
Claude Desktop
Codex
Cursor
VS Code
Windsurf
Zed
Platforms
Lovable
Replit
v0
The server URL is
https://mcp.posthog.com/mcp
.
