{"id":29554193,"url":"https://github.com/posthog/mcp","last_synced_at":"2025-08-09T14:17:11.972Z","repository":{"id":293331284,"uuid":"983687569","full_name":"PostHog/mcp","owner":"PostHog","description":"Official PostHog MCP Server 🦔","archived":false,"fork":false,"pushed_at":"2025-07-17T16:04:15.000Z","size":261,"stargazers_count":72,"open_issues_count":6,"forks_count":8,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-07-17T17:48:40.950Z","etag":null,"topics":["analytics","feature-flags","llms","mcp","mcp-server","posthog"],"latest_commit_sha":null,"homepage":"https://posthog.com","language":"TypeScript","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/PostHog.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}},"created_at":"2025-05-14T18:59:03.000Z","updated_at":"2025-07-17T16:04:17.000Z","dependencies_parsed_at":"2025-06-02T19:15:05.435Z","dependency_job_id":"9b9a73fe-5f21-4b7f-a8f4-9d5447e0864c","html_url":"https://github.com/PostHog/mcp","commit_stats":null,"previous_names":["posthog/mcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PostHog/mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fmcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fmcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fmcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fmcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PostHog","download_url":"https://codeload.github.com/PostHog/mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PostHog%2Fmcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265716309,"owners_count":23816354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["analytics","feature-flags","llms","mcp","mcp-server","posthog"],"created_at":"2025-07-18T07:08:28.574Z","updated_at":"2025-08-09T14:17:11.538Z","avatar_url":"https://github.com/PostHog.png","language":"TypeScript","funding_links":[],"categories":["پیاده‌سازی‌های سرور","Uncategorized","🌐 Web Development","Data Analysis \u0026 Exploration Mcp Servers"],"sub_categories":["💻 \u003ca name=\"developer-tools\"\u003e\u003c/a\u003eابزارهای توسعه‌دهنده","How to Submit"],"readme":"# PostHog MCP\n\n## Use the MCP Server\n\n### Quick install\n\nYou can install the MCP server automatically into popular clients by running the following command:\n\n```\nnpx @posthog/wizard@latest mcp add\n```\n\n### Manual install\n\n1. Obtain a personal API key using the MCP Server preset [here](https://app.posthog.com/settings/user-api-keys?preset=mcp_server).\n\n2. Add the MCP configuration to your desktop client (e.g. Cursor, Windsurf, Claude Desktop) and add your personal API key\n\n```json\n{\n  \"mcpServers\": {\n    \"posthog\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"-y\",\n        \"mcp-remote@latest\",\n        \"https://mcp.posthog.com/sse\",\n        \"--header\",\n        \"Authorization:${POSTHOG_AUTH_HEADER}\"\n      ],\n      \"env\": {\n        \"POSTHOG_AUTH_HEADER\": \"Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}\"\n      }\n    }\n  }\n}\n```\n\n### Using EU cloud or self-hosted instances\n\nIf you're using PostHog EU cloud or a self-hosted instance, you can specify a custom base URL by adding the `POSTHOG_BASE_URL` [environment variable](https://developers.cloudflare.com/workers/configuration/environment-variables) when running the MCP server locally or on your own infrastructure, e.g. `POSTHOG_BASE_URL=https://eu.posthog.com`\n\n**Here are some examples of prompts you can use:**\n- What feature flags do I have active?\n- Add a new feature flag for our homepage redesign\n- What are my most common errors?\n\n\n# Development\n\nTo run the MCP server locally, run the following command:\n\n```\npnpm run dev\n```\n\nAnd replace `https://mcp.posthog.com/sse` with `http://localhost:8787/sse` in the MCP configuration.\n\n## Project Structure\n\nThis repository is organized to support multiple language implementations:\n\n- `typescript/` - TypeScript implementation (current)\n- `python/` - Python implementation (planned)\n- `schema/` - Shared schema files generated from TypeScript for cross-language compatibility\n\n### Development Commands\n\n- `pnpm run dev` - Start development server\n- `pnpm run schema:build:json` - Generate JSON schema for other language implementations\n- `pnpm run lint:fix` - Format and lint code\n\n### Environment variables\n\n- Create `.dev.vars` in the root\n- Add Inkeep API key to enable `docs-search` tool (see `Inkeep API key - mcp`)\n\n```\nINKEEP_API_KEY=\"...\"\n```\n\n\n### Configuring the Model Context Protocol Inspector\n\nDuring development you can directly inspect the MCP tool call results using the [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector). \n\nYou can run it using the following command:\n\n```bash\nnpx @modelcontextprotocol/inspector npx -y mcp-remote@latest http://localhost:8787/sse --header \"\\\"Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}\\\"\"\n```\n\nAlternatively, you can use the following configuration in the MCP Inspector:\n\nUse transport type `STDIO`.\n\n**Command:**\n\n```\nnpx\n```\n\n**Arguments:**\n\n```\n-y mcp-remote@latest http://localhost:8787/sse --header \"Authorization: Bearer {INSERT_YOUR_PERSONAL_API_KEY_HERE}\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthog%2Fmcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fposthog%2Fmcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fposthog%2Fmcp/lists"}