PostHog MCP ServerOfficial
A Model Context Protocol server that enables Claude Desktop users to interact directly with PostHog, allowing them to view projects and create annotations through natural language commands.
PostHog
Tools
list_posthog_projects
List all available PostHog projects.
create_posthog_annotation
Create a PostHog annotation. Args: project_id: The ID of the project as an integer (e.g. 99423) content: The content/text of the annotation date_marker: Optional ISO-8601 timestamp for the annotation (e.g. 2024-03-20T14:15:22Z)
README
PostHog MCP Server 📊
A Model Context Protocol (MCP) server for interacting with PostHog. Create annotations and manage projects directly through Claude Desktop!
Features 🚀
- List Projects: View all available PostHog projects in your organization
- Create Annotations: Add annotations to your PostHog projects with optional timestamps [this list can be much longer, anything our api has basically...]
Setup 🛠️
-
Prerequisites
- Python 3.10 or higher
uvpackage manager- PostHog API Key with
annotation:writeandproject:readscopes obtained from your project settings
-
Installation
# clone the repo git clone git@github.com:PostHog/posthog-mcp.git # or if https, use: git clone https://github.com/PostHog/posthog-mcp.git cd posthog-mcp uv venv source .venv/bin/activate # Install dependencies uv pip install . -
Configuration
- Create a
.envfile in the project root:PERSONAL_API_KEY=phx_your_posthog_api_key_here
- Create a
-
Claude Desktop Setup
- Install Claude Desktop
- Open Claude Desktop settings and click "Edit Config". Alternatively, you can open the file from:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Add this to your
claude_desktop_config.json(adjust paths according to your system):Check the latest documentation on setting up Claude Desktop as MCP client if you ran into any issues.{ "mcpServers": { "posthog": { "command": "/path/to/uv", # Get this by running: which uv "args": [ "--directory", "/path/to/your/posthog-mcp", # Full path to this project "run", "posthog_mcp" ] } } }
Usage 💡
After setup, you'll see a hammer 🔨 icon in Claude Desktop. The following commands are available:
List Projects
Ask Claude:
"List my PostHog projects"
Get and Search for Insights
Ask Claude:
"List my PostHog insights" or "Search for revenue insights in my PostHog"
Search for documentations online
You can ask:
- "how can i do reverse proxy in nextjs in posthog?"
Create Annotation
Using the Project ID you get from the list of projects, ask Claude:
"Create a PostHog annotation in project 53497 saying 'Deployed v1.2.3'"
or with a specific date:
"Create a PostHog annotation in project 53497 for March 20th saying 'Started new marketing campaign'"
Troubleshooting 🔍
- If the hammer icon doesn't appear, restart Claude Desktop
- Check logs at
~/Library/Logs/Claude/mcp*.log(macOS) or%APPDATA%\Claude\logs(Windows) - Verify your PostHog API key has the correct permissions
- Make sure all paths in
claude_desktop_config.jsonare absolute paths
Contributing 🤝
Feel free to open issues and PRs! We follow PostHog's contribution guidelines.
Recommended Servers
Google Search Console MCP Server
A server that provides access to Google Search Console data through the Model Context Protocol, allowing users to retrieve and analyze search analytics data with customizable dimensions and reporting periods.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor
mixpanel
Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.
mcp-server-datadog
The MCP server provides an interface to the Datadog API, enabling seamless management of incidents, monitoring, logs, dashboards, metrics, traces, and hosts. Its extensible design allows easy integration of additional Datadog APIs for future expansions.
metoro-mcp-server
Query and interact with kubernetes environments monitored by Metoro. Look at APM, metrics, traces, profiling information with LLMs.
Raygun MCP Server
MCP Server for Raygun's API V3 endpoints for interacting with your Crash Reporting and Real User Monitoring applications. This server provides comprehensive access to Raygun's API features through the Model Context Protocol.
Umami Analytics MCP Server
Enhances Claude's capabilities by providing access to website analytics data from Umami, enabling analysis of user behavior, website performance tracking, and data-driven insights generation.
JIRA MCP Server
Provides an interface to access and manage JIRA data through the Model Context Protocol, offering features like relationship tracking, data cleaning, and contextual insights for AI applications.
DevEnvInfoServer
An MCP server that provides detailed information about your development environment to the Cursor code editor, enabling more context-aware assistance.
MCP Accessibility Scanner
Enables automated web accessibility scans for WCAG compliance using Playwright and Axe-core, providing visual and JSON reports with remediation guidance.