Content
PostHog MCP Server is PostHog's official Model Context Protocol server for
connecting Claude and other MCP-capable clients to a PostHog project. It is
documented as a hosted endpoint at https://mcp.posthog.com/mcp, with an EU
endpoint at https://mcp-eu.posthog.com/mcp, and the server source lives in
the PostHog monorepo under services/mcp.
The server is useful when a product, growth, support, or engineering workflow
needs current PostHog context inside the assistant: recent trends, dashboard
state, feature flag configuration, experiment results, error groups, event
schemas, logs, LLM analytics, surveys, and project configuration. Because the
same MCP surface can also create or change PostHog resources, start with a
small feature set and a scoped personal API key.
Features
- Official PostHog documentation page for MCP setup, available tools, filtering,
data processing, self-hosted use, and examples.
- Hosted Streamable HTTP endpoint at
https://mcp.posthog.com/mcp.
- EU endpoint at
https://mcp-eu.posthog.com/mcp.
- Public server source in
PostHog/posthog under services/mcp.
- Quick install through the official PostHog wizard.
- Manual MCP configuration through
mcp-remote and an Authorization header.
- Feature filtering with the
features query parameter.
- Exact tool allowlisting with the
tools query parameter.
tools mode for one MCP tool per PostHog tool and cli mode for a single
CLI-like wrapper tool.
- Consumer attribution through query parameters or headers for plugin and proxy
installers.
- Local development and self-hosting path with
POSTHOG_BASE_URL.
Tool Surface
PostHog documents feature groups for workspace and project management, actions,
activity logs, alerts, annotations, cohorts, dashboards, data schema, data
warehouse, docs search, early access features, error tracking, events,
experiments, feature flags, CDP functions, insights, LLM analytics, prompts,
logs, notebooks, persons, reverse proxy records, search, SQL, surveys, and
workflows.
Many tools are read-only, but not all. The source schema marks some tools with
write scopes and destructive hints, including deletion, workflow execution,
workflow scheduling, feature management, and product-configuration changes.
Installation
Quick Install
Use the official PostHog wizard to install the MCP server into supported
clients:
npx @posthog/wizard@latest mcp add
The wizard can install into Cursor, Claude, Claude Code, VS Code, and Zed.
Manual MCP Config
Create a personal API key using PostHog's MCP Server preset, then configure a
compatible client with mcp-remote:
{
"mcpServers": {
"posthog": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://mcp.posthog.com/mcp?features=docs,insights,error_tracking,events,data_schema",
"--header",
"Authorization:${POSTHOG_AUTH_HEADER}"
],
"env": {
"POSTHOG_AUTH_HEADER": "Bearer phx_your_personal_api_key"
}
}
}
}
The example above narrows the starting feature set. To expose a different
surface, change the features list or use PostHog's exact tools allowlist:
https://mcp.posthog.com/mcp?tools=dashboard-get,feature-flag-get-all,execute-sql
For EU PostHog projects, use:
https://mcp-eu.posthog.com/mcp
Use Cases
- Ask Claude to summarize signup, activation, retention, or funnel movement
from current PostHog insights.
- Review recent errors and affected user counts while triaging a regression.
- Inspect active feature flags before planning a rollout or cleanup.
- Draft a dashboard or insight plan after searching existing dashboards and
event schemas.
- Compare experiment status and conversion metrics before writing a release
update.
- Query logs, LLM analytics, or prompt performance while debugging an AI
product workflow.
- Search PostHog docs from the same MCP client when implementing analytics,
flags, replay, or warehouse changes.
- Use a local or self-hosted MCP server with
POSTHOG_BASE_URL for self-hosted
PostHog instances.
Safety Checklist
- Create a dedicated personal API key for MCP use.
- Grant only the required PostHog scopes and rotate the key after temporary
work.
- Start with feature or tool filtering instead of exposing every PostHog tool.
- Confirm the active PostHog project and region before approving queries.
- Keep approval prompts enabled for writes, deletes, workflow runs, alerts,
surveys, experiments, and feature flag changes.
- Use short date ranges and row limits for SQL, logs, warehouse, person, and
event queries.
- Avoid unrestricted production access while testing a new client setup.
- Replace placeholder keys in config files and never commit real
POSTHOG_AUTH_HEADER values.
Source Links