Skip to main content
Sessions group related events together. mcp-tap uses two strategies.

Automatic session detection

When init() is called, a SessionManager is created that tracks sessions via message fingerprinting. For LLM requests, it hashes the first user message content (SHA-256, first 12 hex chars). If the fingerprint changes between requests, a new session ID is generated.

Explicit sessions

Sessions nest correctly — when an outer session is active, starting an inner session overrides it for the duration of the inner function, then restores the outer.If called with only a function (no name), a random session ID is generated: