Debugging with MCP
Contents
The PostHog MCP server exposes function calling tools to any MCP client, enabling AI agents to interact with PostHog's API via the MCP protocol.
When combining our MCP server with error tracking, your AI agents can take actions based on PostHog data which unlocks powerful, autonomous debugging capabilities.
For example, with MCP, your agents can:
- Triage issues: Fetching the latest issues with details like status, frequency, users affected, last seen, etc.
- Inspect error details: Accessing full stack traces, error messages, and relevant metadata.
- Explain or reproduce errors: Identifying failure points and performing root cause analysis using the captured stack trace context.
- Debug and create fixes: Proposing or even generating code fixes based on the error details.
All of this happens directly inside the MCP client, like Cursor, Windsurf, or Claude Code, so you can investigate and resolve product issues without ever leaving the code editor.
See it in action
Try these example questions and directives with your MCP-enabled agent:
Install the MCP server
To start debugging with PostHog MCP, install the MCP server in your preferred MCP client.
The easiest way is to use the AI wizard, which supports setup for agents like Claude, Cursor, Windsurf, VS Code, and more. The wizard guides you through the installation step by step.
You can also install the MCP server by configuring it manually.
Check out the MCP server documentation for more detailed instructions and information.