PlatformMcpPreAuth
@tsed/platform-mcp
Usage
typescript
import { PlatformMcpPreAuth } from "@tsed/platform-mcp";See /packages/platform/platform-mcp/src/common/interfaces/PlatformMcpPreAuth.ts.
Overview
ts
interface PlatformMcpPreAuth {
preAuth($ctx: PlatformContext): PlatformMcpPreAuthResult;
}Description
Custom authentication check of an MCP endpoint, run before the OAuth verification.
- Return an
AuthInfoto authenticate the request: the OAuth verification is skipped and the identity is exposed to the handlers. - Return
undefinedwhen the check does not apply to the request: the OAuth verification runs when the endpoint declares an issuer, and the request is rejected with401otherwise. - Throw to reject the request.
preAuth
ts
preAuth($ctx: PlatformContext): PlatformMcpPreAuthResult;