exploring-mcp-sessions

Investigate individual PostHog MCP sessions by listing, reading tool calls, and summarizing agent goals.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill exploring-mcp-sessions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: exploring-mcp-sessions
Source: https://github.com/PostHog/posthog-foss/tree/main/products/mcp_analytics/skills/exploring-mcp-sessions
Command: npx skills add https://github.com/PostHog/posthog-foss --skill exploring-mcp-sessions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When an AI agent connects to your PostHog MCP server, you need to understand what it actually did — which tools it called, in what order, what it was trying to accomplish, and where it went wrong. This Skill turns raw $mcp_tool_call events into a readable per-session narrative so you can debug failing agent runs and audit who is connecting to your MCP.

Core Features & Use Cases

  • Session listing: List recent MCP sessions with tool call counts, duration, client name, and resolved person identity, with search and sorting support.
  • Tool-call replay: Read one session's tool calls chronologically, including intent, duration, and error messages, to reconstruct the agent's run.
  • Goal summarization: Generate and cache an LLM summary of a session's goal from its recorded $mcp_intent values.
  • SQL fallbacks: Use HogQL recipes for errored sessions, effective (unwrapped) tool names, and cross-session aggregation when the typed tools can't answer the question.
  • Use Case: A user pastes an MCP analytics sessions URL and asks "what did this session do?" — you list the session, pull its tool calls with the correct date_from, and generate an intent summary explaining the agent's goal and where it failed.

Quick Start

Show me the tool calls and goal for MCP session <session_id>, using its session_start as the date_from parameter.

Frequently Asked Questions about exploring-mcp-sessions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I see what an MCP session did in PostHog?

Use the mcp-analytics-sessions-tool-calls tool with the session id and its session_start as date_from. It returns chronological tool calls with intent, duration, and error fields so you can read the run top to bottom.

How do I find which MCP sessions had errors?

The session list tool has no error filter, so use posthog:execute-sql with a HogQL query grouping $mcp_tool_call events by $session_id and adding HAVING errors > 0 using countIf on $mcp_is_error.

Why does the tool-calls endpoint return empty for a session that exists?

The detail tools default to a 7-day lookback, so older sessions return empty unless you pass the session's session_start as date_from. Carry session_start forward from the session list row.

What if the mcp-analytics tools are not available in my project?

The typed tools are gated behind the mcp-analytics feature flag. If they are missing, fall back to posthog:execute-sql, which is ungated, using the provided HogQL recipes for session listing and tool-call detail.

Why do tool names in a session not match the tool-quality rankings?

The session tool-calls endpoint returns the raw $mcp_tool_name without resolving single-exec wrapper calls to their inner tool. Use the SQL recipe with coalesce on $mcp_exec_tool_call_name to get effective tool names.