# PostHog

> PostHog is a freemium MCP server for analytics and data. Hosted MCP server that lets AI assistants query PostHog analytics, flags and errors. It runs as a hosted remote server, so there is nothing to install locally.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** API, CLI, VS Code, Web
- **Website:** https://posthog.com/docs/model-context-protocol
- **Repository:** https://github.com/posthog/posthog/tree/HEAD/services/mcp
- **MCP Registry name:** com.posthog/mcp
- **Categories:** [analytics and data](https://ai-powered.com/categories/analytics-and-data)
- **Listing updated:** 2026-11-23

## About

Connect an AI client such as Claude, Cursor or VS Code to PostHog and work with your product data through plain-language requests. The server runs as a hosted endpoint and exposes PostHog's tools for analytics queries, SQL, feature flags, experiments, error tracking and session replay, so an assistant can answer questions about your data or make changes without leaving the editor.

Setup is handled either by a one-line installer that writes the configuration into supported clients, or by adding the server URL manually with a personal API key. Access can be narrowed with feature filters, individual tool allowlists, and a choice between a full per-tool list or a single wrapper tool, which helps keep the tool list small for clients with schema limits.

Teams already using PostHog for analytics and debugging are the natural audience. Connecting the server is free; some tools that call LLMs internally may be billed as PostHog AI usage and only work when AI data processing is enabled in the organization settings.

## Features

- **Hosted MCP endpoint:** A remote streamable HTTP server that any MCP-compatible client can connect to without running local infrastructure.
- **Analytics and SQL queries:** Ask questions in plain text that are turned into trend, funnel and HogQL queries against your project data.
- **Feature flags and experiments:** Create and inspect flags and A/B tests from the assistant, including rollout percentages and variants.
- **Error investigation:** List top error groups, pull stack traces and update issue status or assignment from the editor.
- **Filterable tool surface:** Limit exposed tools by feature area or by name using URL parameters to keep the toolset focused.
- **Regional routing:** Authentication routes the connection to the US or EU region based on the account used to log in.

## Good for

- Triage production errors and open stack traces from inside an IDE
- Ask an assistant for weekly signup or conversion numbers without opening dashboards
- Create a feature flag with a percentage rollout from a prompt
- Set up an A/B test on a page and check its status
- Scope a read-only analytics assistant for a team by restricting the tool list

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add --transport http mcp https://mcp.posthog.com/mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "mcp": {
      "type": "http",
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

### Claude Desktop (Customize → Connectors → Add → Add custom connector)

```text
https://mcp.posthog.com/mcp
```

Paste this URL, choose how to sign in, then click Add and Connect. On Team and Enterprise an Owner adds it in Organization settings → Connectors.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp": {
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "mcp": {
      "type": "http",
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### ChatGPT (chatgpt.com → Plugins → + → Add custom MCP server)

```text
https://mcp.posthog.com/mcp
```

Paste this URL, set up sign-in, accept the warning and install the plugin. Then type @ in a chat to use it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add mcp --url https://mcp.posthog.com/mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.mcp]
url = "https://mcp.posthog.com/mcp"
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "mcp": {
      "httpUrl": "https://mcp.posthog.com/mcp"
    }
  }
}
```

Or run: gemini mcp add -s user --transport http mcp https://mcp.posthog.com/mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp": {
      "serverUrl": "https://mcp.posthog.com/mcp"
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp": {
      "url": "https://mcp.posthog.com/mcp",
      "transport": "http"
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "mcp": {
      "type": "streamableHttp",
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "mcp": {
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "mcp": {
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "mcp": {
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "mcp": {
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Grok Bot (Grok Bot desktop app → Connect apps → Add a custom connector)

```sh
https://mcp.posthog.com/mcp
```

Enter a Name (for example "PostHog"), choose Type: Remote HTTPS, paste this as the Server URL and choose Add plugin.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp": {
      "type": "http",
      "url": "https://mcp.posthog.com/mcp"
    }
  }
}
```

## FAQ

### Is the PostHog MCP server free to connect?

Connecting to the server and calling its tools is free, but some tools use LLMs internally and may be billed as PostHog AI spend.

### Which clients can use PostHog?

It works with any MCP-compatible client, including Claude Code, Claude Desktop, Cursor, Codex, VS Code, Windsurf and Zed.

### How do I authenticate?

You can use a personal API key sent as a Bearer token, or go through the PostHog login flow that routes you to the correct region.

### Can I limit which tools the assistant can use?

Yes. Add the features or tools query parameters to the server URL to expose only selected tool groups or named tools.

### How do I add PostHog to Claude Code?

Run this command in your terminal: claude mcp add --transport http mcp https://mcp.posthog.com/mcp

### What are the best alternatives to PostHog?

The closest alternatives to PostHog are PostHog MCP Server, Posthog MCP Server, Posthog, Indie Metrics MCP and Engageable Analytics.

## Where this comes from

- Description: written from the project's README, the project's website and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [PostHog MCP Server](https://ai-powered.com/mcp/posthog-mcp-server): PostHog MCP Server is an open-source MCP server for analytics and data.
- [Posthog MCP Server](https://ai-powered.com/mcp/posthog-mcp-server-2): Posthog MCP Server is an open-source MCP server for analytics and data.
- [Posthog](https://ai-powered.com/mcp/posthog-2): Posthog is an open-source MCP server for analytics and data.
- [Indie Metrics MCP](https://ai-powered.com/mcp/indie-metrics-mcp): Indie Metrics MCP is an open-source MCP server for analytics and data.
- [Engageable Analytics](https://ai-powered.com/mcp/engageable-analytics): Engageable Analytics is an open-source MCP server for analytics and data.
- [Hackle](https://ai-powered.com/mcp/hackle): Hackle is an MCP server for analytics and data.
- [Hoot Lens](https://ai-powered.com/mcp/hoot-lens): Hoot Lens is a freemium MCP server for analytics and data.
- [Social Media Analytics](https://ai-powered.com/mcp/social-media-analytics): Social Media Analytics is a freemium MCP server for marketing and seo.

---
Source: https://ai-powered.com/mcp/posthog-3
