Shared task store — use this when creating your McpServer so tasks persist across requests.
Canonical host the request arrived on, lowercased with port preserved
(e.g. snap.example.com, localhost:3001). Resolved from
X-Forwarded-Host when ServeOptions.trustForwardedHost is true,
otherwise from the Host header. Empty string when neither header
is present (unusual — HTTP/1.1 requires Host).
Use this in the factory to branch on hostname when a single process
fronts multiple agents. The same string is passed to
publicUrl / protectedResource resolver functions.
Context passed to the agent factory on each request.
Contains shared resources that must survive across stateless HTTP requests, such as the task store for MCP Tasks protocol support.
For multi-tenant / multi-host deployments, provide a custom
TaskStoreviaServeOptionsthat enforces tenant/session scoping, and branch on host inside your factory to return host-specific handlers.