
How to add PostHog MCP Server (Official Remote) to Cursor
Official PostHog server: product analytics, feature flags, experiments, error tracking and SQL. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 15, 2026 · 350★ · stdio · apikey · official
Cursor config for PostHog MCP Server (Official Remote)
npx @posthog/wizard@latest mcp add{
"mcpServers": {
"posthog-mcp-server-official-remote": {
"command": "npx",
"args": [
"-y",
"mcp-remote@latest",
"https://mcp.posthog.com/mcp",
"--header",
"Authorization:${POSTHOG_AUTH_HEADER}"
],
"env": {
"POSTHOG_AUTH_HEADER": "Bearer <your-personal-api-key>"
}
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the PostHog MCP Server (Official Remote) config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of PostHog MCP Server (Official Remote)'s tools to confirm it's connected.
Before you start
- A PostHog account (PostHog Cloud US or EU)
- A PostHog personal API key, created under Settings → Personal API keys; the key is passed as a Bearer token in the POSTHOG_AUTH_HEADER
- An MCP-compatible client (Claude Desktop/Code, Cursor, VS Code, Windsurf, Zed, etc.)
- Node.js (for the npx wizard installer) when using local stdio setup; the remote server needs no local runtime
- Optional: AI data processing enabled in PostHog for LLM-powered tools (e.g. natural-language SQL)
What PostHog MCP Server (Official Remote) can do in Cursor
feature-flag-get-allList all feature flags in the project, with create/update/delete and status tools
create-feature-flagCreate a new feature flag, including rollout and targeting conditions
insight-queryRun an insight/trend query and return product-analytics results
execute-sqlRun a HogQL/SQL query against PostHog event and warehouse data
dashboard-createCreate dashboards and add insight tiles (with get/update/delete tools)
experiment-createCreate A/B experiments; launch, pause, end, and read results
experiment-results-getFetch statistical results and timeseries for a running experiment
query-error-tracking-issues-listList error-tracking issues; fetch issue details, events, and merge/triage
Security
The personal API key is sent as a Bearer token and can read analytics, feature flags, and error data; scope it tightly and rotate it if exposed. The connection goes out to PostHog Cloud, so confirm you log in with the correct US/EU region account to keep data in-region.
PostHog MCP Server (Official Remote) + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the PostHog MCP Server (Official Remote) config there under the "mcpServers" key and restart the client.
Is PostHog MCP Server (Official Remote) safe to use with Cursor?
The personal API key is sent as a Bearer token and can read analytics, feature flags, and error data; scope it tightly and rotate it if exposed. The connection goes out to PostHog Cloud, so confirm you log in with the correct US/EU region account to keep data in-region.
Is this the official PostHog MCP server?
Yes. It is built and maintained by PostHog. The standalone PostHog/mcp repo was archived in January 2026 and the code now lives in the PostHog monorepo, but it is still the official, supported server.
Do I need to run anything locally?
No. The recommended setup is the hosted remote server at https://mcp.posthog.com/mcp. The npx wizard just writes the config into your client; the remote endpoint handles execution and region routing.
How do I authenticate?
Create a PostHog personal API key and pass it as a Bearer token in the POSTHOG_AUTH_HEADER. The wizard sets this up for you.