UNPKG

mcp-wayback-machine

Version:

MCP server and CLI tool for interacting with the Wayback Machine without API keys

39 lines 1.39 kB
/** * Pluggable authentication for the MCP server transport. * * AuthProvider is called before each request reaches the MCP transport. * Return undefined to allow the request through, or a Response to reject it. * * Implementations: * - StaticTokenAuthProvider — shared bearer token from an environment variable * (simple, suitable for personal/team deployments) * * Worker deployments wire an AuthProvider in worker.ts. * Stdio mode doesn't need one (local process, no network boundary). */ /** * Authentication gate for incoming MCP requests. * * Called once per request before the MCP transport processes it. * Return undefined to allow; return a Response (typically 401 or 403) * to reject. */ export interface AuthProvider { /** * Inspect the incoming request and decide whether to allow it. * @returns undefined to allow, or a Response to reject with. */ validate(request: Request): Promise<Response | undefined>; } /** * Static bearer token authentication. * * Compares the Authorization header against a single shared token. * Uses constant-time comparison to prevent timing attacks. */ export declare class StaticTokenAuthProvider implements AuthProvider { private readonly expectedToken; constructor(token: string); validate(request: Request): Promise<Response | undefined>; } //# sourceMappingURL=provider.d.ts.map