{"id":50834343,"url":"https://github.com/friendlygeorge/posthog-mcp-server","last_synced_at":"2026-06-14T02:11:12.116Z","repository":{"id":362849150,"uuid":"1260978069","full_name":"friendlygeorge/posthog-mcp-server","owner":"friendlygeorge","description":"MCP server for PostHog — product analytics, events, persons, dashboards, feature flags, experiments. 13 tools.","archived":false,"fork":false,"pushed_at":"2026-06-06T06:55:44.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-06T08:20:29.109Z","etag":null,"topics":["ai-tools","mcp","model-context-protocol","posthog","product-analytics"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/friendlygeorge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-06T05:00:20.000Z","updated_at":"2026-06-06T06:55:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/friendlygeorge/posthog-mcp-server","commit_stats":null,"previous_names":["friendlygeorge/posthog-mcp-server"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/friendlygeorge/posthog-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlygeorge%2Fposthog-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlygeorge%2Fposthog-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlygeorge%2Fposthog-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlygeorge%2Fposthog-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/friendlygeorge","download_url":"https://codeload.github.com/friendlygeorge/posthog-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/friendlygeorge%2Fposthog-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34306817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-tools","mcp","model-context-protocol","posthog","product-analytics"],"created_at":"2026-06-14T02:11:10.778Z","updated_at":"2026-06-14T02:11:12.108Z","avatar_url":"https://github.com/friendlygeorge.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostHog MCP Server\n\n\u003e Connect AI assistants to [PostHog](https://posthog.com/) — query events, persons, insights, dashboards, feature flags, cohorts, and experiments through the Model Context Protocol.\n\nWorks with **Claude Desktop**, **Cursor**, **Windsurf**, **Cline**, **Continue**, and any MCP-compatible client.\n\n## Features\n\n| Tool | Description |\n|------|-------------|\n| `list_events` | Query events with filters (event name, person, date range, properties) |\n| `get_person` | Get a person (user) by distinct_id — properties, creation date, event count |\n| `list_persons` | Search and list persons with pagination |\n| `list_dashboards` | List all dashboards — names, tags, widget counts |\n| `get_dashboard` | Get a specific dashboard with its insights and widgets |\n| `execute_insight` | Execute a saved insight (trend, funnel, etc.) and get results |\n| `list_feature_flags` | List all feature flags — key, active status, rollout percentage |\n| `evaluate_feature_flag` | Evaluate a flag for a specific user and get variant value |\n| `list_cohorts` | List cohorts — name, type (dynamic/static/SQL), person count |\n| `list_experiments` | List A/B tests — name, status, feature flag, dates |\n| `get_experiment` | Get experiment results with variant data and statistical significance |\n| `list_actions` | List custom event actions/definitions |\n| `get_project_info` | Get project name, ID, settings, and data region |\n\n## Quick Start\n\n### 1. Get a PostHog API Key\n\nGo to **PostHog → Settings → Personal API Keys** and create a key with read access.\n\nOr visit: `https://your-instance.posthog.com/settings/user-api-keys`\n\n### 2. Configure your MCP client\n\n**Claude Desktop** — add to `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"posthog\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"posthog-mcp-server\"],\n      \"env\": {\n        \"POSTHOG_API_KEY\": \"phx_YOUR_API_KEY_HERE\",\n        \"POSTHOG_HOST\": \"https://us.i.posthog.com\",\n        \"POSTHOG_PROJECT\": \"YOUR_PROJECT_ID\"\n      }\n    }\n  }\n}\n```\n\n**Cursor** — add to MCP settings (`.cursor/mcp.json`):\n\n```json\n{\n  \"mcpServers\": {\n    \"posthog\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"posthog-mcp-server\"],\n      \"env\": {\n        \"POSTHOG_API_KEY\": \"phx_YOUR_API_KEY_HERE\",\n        \"POSTHOG_HOST\": \"https://us.i.posthog.com\",\n        \"POSTHOG_PROJECT\": \"YOUR_PROJECT_ID\"\n      }\n    }\n  }\n}\n```\n\n### 3. Run manually (for testing)\n\n```bash\n# Clone and build\ngit clone https://github.com/friendlygeorge/posthog-mcp-server.git\ncd posthog-mcp-server\nnpm install\nnpm run build\n\n# Run\nPOSTHOG_API_KEY=phx_... POSTHOG_PROJECT=12345 node dist/index.js\n```\n\n## Environment Variables\n\n| Variable | Required | Default | Description |\n|----------|----------|---------|-------------|\n| `POSTHOG_API_KEY` | ✅ | — | Your PostHog personal API key (`phx_...`) |\n| `POSTHOG_HOST` | ❌ | `https://us.i.posthog.com` | PostHog instance URL (use `https://eu.i.posthog.com` for EU) |\n| `POSTHOG_PROJECT` | ❌ | `\"\"` | Default project ID. If empty, must be specified per-call. |\n\n### Self-hosted PostHog\n\nIf you run PostHog on your own infrastructure, set `POSTHOG_HOST` to your instance URL:\n\n```\nPOSTHOG_HOST=https://posthog.yourcompany.com\n```\n\n## Example Queries\n\nOnce configured, ask your AI assistant:\n\n- *\"Show me the last 20 pageview events\"*\n- *\"Who are the most active users this week?\"*\n- *\"What's the status of our signup conversion experiment?\"*\n- *\"Is the new-checkout-flow feature flag enabled for user abc123?\"*\n- *\"Show me all active dashboards\"*\n- *\"Execute insight 42 and show me the trend\"*\n- *\"List all feature flags that are currently active\"*\n- *\"How many people are in the 'Power Users' cohort?\"*\n\n## API Reference\n\nThis server wraps the PostHog REST API (v1). Full documentation:\n\n- **PostHog API docs**: https://posthog.com/docs/api\n- **MCP protocol**: https://modelcontextprotocol.io\n- **PostHog**: https://posthog.com\n\n## Development\n\n```bash\nnpm install\nnpm run dev     # Build and run\nnpm run build   # Build only\nnpm start       # Run built output\n```\n\n## License\n\nMIT © Nova\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlygeorge%2Fposthog-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffriendlygeorge%2Fposthog-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffriendlygeorge%2Fposthog-mcp-server/lists"}