The default
Out of the box, the SDK derives an actor seed from the request’s authentication, in order:- A configured
actorId(if you set one — see below) - The request’s auth info: token, client ID, API key, or principal ID
- The
Authorizationheader "anonymous"as the last resort
Custom actor resolution
If your server knows the real user (for example, after validating an OAuth token), resolve the actor yourself so sessions group by your user IDs:Attach a readable identifier
Hashes group sessions; they don’t tell you who a session was. To label sessions with an identifier you choose — an internal user ID, an account slug, an email — set the identifier option (actorIdentifier in TypeScript and PHP, actor_identifier in Python, ActorIdentifier in Go):
actorId seeds, the identifier is transmitted as-is by design: don’t put anything in it you wouldn’t show in the dashboard.
Anonymous traffic
Unauthenticated servers still get useful sessions: the actor falls back toanonymous, and session identity (which conversation the calls belong to) is tracked separately via the MCP session ID. You lose per-user grouping, not session replay.
