MCP Ecommerce
PostHog logo

Analytics

PostHog MCP

PostHog's free hosted MCP endpoint (auto-routed to US or EU) lets agents run analytics and HogQL queries, inspect errors and session data, and manage feature flags, experiments and CDP destinations.

PostHog MCP setup guide: PostHog's MCP documentation page on posthog.com, shown in a browser frame (analytics MCP server for e-commerce)
PostHog MCP setup guide preview: PostHog’s documentation on posthog.com, captured Nov 9, 2026. The page may have changed since; the link opens the live version.

What it is and why it matters

PostHog MCP is a free, hosted endpoint from PostHog that lets an AI assistant work with your PostHog project using plain text requests. According to the documentation, an agent can run analytics queries and HogQL (PostHog's SQL), pull top errors and stack traces, create feature flags and experiments, set up CDP destinations, and triage support tickets. It can also run governed metrics from your semantic layer, so a question like "what's our MRR?" uses one agreed definition each time.

It suits stores and agencies that already use PostHog for web analytics, session replays and experiments, and want to ask questions or make changes from an AI client instead of the PostHog interface. How well it works depends on three things: the quality of your PostHog tracking, the permissions you give the connected account, and whether you review what the agent does before it changes anything. The server can both read and write, so start with questions and reports before you let it edit flags or destinations.

What it does

  • Run analytics queries and HogQL SQL
  • Inspect top errors and stack traces
  • Create and manage feature flags and experiments
  • Configure CDP destinations and triage support tickets

Best for

Stores and agencies using PostHog for web analytics, replays and experiments.

How to connect it

  1. Check that you have a PostHog account with access to the project you want to query. The server routes you to the US or EU region based on the account you log in with, so use the account that owns your data.
  2. The fastest route described in the documentation is the PostHog Wizard: run npx @posthog/wizard mcp add. It installs the MCP server into supported clients such as PostHog Desktop, Cursor, Claude Code, Claude Desktop, Codex, VS Code and Zed.
  3. To set it up by hand, open your client's page in the PostHog documentation (Claude Code, Claude Desktop, Codex, Cursor, VS Code, Windsurf, Zed, Lovable, Replit or v0) and add the server URL https://mcp.posthog.com/mcp.
  4. Log in through the PostHog authentication window when prompted. Pick the account and organization you intend to use.
  5. If you plan to use the tools that run LLMs internally, check the AI data processing setting in your organization settings, as described in the documentation. Leave it off if you don't want those tools.
  6. Test with a read-only question such as "What are the top 5 errors in my project this week?" and check the answer against the PostHog interface. For scoping and safety options, follow the FAQ and advanced setup page in the vendor documentation.

Exact commands and addresses change. Use the official documentation for the current steps.

Installation guide for PostHog MCP

Client-by-client steps, what to prepare, the first prompts to run and fixes for common errors.

ClaudeChatGPTGeminiMicrosoft CopilotPerplexityCursorClaude Code
→

Questions you can ask it

  • What are the top 5 errors in my project this week, and how many users did each affect?
  • Run a HogQL query that shows weekly signups for the last 8 weeks and summarize the trend.
  • Show me the full stack trace for the most recent crash and suggest a fix.
  • List my active feature flags and tell me which ones have not been changed recently.

What it cannot do

  • It cannot give you better data than you already track. If events, replays or errors are not captured in PostHog, the agent has nothing to analyze.
  • It is not a general store management tool. It works with PostHog data and features, not your shop admin, ad accounts or inventory.
  • The AI-powered tools are only available when AI data processing is enabled in your organization settings, so some features may be missing if it is off.

Staying safe

  • The server has read and write access. Begin with read-only questions, and only ask for changes to feature flags, experiments, issue status or CDP destinations while you are watching and can approve each tool call.
  • The documentation warns you to review tool calls for prompt injection. Text inside errors, tickets or other data could contain instructions meant to steer the agent, so do not auto-approve write actions.
  • Some tools call LLMs internally and are billed as PostHog AI spend. Connecting and calling the other tools is free, but check your PostHog billing and organization settings before heavy use. Changing a live flag or destination can affect real visitors and data flows.

Watch out for: Some tools call LLMs internally and bill as PostHog AI spend, and the docs warn to review tool calls for prompt injection.

Frequently asked questions

+

Is the PostHog MCP server free?

Per the documentation, connecting to the server and calling its tools is free. The exception is tools that use LLMs internally, which may be billed as PostHog AI spend. Those tools only work when AI data processing is enabled in your organization settings. Check PostHog's pricing page for current rates.

+

Does the PostHog MCP work with US and EU accounts?

Yes. The server URL is the same for everyone. The documentation says the PostHog authentication server automatically routes you to the correct data region, US or EU, based on the account you log in with, so you do not choose a regional endpoint.

+

Which AI clients can I use with PostHog MCP?

The documentation says it works with any MCP-compatible client, including PostHog Desktop, Claude Code, Claude Desktop, Cursor, Codex, VS Code, Windsurf and Zed. There are also guides for Lovable, Replit and v0. The PostHog Wizard can install it into several of these automatically.

Step-by-step: install PostHog MCP in Claude, ChatGPT, Gemini, Copilot and more →

Questions and answers (1)

Questions readers and searchers ask about PostHog MCP, answered by the site editor from the vendor documentation, plus reader experience. Every comment is reviewed before it appears.

  • MCP Ecommerce editorSite editor

    People search for: “posthog mcp url”

    The PostHog MCP server URL is https://mcp.posthog.com/mcp. Paste it into any MCP-compatible client as a remote server. PostHog's docs list Claude Code, Claude Desktop, Codex, Cursor, VS Code, Windsurf and Zed, plus Lovable, Replit and v0.

    You don't pick a region in the URL. PostHog's auth server sends you to US or EU based on the account you log in with.

    If you'd rather not edit config by hand, the docs give a wizard command: npx @posthog/wizard mcp add. It installs the server into several of those clients.

    Two catches. Connecting and calling tools is free, but some tools use LLMs internally and can bill as PostHog AI spend. Those tools only work if AI data processing is on in your organization settings. The docs also warn about prompt injection, so review tool calls before you approve them.

    Docs: https://posthog.com/docs/model-context-protocol

Ask a question or share what worked

Reviewed before publishing. One link max, no HTML.

Related guides

Other servers to compare