provider mcp_analytics GET
/api/projects/{project_id}/mcp_analytics/sessions/ @utdk/posthog
/api/projects/{project_id}/mcp_analytics/sessions/ mcp_analytics_sessions_list
List MCP sessions for the current project, derived by grouping $mcp_tool_call events by $mcp_session_id. Ordered by newest session start first by default.
- date_from query
- Start of the window to aggregate sessions over. PostHog date string — relative (e.g. '-7d', '-24h') or an absolute ISO timestamp. Defaults to '-7d'.
- string
- date_to query
- End of the window. PostHog date string or absolute ISO timestamp. Defaults to now.
- string
- limit query
- Maximum number of sessions to return per page. Defaults to 100; values above 500 are rejected.
- integer
- offset query
- Number of sessions to skip before returning results. Combine with limit to page through sessions; the response's has_next flag indicates whether more remain.
- integer
- order_by query
- Sort column. Allowed: session_id, session_start, session_end, duration_seconds, tool_call_count, mcp_client_name, distinct_id. Prefix with '-' for descending. Defaults to '-session_start' (newest sessions first).
- string
- project_id path required
- Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.
- string
- search query
- Case-insensitive substring filter matched against session_id, distinct_id, mcp_client_name, and tools_used.
- string
Try it
Authentication
Configure credentials for PostHog API
Code snippet
Updates live as you fill in the form above.
TypeScript
import posthog from '@utdk/posthog';
await posthog.mcpAnalyticsSessionsList({
"limit": 100,
"offset": 0
})