Exploring Mcp Sessions logo

Exploring Mcp Sessions

Organization
PostHog
exploring-mcp-sessions

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.

Overview

PublisherPostHog
Repositoryskills
Skill nameexploring-mcp-sessions
Stars
77
Forks
8
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by PostHog on GitHub. Read the source before you install it.

Installation

Install the Exploring Mcp Sessions AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/PostHog/skills/tree/main/skills/omnibus/exploring-mcp-sessions
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/PostHog/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/omnibus/exploring-mcp-sessions .claude/skills/exploring-mcp-sessions
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Exploring Mcp Sessions in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Exploring Mcp Sessions on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Exploring Mcp Sessions is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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

ToolPurpose
posthog:mcp-analytics-sessions-listList sessions — one row per session, newest first
posthog:mcp-analytics-sessions-tool-callsOne session's tool calls, chronological
posthog:mcp-analytics-sessions-generate-intentLLM summary of a session's goal (cached after first call)
posthog:execute-sqlErrored 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

json
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

json
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

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

Summarises the session's recorded $mcp_intent values via an LLM and persists the result; later calls return the cached summary. Returns { session_id, intent }. A 503 means LLM summarisation isn't configured — fall back to reading the raw $mcp_intent values from the tool-call list.

When to drop to SQL

Four cases, all via posthog:execute-sql.

1. The typed tools aren't in your tool list. Everything below still works; this query is the plain session listing:

sql
SELECT
    $session_id AS session_id,
    min(timestamp) AS session_start,
    max(timestamp) AS session_end,
    dateDiff('second', min(timestamp), max(timestamp)) AS duration_seconds,
    count() AS tool_calls,
    countIf(toBool(properties.$mcp_is_error)) AS errors,
    any(properties.$mcp_client_name) AS client
FROM events
WHERE event = '$mcp_tool_call'
    AND $session_id != ''
    AND timestamp >= now() - INTERVAL 7 DAY
GROUP BY session_id
ORDER BY session_start DESC
LIMIT 50

2. Errored sessions. The session list can't filter or count errors — add HAVING errors > 0 to the query above and order by errors DESC.

3. Effective tool names within a session — the coalesce the typed tool-calls endpoint doesn't apply:

sql
SELECT
    timestamp,
    coalesce(nullIf(toString(properties.$mcp_exec_tool_call_name), ''), toString(properties.$mcp_tool_name)) AS tool,
    toBool(properties.$mcp_is_error) AS is_error,
    toString(properties.$mcp_error_message) AS error_message,
    round(toFloat(properties.$mcp_duration_ms)) AS duration_ms
FROM events
WHERE event = '$mcp_tool_call'
    AND $session_id = '<session_id>'
ORDER BY timestamp ASC

4. Cross-session aggregation — "sessions per day", "sessions that used tool X and then failed", custom breakdowns. Recipes in models-mcp.md.

Note $session_id is a materialised events column — the same id as $mcp_session_id. Reference it bare, never as properties.$session_id: the properties. accessor renders null-wrapped in SELECT but as the raw column in HAVING/ORDER, so a HAVING search would mismatch the GROUP BY key.

Constructing UI links

  • Sessions list: https://app.posthog.com/project/<project_id>/mcp-analytics/sessions

Tips

  • A session with many calls but no errors that ends abruptly often means the agent gave up — check whether the last call returned a large or empty result
  • $mcp_intent is only present when the client supplied it; absence is common, so generate-intent is the more reliable goal signal
  • To go from a failing tool (see exploring-mcp-tool-quality) to the sessions that hit it, search the session list by tool name — remembering tools_used holds raw names, so search the registered name, not the inner one

Related skills

Frequently asked questions

What does the Exploring Mcp Sessions AI skill do?

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.

Why use Exploring Mcp Sessions on TypingMind?

Because you install it once and use it with any model. Exploring Mcp Sessions is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Exploring Mcp Sessions in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/PostHog/skills/tree/main/skills/omnibus/exploring-mcp-sessions. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Exploring Mcp Sessions?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Exploring Mcp Sessions?

As many as you like. As long as a model supports skills, you can use Exploring Mcp Sessions with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Exploring Mcp Sessions AI skill free?

Yes. It is published on GitHub by PostHog under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇