OpenPanel

Open-source Mixpanel alternative with session replay, MCP integration, and privacy-first product analytics you fully control.

6.1Kstars
389forks
GNU AGPLv3
TypeScript

OpenPanel is an open-source web and product analytics platform that delivers the depth of Mixpanel combined with the simplicity of Plausible—without vendor lock-in. It provides funnels, cohort analysis, user profiles, session replay, A/B testing, and real-time dashboards, all with cookieless tracking and GDPR-compliant data handling. Developers and product teams can self-host it on their own infrastructure or use the managed cloud offering with EU-based servers.

The platform covers web, mobile (iOS, Android via Kotlin SDK), React Native, and server-side tracking through an expanding SDK ecosystem. Revenue tracking, Google Search Console integration, and smart funnel notifications round out the feature set, making it suitable for SaaS products, e-commerce sites, and content publishers alike.

A standout addition is the built-in MCP (Model Context Protocol) server that exposes 38 analytics tools to AI assistants like Claude and Cursor—allowing teams to query user behavior, funnels, session data, and retention metrics through natural language without writing SQL or opening the dashboard. This brings analytics directly into developer and AI workflows in a way no comparable open-source tool currently offers.

What You Get

  • Advanced Funnels and Cohorts - Define multi-step conversion funnels and retention cohorts with breakdowns by device, country, referrer, or custom event properties.
  • Session Replay with Privacy Controls - Record and replay full user sessions including clicks, scrolls, and rage clicks; built-in masking prevents sensitive data from being captured.
  • Real-time Dashboards - Live-updating charts and metric panels that reflect incoming events with no data sampling, delayed aggregation, or refresh cycles.
  • Built-in A/B Testing - Run variant experiments and analyze results broken down by conversion rate, cohort, geography, or device type without a separate testing tool.
  • MCP Server for AI Assistants - 38 analytics tools exposed over the Model Context Protocol so Claude, Cursor, or any MCP client can query users, sessions, funnels, and retention through natural language.
  • Smart Event Notifications - Configure email alerts triggered by completed funnels, revenue milestones, or custom event thresholds to surface critical moments automatically.
  • Revenue Tracking and LTV - Track purchases, subscriptions, and lifetime value alongside behavioral events to correlate product decisions with monetary outcomes.
  • Multi-Platform SDKs - Official SDKs for Web, Next.js, Nuxt, Astro, Express, iOS (Swift), Android (Kotlin), and React Native with full TypeScript types and tree-shaking.
  • Google Search Console Integration - Enrich analytics with organic search data—keyword rankings, page impressions, and GSC cannibalization reports—directly in the dashboard.
  • Self-Hosted Docker Deployment - A complete Docker Compose stack with Fastify API, ClickHouse, Postgres, Redis, and BullMQ that can be stood up from a single configuration file.

Common Use Cases

  • SaaS retention analysis - A product team tracks Day 1, Day 7, and Day 30 cohort retention and uses session replay to diagnose where newly activated users drop off before reaching the aha moment.
  • GDPR-compliant analytics migration - A European company replaces Google Analytics 4 (which has been banned by several EU data authorities) with OpenPanel’s cookieless, self-hosted stack to maintain compliance without sacrificing funnel depth.
  • AI-assisted product insights - An engineering team connects OpenPanel’s MCP server to their Claude workspace and asks natural-language questions about user flows, peak traffic windows, and conversion drops without leaving their editor.
  • E-commerce revenue attribution - An online store correlates Google Search Console keyword data with purchase events and subscription MRR to identify which organic queries generate the highest LTV customers.
  • Mobile app behavior tracking - A mobile-first startup uses the iOS and Android SDKs to capture screen views, feature usage, and in-app purchase events in the same dashboard as their web product.
  • Startup pitch deck metrics - A founder self-hosts OpenPanel to maintain verifiable, exportable event data that can demonstrate DAU, activation rate, and retention curves to investors without relying on third-party platform screenshots.

Under The Hood

Architecture OpenPanel is structured as a TypeScript monorepo with a clean separation between a Fastify-powered event ingestion API and a Next.js dashboard, each pulling from shared packages for database access, authentication, queuing, and analytics logic. The API layer handles HTTP routing, rate limiting, compression, and WebSocket connections through discrete Fastify plugins, while tRPC provides a type-safe RPC layer between the dashboard and backend without manual REST contract maintenance. A multi-database persistence model deliberately separates concerns: Postgres via Prisma handles transactional data (users, projects, dashboards, conversations), ClickHouse absorbs high-volume event streams for analytical queries, and Redis underpins caching, pub/sub, and BullMQ job queues. An embedded MCP server package exposes 38 pre-built analytics tools that mount directly onto the API, giving AI assistants structured access to the same analytical queries the dashboard uses.

Tech Stack The runtime is Node.js with TypeScript throughout, using Fastify as the HTTP framework and Next.js 15 with React 19 for the dashboard including server components and streaming. Data persistence is split across Prisma ORM with PostgreSQL for relational storage, ClickHouse for time-series event data, and Redis with ioredis for caching and queue management. The queue layer uses BullMQ for individual jobs and a custom GroupMQ package for batched event processing. Email is handled by Resend, OAuth by Arctic, and authentication sessions by Oslo. The build toolchain is pnpm workspaces with Biome for linting and formatting, tsdown for API bundling, and Vitest for testing. The MCP integration uses the official Model Context Protocol SDK, and an embedded LLM agent capability uses the better-agent framework with support for multiple OpenAI-compatible models.

Code Quality The codebase maintains comprehensive type safety through strict TypeScript configurations across all packages, with Prisma’s generated client providing end-to-end typed database access and tRPC ensuring type-consistent API contracts. Testing is present across core packages—including integration tests for insights routes that run against a real ClickHouse and Postgres instance, unit tests for MCP tool handlers, session management, payment state machines, and data importers—though coverage is uneven across the surface area. Biome enforces consistent formatting and import organization across the entire monorepo, and pre-push hooks run the full typecheck and test suite. Error handling is explicit throughout the API layer, with structured logging via pino and graceful shutdown sequences. The JS runtime sandbox actively validates and restricts dangerous operations, protecting multi-tenant execution contexts.

What Makes It Unique The most distinctive technical choice is the native MCP server integration that exposes the full analytics API—active users, funnels, retention, session data, profiles, GSC metrics, and dashboard links—as first-class tools for AI assistants, enabling a conversational analytics workflow with no custom integration work. The second differentiator is the embedded LLM agent within the dashboard itself: a multi-model chat interface backed by better-agent that can query the same ClickHouse data the dashboard visualizes, using project context and conversation memory stored in Postgres. Together these create a layered AI surface area—external MCP clients and internal chat—on top of a conventional analytics platform, separating OpenPanel from every other open-source analytics tool currently available.

Self-Hosting

OpenPanel is released under the GNU Affero General Public License v3.0 (AGPL-3.0). This is a strong copyleft license: you can run, modify, and distribute OpenPanel freely, but any modifications to the source code that you deploy over a network must also be made available under AGPL-3.0. For most teams self-hosting internally for their own product analytics this copyleft obligation is not triggered, but SaaS providers who modify and resell OpenPanel as a service would need to open-source their changes. Commercial use of the unmodified software is permitted. The trademark policy (TRADEMARK.md) separately restricts use of the OpenPanel name and logo in derivative products.

Operationally, self-hosting OpenPanel requires running five services: the Fastify API, the Next.js dashboard, Postgres, ClickHouse, and Redis. Docker Compose configuration and a semi-automated setup script are provided, making initial deployment accessible, but maintaining this stack in production means managing database backups, ClickHouse storage growth (event volume can be significant), Redis persistence, certificate renewal via Caddy, and rolling updates across all services. ClickHouse in particular has a higher operational floor than a simple SQL database—its memory and disk requirements grow with data volume and query concurrency. Teams without dedicated DevOps resources may underestimate this ongoing burden.

The managed cloud offering at openpanel.dev provides a free tier with all core features, no usage caps, and no credit card requirement, with EU-based infrastructure and GDPR compliance handled by the OpenPanel team. Compared to self-hosting, the cloud tier adds managed upgrades, guaranteed availability, built-in backups, and access to support channels—all of which are the operator’s responsibility when self-hosting. There is no formally published paid enterprise tier with SLAs or SSO, though the payments package and subscription state machine in the codebase indicate this infrastructure exists. Teams evaluating self-hosting should budget time for infrastructure provisioning, ClickHouse tuning, and establishing backup and alerting pipelines before going to production.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search