PostHog MCP server
- MCP server
- 1+ callable tools
- 5 capabilities
Overview
PostHog's hosted MCP server lets AI clients work with PostHog data, including feature flags, product analytics, experiments, error tracking, session replay and SQL. It runs at mcp.posthog.com and connects through OAuth or a personal API key.
Capabilities:
- Manage feature flags and experiments
- Query product analytics and run SQL
- Investigate and triage error tracking issues
- Build and update dashboards and insights
- Review session replays and logs
Works with
The products your agent can work with through this server.
Tools
The callable functions your agent uses to work with this server.
| Tool | What it does |
|---|---|
exec | Single CLI-style tool that wraps PostHog's MCP tools in cli mode, the default mode for most clients. |
Installation
Follow the installation guide for supported clients, authentication and required permissions.
Add PostHog MCP server to Claude Code
Run this in your terminal:
If the server asks you to sign in, run /mcp in Claude Code and follow the browser prompt.
Add PostHog MCP server to Cursor
Add it with the Add to Cursor button below, or add it to .cursor/mcp.json in your project (~/.cursor/mcp.json for every project):
Add PostHog MCP server to VS Code
Add it to .vscode/mcp.json in your workspace. VS Code uses servers rather than mcpServers. Or run MCP: Add Server from the Command Palette and choose HTTP.
Add PostHog MCP server to Codex
Run this in your terminal:
Or add it to ~/.codex/config.toml:
If the server uses OAuth, sign in with codex mcp login posthog.
Add PostHog MCP server to Claude
Add it as a custom connector with this URL:
- Open Customize, then Connectors.
- Click + Add, then Add custom connector.
- Name it, paste the URL and click Continue.
- Choose how to sign in, then click Add.
On Team and Enterprise plans, an Owner adds it in Organization settings first, then members connect it.
Add PostHog MCP server to other clients
For any other client that connects to remote MCP servers over HTTP, use this URL:
Sources
Documentation and source code reviewed on 10 November 2026.
View sourcesHide sources
- posthog.com/docs/model-context-protocol/codex.md
- posthog.com/docs/model-context-protocol/claude-code.md
- github.com/PostHog/posthog/tree/master/services/mcp
- github.com/PostHog/ai-plugin
- posthog.com/docs/model-context-protocol/tools.md
- posthog.com/docs/model-context-protocol/tools
- posthog.com/docs/model-context-protocol/faq.md