PostHog Analytics MCP 远程 MCP 服务器 – 官方端点、工具列表与一键连接指南
PostHog 官方远程 MCP 服务器。使用个人 API Key,AI 代理可查询产品分析、洞察、Feature Flag 与 HogQL 数据。
本页收录其官方远程端点、传输协议、认证方式、全部工具 Schema、实时可用性拨测与安全审计结果,并为 Cursor、Claude Code、VS Code、ChatGPT 等 10 大客户端提供一键接入指引。
🔒 Client-side only — never leaves your browser.
Or add to ~/.cursor/mcp.json:
{
"mcpServers": {
"posthog": {
"url": "https://mcp.posthog.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}claude mcp add --transport http posthog https://mcp.posthog.com/mcp
With credential header:
claude mcp add --transport http posthog https://mcp.posthog.com/mcp --header "Authorization: Bearer YOUR_API_KEY"
Or add to .vscode/mcp.json:
{
"servers": {
"posthog": {
"type": "http",
"url": "https://mcp.posthog.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}- Open Settings → Connectors (Integrations) → Add Custom Connector.
- Paste the endpoint URL:
https://mcp.posthog.com/mcp - Provide your API key / Bearer token when prompted.
Bridge the remote endpoint into stdio with mcp-remote in claude_desktop_config.json:
{
"mcpServers": {
"posthog": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.posthog.com/mcp",
"--header",
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"posthog": {
"serverUrl": "https://mcp.posthog.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Add to ~/.kiro/settings/mcp.json (or .kiro/settings/mcp.json in your workspace), then reopen Kiro's Agent panel to pick up the server:
{
"mcpServers": {
"posthog": {
"url": "https://mcp.posthog.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Add to ~/.codex/config.toml — Codex reads remote HTTP servers from [mcp_servers.*] tables:
[mcp_servers.posthog] url = "https://mcp.posthog.com/mcp" bearer_token_env_var = "POSTHOG_TOKEN"
Add to cline_mcp_settings.json (Cline → MCP Servers → Configure), or paste it via Cline's MCP marketplace file:
{
"mcpServers": {
"posthog": {
"type": "streamableHttp",
"url": "https://mcp.posthog.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Add to ~/.gemini/settings.json under mcpServers — httpUrl for Streamable HTTP, url for legacy SSE:
{
"mcpServers": {
"posthog": {
"httpUrl": "https://mcp.posthog.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}🧰 PostHog Analytics MCP 工具与 Schema(39)
| Tool | Safety | Description | Parameters |
|---|---|---|---|
| organizations-get ~30 tok | 🟢 Read | List PostHog organizations. | — |
| projects-get ~28 tok | 🟢 Read | List PostHog projects. | — |
| project-get ~30 tok | 🟢 Read | Get details of a PostHog project. | — |
| project-property-definitions ~36 tok | 🟢 Read | List property definitions of a project. | — |
| docs-search ~29 tok | 🟢 Read | Search PostHog documentation. | — |
| query-run ~31 tok | 🟢 Read | Run a HogQL query against project data. | — |
| list-errors ~32 tok | 🟢 Read | List captured error-tracking exceptions. | — |
| error-details ~33 tok | 🟢 Read | Get details of an error-tracking exception. | — |
| dashboards-get-all ~30 tok | 🟢 Read | List PostHog dashboards. | — |
| dashboard-get ~29 tok | 🟢 Read | Get details of a dashboard. | — |
| dashboard-create ~30 tok | 🟠 Write | Create a PostHog dashboard. | — |
| dashboard-update ~28 tok | 🟠 Write | Update a dashboard. | — |
| dashboard-delete ~28 tok | 🔴 Destructive | Delete a dashboard. | — |
| dashboard-reorder-tiles ~31 tok | 🟠 Write | Reorder dashboard tiles. | — |
| insights-get-all ~29 tok | 🟢 Read | List PostHog insights. | — |
| insight-get ~29 tok | 🟢 Read | Get details of an insight. | — |
| insight-create-from-query ~33 tok | 🟠 Write | Create an insight from a query. | — |
| insight-update ~30 tok | 🟠 Write | Update an existing insight. | — |
| insight-delete ~27 tok | 🔴 Destructive | Delete an insight. | — |
| insight-query ~32 tok | 🟢 Read | Run an insight query and get results. | — |
| experiments-get-all ~31 tok | 🟢 Read | List A/B test experiments. | — |
| experiment-get ~30 tok | 🟢 Read | Get details of an experiment. | — |
| experiment-create ~29 tok | 🟠 Write | Create an experiment. | — |
| experiment-update ~29 tok | 🟠 Write | Update an experiment. | — |
| experiment-delete ~29 tok | 🔴 Destructive | Delete an experiment. | — |
| experiment-results-get ~35 tok | 🟢 Read | Get statistical results of an experiment. | — |
| feature-flag-get-all ~29 tok | 🟢 Read | List feature flags. | — |
| feature-flag-get-definition ~34 tok | 🟢 Read | Get a feature flag definition. | — |
| feature-flag-create ~30 tok | 🟠 Write | Create a feature flag. | — |
| feature-flag-update ~30 tok | 🟠 Write | Update a feature flag. | — |
| feature-flag-delete ~30 tok | 🔴 Destructive | Delete a feature flag. | — |
| surveys-get-all ~28 tok | 🟢 Read | List PostHog surveys. | — |
| survey-create ~27 tok | 🟠 Write | Create a survey. | — |
| survey-update ~27 tok | 🟠 Write | Update a survey. | — |
| survey-delete ~27 tok | 🔴 Destructive | Delete a survey. | — |
| llm-get-costs ~31 tok | 🟢 Read | Get LLM observability cost metrics. | — |
| cohorts-get-all ~26 tok | 🟢 Read | List cohorts. | — |
| cohort-get ~28 tok | 🟢 Read | Get details of a cohort. | — |
| cohort-create ~27 tok | 🟠 Write | Create a cohort. | — |
🛡️ 安全评级、质量与上下文 Token 审计
- No prompt-injection or hidden-character anomalies detected in tool descriptions
- Streamable HTTP primary endpoint (current 2025-03-26 transport)
- Static credential (Bearer token / API key) — protect it in client config
- Official first-party endpoint operated by the vendor
- Manually verified by RemoteMCP.net
🔐 OAuth 2.1 与安全
- 认证方式
- Bearer Token
- 动态客户端注册(DCR)
- —
- PKCE S256
- —
- 受保护资源元数据
- https://mcp.posthog.com/.well-known/oauth-protected-resource
📡 官方远程端点与传输协议
远程端点 https://mcp.posthog.com/mcp 采用 Streamable HTTP(流式 HTTP,2025-03-26 规范)。Streamable HTTP 在单一 POST 端点上完成 JSON-RPC 双向交互,是当前 MCP 规范推荐的传输方式,可直接被 Claude、Cursor、VS Code 等客户端以 URL 形式接入,无需 npx mcp-remote 桥接。
接入前可将端点粘贴至本站 在线 MCP Inspector 实测 initialize / tools/list 握手,确认真实协议行为。
🔐 认证与权限机制
认证方式为 Bearer Token。需要在客户端配置中提供 Authorization: Bearer <你的密钥> 请求头,凭据可在 PostHog 控制台获取。
🛡️ 上下文开销与安全审计
该服务端当前登记 39 个工具,全部定义合计约 1182 tokens,会在每次请求时注入模型系统提示词。安全评级为 A+,官方直营来源。工具名与 Schema 越精简,对上下文窗口的"税"越低;可用 feecalculator.app 估算每次调用的边际成本。
🧩 主流客户端快速接入
本站为 PostHog Analytics MCP 生成了 Cursor / Claude Code / VS Code / ChatGPT / Windsurf / Kiro / Codex / Cline / Gemini 等 10 大客户端的专属配置——包括一键 deeplink、claude mcp add 命令与 JSON/TOML 片段。下方选择你的客户端即可查看 1 分钟接入步骤。代表性工具包括 organizations-get、projects-get、project-get、project-property-definitions、docs-search 等。
📖 PostHog Analytics 详解
PostHog Analytics MCP — Remote MCP Server
PostHog's remote MCP is one of the most-used product-analytics endpoints — agents can list and run insights, execute HogQL over event tables, check feature flag state and pull error-tracking summaries with a single API key.
Official PostHog Analytics MCP Endpoint & Transport Architecture
- Endpoint URL:
https://mcp.posthog.com/mcp - Transport: Streamable HTTP
Streamable HTTP is the current MCP transport (2025-03-26 spec): a single URL accepts JSON-RPC POSTs and may stream responses over SSE, so one endpoint serves both simple and streaming workloads. PostHog Analytics MCP does not publish a separate legacy SSE endpoint, so your client must speak Streamable HTTP.
Authentication, Scopes & Permission Boundaries
PostHog Analytics MCP uses bearer-token authentication. Create an access token in your PostHog account settings, then send it as Authorization: Bearer <token>. No OAuth redirect flow is involved.
Of the 6 cataloged tools, 5 are read-only and 1 can write or mutate state (create resources, run SQL, post messages). Grant access only to the accounts and projects you intend agents to act on, and prefer scoped credentials or a dedicated workspace where the provider supports them.
Common Troubleshooting & Connection Tips
- 401/403 responses — your credential is missing or rejected. Regenerate the key/token and make sure it is sent as an
Authorization: Bearerheader on every request, including theinitializecall. - "Session expired" / stale
Mcp-Session-Id— just re-sendinitialize; stateless clients can ignore session headers entirely. - Use a personal API key from PostHog Settings → Personal API Keys.
- HogQL access means the agent can read any event data in the project — use a scoped key.
🚀 如何接入 PostHog Analytics MCP 远程 MCP
- 获取远程端点 — 复制官方端点 https://mcp.posthog.com/mcp,并先在 PostHog 控制台申请 API 凭据。
- 写入客户端配置 — 在 Cursor 的 mcp.json / Claude Code CLI / 其他客户端中添加该 URL 与 Authorization 头(见下方分客户端指南)。
- 授权并验证 — 保存配置后,在本站 Inspector 中运行 initialize 与 tools/list 验证连通性。
🔌 PostHog Analytics × 各客户端连接指南
❓ 常见问题
PostHog Analytics MCP 远程 MCP 服务器是官方提供的吗?
本条目标记为「官方直营」。端点由 PostHog 官方运营,所有收录端点均经过真实 MCP initialize 握手验证。
如何在 Claude / Cursor 中连接 PostHog Analytics MCP?
复制远程端点 https://mcp.posthog.com/mcp:Claude Code 执行 claude mcp add --transport http posthog https://mcp.posthog.com/mcp;Cursor 可直接使用本页的一键 deeplink 或在 ~/.cursor/mcp.json 中添加 { "mcpServers": { "posthog": { "url": "https://mcp.posthog.com/mcp" } } }。
连接时返回 401 或需要密钥怎么办?
该端点需要 Bearer Token / API Key:在 PostHog 控制台申请凭据后,按对应客户端文档将其写入 headers 配置。
本地 stdio MCP 和这个远程 MCP 有什么区别?
本地 MCP 通过 npx/uvx 在你的机器上启动 stdio 子进程,依赖本地运行时且密钥以明文写入配置文件;远程 MCP 是 PostHog 托管的 HTTPS 端点,免安装、支持 OAuth 2.1 授权流,且同一端点可跨桌面与移动端复用。详见 本地 vs 远程 MCP 对比。