Everything PostHog publishes
P

PostHog

Model Context Protocol (MCP) - Docs - PostHog

/docs/model-context-protocol

docs
Words
529
Reading time
2 min
Last crawled
2026-11-25
Cited by
18 of their pages
Language
EN
Model Context Protocol (MCP) - Docs - PostHog
PostHog

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.

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:

npx @posthog/wizard mcp add

Supports Next.js, React, Python, and

Using something else? Pick your client to set it up manually:

Code editors

Platforms

The server URL is https://mcp.posthog.com/mcp. The PostHog authentication server automatically routes you to the correct data region (US or EU) based on the account you log in with.

What can you do with the PostHog MCP?

Using Claude Code to debug and fix errors via the PostHog MCP server

Once connected, your agent can read and write across PostHog's products. Here's a taste – triaging errors from inside your editor instead of context-switching to a browser:

"What are the top 5 errors in my project this week?" – Returns error groups ranked by occurrence with affected user counts.

"Show me the full stack trace for the most recent crash, then propose a fix." – Pulls the stack trace, error message, and metadata so the agent can suggest code changes.

"Mark this issue as resolved and assign all future TypeErrors to the backend team." – Updates issue status and creates an assignment rule in one go.

There's a lot more – analytics queries, feature flag and experiment management, SQL, CDP destinations, support ticket triage, and multi-step recipes that chain it all together. You can also run governed metrics from your semantic layer, so every agent session answers "what's our MRR?" with the same canonical definition.

Browse all use cases →

Sheetposthog.com/docs/model-context-protocol.md
Drawn byPostHog
Scale548 words
Rev—