> **πŸš€ Don't want to self-host?** [Join the waitlist for our fully managed solution β†’](https://mcpengage.com/product-analytics) > > Zero setup. Zero maintenance. Just connect and automate. --- # πŸš€ Product Analytics MCP Server β€” 2026 Complete Version ## πŸ’‘ What This Unlocks **This MCP server gives AI direct access to your entire product analytics stack.** Query Mixpanel, Amplitude, and PostHog from a single unified interfaceβ€”no more switching between dashboards. Instead of clicking through analytics platforms and copying CSV exports, just *tell* your AI what insights you need. It queries all three platforms, correlates data, and gives you actionable answers. ### 🎯 Analytics Power Moves Stop context-switching between analytics tools. The AI can directly query your entire stack: 1. **Cross-platform funnel analysis** β€” "Compare signupβ†’activation funnels between Mixpanel and Amplitude for the past 30 days" 2. **Unified cohort intelligence** β€” "Show me retention curves for users who tried feature X in PostHog vs Amplitude cohorts" 3. **Real-time feature flag monitoring** β€” "List all PostHog feature flags and show user count in each variant" 4. **Power-user segmentation** β€” "Find Mixpanel users with 10+ sessions this week, check their Amplitude engagement scores, and export as cohort" 5. **Custom query synthesis** β€” "Run this HogQL query in PostHog and this JQL script in Mixpanel, compare results side-by-side" ### πŸ”— The Real Power: Combining Tools AI can orchestrate complex multi-platform analytics workflows: - Query Mixpanel events β†’ Segment by property β†’ Export to Amplitude cohort β†’ Track PostHog feature flag performance - HogQL power query β†’ JQL custom script β†’ Amplitude chart lookup β†’ Synthesize insights across platforms - Compare retention curves β†’ Identify top-performing cohorts β†’ Deep-dive into user profiles β†’ Generate strategic recommendations - Monitor feature flags β†’ Query adoption metrics β†’ Funnel breakdown β†’ Automated performance reports ## πŸ“¦ What's Inside **20 powerful API tools** covering Mixpanel, Amplitude, and PostHog: ### Mixpanel (7 tools) 1. **query_mixpanel_segmentation** β€” Event analysis over time with property breakdowns 2. **query_mixpanel_funnels** β€” Multi-step conversion funnel analysis 3. **query_mixpanel_retention** β€” Cohort retention and birth/compounded analysis 4. **get_mixpanel_user_profile** β€” Individual user profile lookup 5. **query_mixpanel_jql** β€” Custom JQL (JavaScript Query Language) queries 6. **export_mixpanel_events** β€” Raw event export with filters 7. **list_mixpanel_events** β€” Event catalog and taxonomy ### Amplitude (6 tools) 8. **query_amplitude_segmentation** β€” Event segmentation with custom metrics 9. **get_amplitude_user_activity** β€” User event stream and activity history 10. **list_amplitude_cohorts** β€” All saved cohorts in project 11. **get_amplitude_cohort** β€” Cohort details and member list 12. **query_amplitude_charts** β€” Saved chart data retrieval 13. **get_amplitude_taxonomy** β€” Event and property taxonomy ### PostHog (7 tools) 14. **query_posthog_events** β€” Event queries with advanced filters 15. **get_posthog_person** β€” Person profile by ID or distinct_id 16. **list_posthog_feature_flags** β€” All feature flags and variants 17. **query_posthog_insights** β€” Trends, funnels, retention, paths analysis 18. **query_posthog_hogql** β€” Custom HogQL (SQL-like) queries 19. **list_posthog_annotations** β€” Project annotations and markers All with proper error handling, automatic authentication, and TypeScript types. **API Foundations:** - [Mixpanel Query API](https://developer.mixpanel.com/reference/query-api) (REST) - [Amplitude Analytics API](https://www.docs.developers.amplitude.com/analytics/) (REST) - [PostHog API](https://posthog.com/docs/api) (REST + HogQL) ## πŸš€ Quick Start ### Option 1: Claude Desktop (Local) 1. **Clone and build:** ```bash git clone https://github.com/BusyBee3333/Product-Analytics-MCP-2026-Complete.git cd product-analytics-mcp-2026-complete npm install npm run build ``` 2. **Get your API credentials:** **Mixpanel:** - Log into [Mixpanel](https://mixpanel.com/) - Go to **Settings β†’ Project Settings β†’ Service Accounts** - Create service account with query permissions - Copy Project ID and Secret **Amplitude:** - Log into [Amplitude](https://amplitude.com/) - Go to **Settings β†’ Projects β†’ [Your Project]** - Copy API Key and Secret Key from **General** tab **PostHog:** - Log into [PostHog](https://app.posthog.com/) - Go to **Project Settings β†’ API Keys** - Create Personal API Key - Copy API Key and Project ID 3. **Configure Claude Desktop:** On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` On Windows: `%APPDATA%\Claude\claude_desktop_config.json` ```json { "mcpServers": { "product-analytics": { "command": "node", "args": ["/ABSOLUTE/PATH/TO/product-analytics-mcp-2026-complete/dist/index.js"], "env": { "MIXPANEL_PROJECT_ID": "your_project_id", "MIXPANEL_SERVICE_ACCOUNT_SECRET": "your_secret", "AMPLITUDE_API_KEY": "your_api_key", "AMPLITUDE_SECRET_KEY": "your_secret_key", "POSTHOG_API_KEY": "phx_...", "POSTHOG_PROJECT_ID": "12345" } } } } ``` **Note:** You can configure just one platform or all three. The server auto-detects available credentials and enables tools accordingly. 4. **Restart Claude Desktop** ### Option 2: Deploy to Railway [![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/product-analytics-mcp) 1. Click the button above 2. Set environment variables for platforms you want to use 3. Use the Railway URL as your MCP server endpoint ### Option 3: Docker ```bash docker build -t product-analytics-mcp . docker run -p 3000:3000 \ -e MIXPANEL_PROJECT_ID=your_project_id \ -e MIXPANEL_SERVICE_ACCOUNT_SECRET=your_secret \ -e AMPLITUDE_API_KEY=your_api_key \ -e AMPLITUDE_SECRET_KEY=your_secret_key \ -e POSTHOG_API_KEY=phx_... \ -e POSTHOG_PROJECT_ID=12345 \ product-analytics-mcp ``` ## πŸ” Authentication ### Mixpanel - **Auth method:** Basic auth (service account) - **Format:** `project_id:secret` (base64) - **Required env vars:** `MIXPANEL_PROJECT_ID`, `MIXPANEL_SERVICE_ACCOUNT_SECRET` - **Endpoints:** Query API (https://mixpanel.com/api/2.0) and Ingestion API (https://api.mixpanel.com) - **Rate limits:** Varies by plan (typically 60 req/hour for free, higher for paid) ### Amplitude - **Auth method:** Basic auth (API key + secret) - **Format:** `api_key:secret_key` (base64) - **Required env vars:** `AMPLITUDE_API_KEY`, `AMPLITUDE_SECRET_KEY` - **Endpoints:** Dashboard API (https://amplitude.com/api/2) - **Rate limits:** 360 requests per hour (free/growth), higher for enterprise ### PostHog - **Auth method:** Bearer token (Personal API Key) - **Format:** `Bearer phx_...` - **Required env vars:** `POSTHOG_API_KEY`, `POSTHOG_PROJECT_ID` - **Endpoints:** Cloud API (https://app.posthog.com/api/) or self-hosted - **Rate limits:** 480 requests per minute (cloud), unlimited (self-hosted) The MCP server handles all authentication automaticallyβ€”just set the environment variables. ## 🎯 Example Prompts for Product Teams Once connected to Claude, use natural language. Here are real product analytics workflows: ### Cross-Platform Analysis - *"Compare signup funnel conversion rates between Mixpanel and Amplitude for the last 30 days"* - *"Show me PostHog feature flag 'new-onboarding' adoption vs Mixpanel activation event counts"* - *"Query retention in all three platforms for users who signed up in January 2026"* ### Power User Workflows - *"Run this JQL script in Mixpanel: [paste script]. Then find those users in Amplitude and show their activity"* - *"Export all Mixpanel events for 'purchase_completed' last week, cross-reference with PostHog person properties"* - *"List all PostHog insights of type FUNNELS, then recreate the top one in Mixpanel for comparison"* ### Cohort & Segmentation - *"Show me all Amplitude cohorts with 'power_user' in the name, get their IDs, query Mixpanel for their event volumes"* - *"Find Mixpanel users with 10+ sessions this month, check if they exist in PostHog, list their feature flag exposure"* - *"Get PostHog persons who triggered event X, look up their profiles in Mixpanel, summarize common properties"* ### Custom Queries - *"Run this HogQL query in PostHog: SELECT * FROM events WHERE event = 'signup' AND timestamp > now() - INTERVAL 7 DAY"* - *"Execute Mixpanel segmentation for 'page_view' event, group by $browser, last 14 days"* - *"Query Amplitude event taxonomy, filter for events containing 'checkout', show me property schemas"* ### Feature Flag Intelligence - *"List all PostHog feature flags, show rollout percentage and user counts for each variant"* - *"Check PostHog feature flag 'beta_feature' exposure, query Mixpanel for event counts from exposed users"* - *"Find users in PostHog flag 'experiment_v2' variant B, get their Amplitude retention data"* ### Real-Time Monitoring - *"Export Mixpanel events from the last hour, filter for errors, check if affected users are in Amplitude"* - *"Query PostHog events for 'payment_failed' in the last 24h, get user profiles from all platforms"* - *"Check Amplitude user activity for user_id X, then query their full event stream in Mixpanel"* ## πŸ› οΈ Development ### Prerequisites - Node.js 18+ - npm or yarn - Accounts on Mixpanel, Amplitude, and/or PostHog ### Setup ```bash git clone https://github.com/BusyBee3333/Product-Analytics-MCP-2026-Complete.git cd product-analytics-mcp-2026-complete npm install cp .env.example .env # Edit .env with your API credentials npm run build npm start ``` ### Testing ```bash npm test # Run all tests npm run test:watch # Watch mode npm run test:coverage # Coverage report ``` ### Project Structure ``` product-analytics-mcp-2026-complete/ β”œβ”€β”€ src/ β”‚ └── index.ts # Main server implementation β”‚ # - MixpanelClient β”‚ # - AmplitudeClient β”‚ # - PostHogClient β”‚ # - 20 tool definitions β”‚ # - Handler routing β”œβ”€β”€ dist/ # Compiled JavaScript β”œβ”€β”€ package.json β”œβ”€β”€ tsconfig.json └── .env.example ``` ## πŸ› Troubleshooting ### "Mixpanel API error: 401" - Verify service account credentials are correct - Check that service account has query permissions - Ensure Project ID matches the secret's project ### "Amplitude API error: 403" - Confirm API Key and Secret Key are from the same project - Check that keys haven't been revoked or expired - Verify project access permissions ### "PostHog API error: 401" - Ensure Personal API Key is active (check Settings β†’ API Keys) - Verify Project ID is correct (visible in project settings URL) - Check that API key has project-level permissions ### "Rate limit exceeded" - Mixpanel: 60 req/hour (free), wait or upgrade plan - Amplitude: 360 req/hour (growth), wait or upgrade to enterprise - PostHog: 480 req/min (cloud), upgrade or use self-hosted ### "At least one analytics platform must be configured" - Set credentials for Mixpanel, Amplitude, OR PostHog - You don't need all threeβ€”server works with any combination - Verify environment variables are spelled correctly ### "Tools not appearing in Claude" - Restart Claude Desktop after updating config - Check that the path in `claude_desktop_config.json` is absolute (not relative) - Verify the build completed: `ls dist/index.js` - Check Claude Desktop logs: `tail -f ~/Library/Logs/Claude/mcp*.log` ### "Unknown tool error" - Ensure the tool name matches the platform you configured - Example: `query_mixpanel_segmentation` requires Mixpanel credentials - Check server startup logs for "Total tools available" count ## πŸ“– Resources - **[Mixpanel Query API Docs](https://developer.mixpanel.com/reference/query-api)** β€” Official API reference - **[Amplitude Analytics API Docs](https://www.docs.developers.amplitude.com/analytics/)** β€” Dashboard API guide - **[PostHog API Docs](https://posthog.com/docs/api)** β€” REST API and HogQL reference - **[MCP Protocol Spec](https://modelcontextprotocol.io/)** β€” How MCP servers work - **[Claude Desktop Docs](https://claude.ai/desktop)** β€” Installing and configuring Claude - **[MCPEngage Platform](https://mcpengine.pages.dev)** β€” Browse 30+ business MCP servers ## 🀝 Contributing Contributions are welcome! Please: 1. Fork the repo 2. Create a feature branch (`git checkout -b feature/retention-analysis`) 3. Commit your changes (`git commit -m 'Add cross-platform retention comparison'`) 4. Push to the branch (`git push origin feature/retention-analysis`) 5. Open a Pull Request ## πŸ“„ License MIT License - see [LICENSE](LICENSE) for details ## πŸ™ Credits Built by [MCPEngage](https://mcpengage.com) β€” AI infrastructure for business software. Want more MCP servers? Check out our [full catalog](https://mcpengage.com) covering 30+ business platforms including Segment, Google Analytics, Heap, and more. --- **Questions?** Open an issue or join our [Discord community](https://discord.gg/mcpengage).