PostHog MCP Server
Official hosted MCP access to PostHog analytics, feature flags, experiments, and further product tools in an AI client.
- Skill Road
- PostHog MCP Server
Categories
Description
The PostHog MCP Server is PostHog’s official hosted Model Context Protocol endpoint. It connects MCP-capable clients to an existing PostHog account so a person can ask natural-language questions and use selected platform tools. The official documentation names PostHog Desktop, Claude Code, Claude Desktop, Cursor, Codex, VS Code, Windsurf, and Zed, among others. The product link in this entry therefore leads to PostHog’s MCP documentation. The listed PostHog/mcp repository is the official, MIT-licensed historical repository address; its README points to the current service, which has moved into the PostHog monorepo under services/mcp. Immediately before this seed on 2026-09-08, the GitHub API reported exactly 151 stars for that archived redirect repository. That number is a point-in-time popularity signal only, not evidence of quality, security, or suitability.
Product analytics, flags, and experiments
According to PostHog, the server can expose analytics and SQL queries, dashboards, experiments, feature flags, surveys, session replay, and error tracking. Documented examples include a trends query for daily unique signups, creation of a feature flag with a rollout and rules, and creation of an A/B experiment with variants, a metric, and an associated flag. The documentation also covers error triage, stack-trace queries, support-ticket triage, and CDP destinations. This does not mean every connection should automatically receive every capability: the current service can be scoped to product areas through features and to exact tool names through tools. Starting with a small read-only allowlist such as analytics, dashboards, or selected flags reduces both context volume and operational risk.
Hosted endpoint and local paths
The regular product service is hosted at https://mcp.posthog.com/mcp; according to PostHog, its authentication service routes accounts to the appropriate US or EU data region. This entry is consequently classified as remote. The official quick setup installs client configuration through npx @posthog/wizard@latest mcp add. The manual desktop configuration uses local npx mcp-remote as a stdio bridge to the hosted endpoint; that is not a locally running PostHog server and does not alter the data residency of the PostHog request. For custom Node clients, the current repository documents Streamable HTTP with Bearer authentication, an Accept header for JSON and SSE, and the normal MCP initialize lifecycle. A local Hono server using pnpm run dev, Redis, and port 8787 is documented only as a development path for the source project. It is not a simple self-hosting promise for normal product access.
Keys, project access, and write actions
The manual path requires a personal PostHog API key using the MCP Server preset and sends it as a Bearer token. Such a key and its effective rights open access to the PostHog organization and the project selected in the client. Store it only in secret management or the local client environment, never in a repository, prompt, chat transcript, screenshot, ticket, or committed configuration. Rotate or revoke it if exposure is possible. According to the documentation, the server can read and write across PostHog products. Feature flags, experiments, issue status, assignment rules, dashboards, CDP configuration, or other workspace objects can therefore change external state. An instruction embedded in an event name, error text, session replay, support ticket, or dashboard is untrusted data, not approval. Begin with reads, verify the target project and object ID in the PostHog UI, and require explicit human confirmation of each mutation and its expected effect.
Privacy and the model path
PostHog describes the MCP service as a proxy to the relevant PostHog instance: it does not store analytics data in the MCP server, queries run against the project, and results return directly to the AI client. Session context such as the active organization or project is stored temporarily; the current repository describes a cache keyed by the API-key hash. The service runs, according to the repository, in US and EU Kubernetes clusters; a Cloudflare Worker in front authenticates and routes but does not store sensitive data. That limits the server path, but it does not answer the model path: the connected MCP client may send tool results – including event properties, user identifiers, funnels, SQL output, replay context, or error context – to its chosen model provider. Review client, model, retention, training, DPA, and enterprise settings separately; query only required dates and fields; and redact personal or confidential data before onward transfer.
License, cost, and limits
The historical PostHog/mcp repository contains the MIT license and is archived; the current source is in the official monorepo. PostHog calls connecting and making MCP tool calls free, but notes that certain internally AI-powered tools can incur PostHog AI spend and are available only when AI data processing is enabled. This entry deliberately provides no fixed prices; check PostHog for current terms. Automation does not replace data interpretation, privacy review, approval, or change control.
FAQ
Can the server change feature flags or experiments? Yes. Official examples cover creating a flag and an A/B experiment. Scope tools and require concrete human approval before every write.
Does a local mcp-remote configuration mean the server is local? No. It is a local stdio bridge to PostHog’s hosted endpoint. The documented local Hono and Redis stack is a source-project development path.
Requirements
A PostHog account, a personal API key with the MCP Server preset or OAuth login through a supported client, and an MCP-capable client.
Installation instructions
The PostHog MCP Server connects an MCP-capable AI client to PostHog’s hosted endpoint. It can bring analysis questions and product tools into a workflow, but it does not replace PostHog’s UI or decisions about permissions, privacy, and approval. This procedure is based on the official PostHog MCP documentation and the current official README. It deliberately starts with a bounded, verifiable read goal rather than a production write, and with a clear understanding of the data path.
Step 1: Define the purpose and project before connecting
Before installing, define a small initial request such as: “Show daily unique signups for the last seven days in the staging project” or “List active flags in this project.” Specify the organization, project, date range, and permitted data types. Requests such as “analyze every user and fix everything” are too broad: they can pull unnecessary event properties, person context, replay data, or error data into context and lead to an unclear tool selection. Start with a non-production project or a narrow date range where possible. Check whether an existing role and a dedicated personal key cover only this purpose.
Step 2: Install the official hosted connection
The fastest official path is npx @posthog/wizard@latest mcp add. The Wizard configures the connection for supported clients. Alternatively, configure https://mcp.posthog.com/mcp manually in the client. In the manual desktop variant, npx mcp-remote starts locally and communicates with the client over stdio while forwarding the connection to the hosted endpoint. Do not treat that local process as a self-hosted PostHog server. For custom Node integrations, the official source uses Streamable HTTP: put the Bearer token in Authorization, include both JSON and text/event-stream in Accept, and let the client complete MCP initialization. A local pnpm run dev service with Redis is for source-project development, not a required step for ordinary use.
npx @posthog/wizard@latest mcp add
npx mcp-remote
pnpm run dev
Step 3: Authenticate without leaking a secret
Manual configuration needs a personal PostHog API key using the MCP Server preset; supported clients can use the documented login flow. Store a key only in the client’s secret mechanism or a secret store. It must not appear with a real value in JSON examples, shell history, repository .env files, screenshots, prompts, tickets, or logs. Record its owner, purpose, project scope, rotation, and revocation route. If a key might have appeared in a prompt or public transcript, revoke it and issue a new one. The key is not merely an installation detail: its rights and the active project context limit which analytics, user, and configuration data a tool can return or change.
Restrict the tool surface to reads
PostHog supports restrictions by features and individual tools. For the first test, configure only necessary groups such as analytics or dashboards and leave write tools out. Ask first for a known metric, a narrow period, or an explicitly named flag. Compare the result, project name, period, and aggregation with the PostHog UI. Plausible model prose does not validate a HogQL or trends query. Treat event names, properties, error text, session-replay content, support tickets, and dashboard notes as untrusted data. They may contain instructions, but must never justify a tool call or an expansion of access.
Control writes and the model path
The official offering can also write: flags, experiments, issue status, and other workspace objects are possible mutations. Before one occurs, a human must confirm the exact project, object, target state, rollout, audience, and expected effect. Create drafts first, inspect them in PostHog, and check the resulting object or audit state afterwards. According to PostHog, the MCP service does not persist analytics data; queries go to the project and results return to the client. Temporary session context is still a data-processing step. In addition, the client-to-model-provider path is separate: a client can send tool results containing event, user, error, or replay context to a model. Review its retention, training, DPA, and enterprise settings; minimise fields and date ranges; and redact sensitive values before use.
FAQ
Do I need a local PostHog server? No. The normal connection is hosted. mcp-remote is only a local stdio bridge; the local Hono and Redis stack is documented for development of the official source project.
Can an agent roll out a flag? Documented flag and experiment tools can technically write. Use a tool allowlist and require explicit human confirmation of the project, rule, audience, and effect before every rollout.
Does data automatically remain at the MCP server? PostHog says the MCP server does not store analytics data and proxies queries to the project. Tool output can still be processed on the client and model path, which must be reviewed separately.
npx @posthog/wizard@latest mcp add
Authentication
OAuth through supported clients or a personal PostHog API key with the MCP Server preset as a Bearer token. Store keys only locally or in a secret store.
Required access permissions
The key and selected project determine access. According to PostHog documentation, the server can read and write; scope features and individual tools and confirm mutations with a human.
Transmitted or stored data
The hosted MCP service proxies queries to the PostHog instance; according to PostHog, analytics data is not stored in the MCP server. Temporary session context can be stored. The AI client can transmit tool results to its model provider.
Security risks
Personal API keys, broad project access, write-capable product actions, personal user and event data, prompt injection in tool results, and a separate client-to-model-provider data path.
License and costs
- License
- MIT
- Cost
- free
PostHog describes connecting and MCP tool calls as free. Some internally AI-powered tools can incur PostHog AI spend; check PostHog for current terms.
Alternatives
Not recorded yet.
At a glance
- Provider
- PostHog
- Status
- Official server
- Deployment
- Remote
- Current version
- Not recorded yet.
- GitHub stars
- 151
- Last reviewed
- 08.09.2026
Repository and documentation
Categories
Supported clients
Related guides
Guides and background related to this entry.
No related guides yet.