id | string | The session’s identifier on the deployment. |
url | string | The server’s endpoint: the URL the agent’s host connects to. |
principal | string | - |
actsFor | string | null | The object the session acts for, or null before verification. |
expiresAt | number | - |
tools | string[] | The tools this session was offered when it started. |
token | () => string | A bearer token for url, signed again as it nears expiry and never valid past the session. Give the agent’s host this function, or its current value for a platform that takes one string. |
connect | (options: { store: McpRequestStore ; fetch?: typeof fetch }) => { discover: (options?: { signal?: AbortSignal }) => Promise<any> ; fetchForCall: (callId: string) => (input: URL | RequestInfo, init?: RequestInit) => Promise<Response>(input: string | URL | Request, init?: RequestInit) => Promise<Response> ; recover: (callId: string, request?: { signal?: AbortSignal }) => Promise<any> ; status: (callId: string, request?: { signal?: AbortSignal }) => Promise<any> } | A durable MCP connection for a host that calls operation tools: fetchForCall(callId), recover(callId), status(callId), discover(). |
permissions | () => Promise<{ server: string ; acts_for: { type: string ; key: string } | null ; permissions: string[] ; tools: { name: string ; state: "available" | "changed" | "removed" }[] ; expires_at: number }> | What the session may do right now on its object. |
verify | (actsFor: string, evidence?: null | { method: string ; reference?: string }) => Promise<McpSessionHandle> | Bind a session started before you verified the caller to the object you now verified them as, once, with your evidence. It then holds its role there, and every tool. |
end | () => Promise<void> | End the session now: the engine refuses its token from that commit on. |