MCP Server Framework - v1.0.0
    Preparing search index...

    Interface AuthContext

    Authentication context for a session.

    Wraps the SDK's AuthInfo (from OAuth/Bearer middleware) and adds framework-level auth metadata for future user/permission systems.

    When no auth middleware is configured, sessions use ANONYMOUS_AUTH.

    interface AuthContext {
        authenticatedAt?: Date;
        extra?: Record<string, unknown>;
        isAuthenticated: boolean;
        permissions?: readonly string[];
        sdkAuthInfo?: AuthInfo;
        userId?: string;
    }
    Index

    Properties

    authenticatedAt?: Date

    When authentication was validated

    extra?: Record<string, unknown>

    Consumer-provided extra data (populated via onAuthenticated hook)

    isAuthenticated: boolean

    Whether the session is authenticated

    permissions?: readonly string[]

    Framework permission scopes (future: role-based or mapped from sdkAuthInfo.scopes)

    sdkAuthInfo?: AuthInfo

    SDK auth info from transport (populated by OAuth middleware via req.auth)

    userId?: string

    Resolved user identity (future: mapped from sdkAuthInfo.clientId or custom resolver)