Skip to content
Skillpedia
Connectors (MCP)41k Β· #6891

exploring-mcp-sessions

What it does

This skill shows the sequence of tool calls one AI agent made in a single run, and where it went wrong. It is for people who run an MCP server and want to understand a specific session.

When to use it

  • βœ“When you want to see what happened in one specific MCP session.
  • βœ“When you need to find which sessions had errors.
  • βœ“When you want to know who is connecting to your MCP server.

Skill link

https://github.com/PostHog/posthog/blob/master/products/mcp_analytics/skills/exploring-mcp-sessions/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/mcp_analytics/skills/exploring-mcp-sessions/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œShow me the tool calls from this MCP session and tell me what the agent was trying to do.”

5 new skills a week. 1 minute to read.

How it works

It lists the sessions, reads a session's tool calls in time order, and can write a short summary of the goal. Only the hardest questions need a custom query.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Exploring MCP sessions

An MCP session is one agent run: the set of $mcp_tool_call events sharing a $session_id, ordered by timestamp.

Listing sessions, reading a session's tool calls, and summarising its goal each have a typed tool β€” reach for those first. Drop to HogQL only for the three things the typed tools genuinely can't do (see When to drop to SQL). The full $mcp_* property schema and query recipes live in the shared reference: models-mcp.md.

Tools

Tool Purpose
posthog:mcp-analytics-sessions-list List sessions β€” one row per session, newest first
posthog:mcp-analytics-sessions-tool-calls One session's tool calls, chronological
posthog:mcp-analytics-sessions-generate-intent LLM summary of a session's goal (cached after first call)
posthog:execute-sql Errored sessions, effective tool names, cross-session cuts

The three mcp-analytics-* tools run the same code as the sessions UI, so results match the screen. If they aren't in your tool list, fall back to posthog:execute-sql.

The date-window trap β€” read this first

The two detail tools default to a 7-day lookback. A session you found in a list that reaches further back will come back empty unless you pass its session_start as date_from:

  • posthog:mcp-analytics-sessions-tool-calls β€” date_from is an absolute ISO timestamp; pass the session_start you got from posthog:mcp-analytics-sessions-list.
  • posthog:mcp-analytics-sessions-generate-intent β€” same date_from query param, same reason.

Empty tool calls for a session that visibly exists is almost always this, not a data problem. Carry session_start forward from the list row.

Workflow: list recent sessions

posthog:mcp-analytics-sessions-list
{ "date_from": "-7d", "order_by": "-session_start", "limit": 100 }

Each row: session_id, tool_calls, session_start, session_end, tools_used, mcp_client_name, distinct_id (+ resolved person_email / person_name), and intent (empty until generated). Response is { results, has_next } β€” page with limit / offset.

Three sharp edges:

  • order_by takes column names, not response field names. Sort call volume as tool_call_count (not tool_calls). duration_seconds sorts fine even though it isn't returned. An unrecognised key silently falls back to newest-first β€” so verify the order you got is the order you asked for. Valid: session_id, session_start, session_end, duration_seconds, tool_call_count, mcp_client_name, distinct_id; prefix - to descend.
  • There is no error filter and no error count on a session row. "Which sessions had errors?" is a SQL question β€” see below.
  • distinct_id_count is always 0. The field is in the response but the backend never populates it, so don't read it as "one distinct id per session" β€” it says nothing. To count distinct ids in a session, use SQL.

search does a case-insensitive substring match across session_id, distinct_id, mcp_client_name, and tools_used.

Workflow: read one session's tool calls

posthog:mcp-analytics-sessions-tool-calls
{ "id": "<session_id>", "date_from": "<session_start>", "limit": 500 }

Chronological tool_name, intent, timestamp, duration_ms, is_error, error_message β€” read top to bottom to reconstruct the run. limit defaults to 500 (also the max), which is the whole page for almost every session; has_next tells you if more remain.

Caveat: tool_name here is the raw $mcp_tool_name. Unlike the tool-quality and tool-detail tools, this endpoint does not resolve the inner tool of a single-exec wrapper call, so wrapper calls show the wrapper. When the inner tool is what matters (comparing against a tool-quality ranking, tracing a specific tool through a run), use the SQL recipe below instead. The same applies to tools_used on the session list.

Workflow: summarise the agent's goal

posthog:mcp-analytics-sessions-generate-intent
{ "id": "<session_id>", "date_from": "<session_start>" }

Summarises the ses

FAQ

What is an MCP session?

It is one agent run, made of all the tool calls that share the same session ID, in time order.

Who writes the goal summary?

An AI summary of the session's goal is generated, and it is stored after the first request.

Can it find sessions with errors?

Yes. It can list sessions with errors, using a custom SQL query for that case.

Details

Original description by the author

Investigate individual PostHog MCP sessions β€” the sequence of tool calls a single agent made in one run, what it was trying to do, and where it went wrong. Use when the user asks "what did this MCP session do?", "show me the tool calls for session X", "what was the agent's goal?", "which sessions had errors?", "who is connecting to my MCP?", or pastes an MCP analytics sessions URL.

repo: PostHog/posthog

Popularity

GitHub stars
41k
Ranking position
#6891
License
β€”
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills