PostHog MCP Server

by Shudufhadzo
Verified

Integrations

  • Enables interaction with PostHog analytics, allowing users to list projects, create annotations with optional timestamps, view and search for insights, and retrieve detailed information about specific insights.

Liquidium MCP 服务器

一个模型上下文协议 (MCP) 服务器,用于通过 Liquidium 与 PostHog 分析进行交互。直接通过 Claude Desktop 或 Smithery 创建注释并管理项目!

特征

  • 列出项目:查看组织中所有可用的 PostHog 项目
  • 创建注释:使用可选时间戳向您的 PostHog 项目添加注释
  • 列出和搜索洞察:查看和搜索 PostHog 项目中的洞察
  • 获取洞察详情:查看有关特定洞察的详细信息

设置

选项 1:Smithery(推荐)

使用 Liquidium MCP 最简单的方法是通过 Smithery:

  1. 在 Smithery 上访问 Liquidium MCP
  2. 点击“添加到克劳德”
  3. 出现提示时输入您的 PostHog API 密钥
  4. 开始在 Claude 中使用 Liquidium 工具!

选项 2:本地安装

  1. 先决条件
    • Python 3.10 或更高版本
    • pipuv包管理器
    • 从您的项目设置中获取带有annotation:writeproject:read范围的 PostHog API 密钥
  2. 安装
    # clone the repo git clone https://github.com/Shudufhadzo/liquidium-mcp.git cd liquidium-mcp # Create and activate virtual environment python -m venv .venv # On Windows .venv\Scripts\activate # On macOS/Linux source .venv/bin/activate # Install dependencies pip install -e .
  3. 配置
    • 在项目根目录中创建一个.env文件:
      PERSONAL_API_KEY=phx_your_posthog_api_key_here
  4. Claude 桌面设置
    • 安装Claude Desktop
    • 打开 Claude Desktop 设置,然后点击“编辑配置”。或者,您也可以从以下位置打开文件:
      • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
      • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • 将其添加到您的claude_desktop_config.json (根据您的系统调整路径):
      { "mcpServers": { "posthog": { "command": "/path/to/python", # Get this by running: which python "args": [ "-m", "posthog_mcp", "--directory", "/path/to/your/posthog-mcp" # Full path to this project ] } } }
      如果您遇到任何问题,请查看有关将 Claude Desktop 设置为 MCP 客户端的最新文档

用法

安装完成后,您会在 Claude Desktop 中看到一个锤子图标。您可以使用以下命令:

列出项目

问克劳德:

"List my PostHog projects"

获取并搜索见解

问克劳德:

“列出我的 PostHog 洞察”或“在我的 PostHog 中搜索收入洞察”

在线搜索文档

您可以询问:

  • “如何在 posthog 中的 nextjs 中进行反向代理?”

创建注释

使用从项目列表中获取的项目 ID,询问 Claude:

"Create a PostHog annotation in project 53497 saying 'Deployed v1.2.3'"

或者指定具体日期:

"Create a PostHog annotation in project 53497 for March 20th saying 'Started new marketing campaign'"

故障排除

  • 如果没有出现锤子图标,请重新启动 Claude Desktop
  • 检查~/Library/Logs/Claude/mcp*.log (macOS) 或%APPDATA%\Claude\logs (Windows) 中的日志
  • 验证您的 PostHog API 密钥是否具有正确的权限
  • 确保claude_desktop_config.json中的所有路径都是绝对路径

贡献

欢迎随时提交问题和 PR!我们遵循 PostHog 的贡献指南。

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

该服务器允许用户通过 Claude Desktop 与 PostHog 分析平台进行交互,从而可以列出项目、创建注释、搜索见解和访问文档。

  1. Features
    1. Setup
      1. Option 1: Smithery (Recommended)
      2. Option 2: Local Installation
    2. Usage
      1. List Projects
      2. Get and Search for Insights
      3. Search for documentations online
      4. Create Annotation
    3. Troubleshooting
      1. Contributing
        ID: tq7l8hq73v