import type { ToolSecurityScheme } from "../tools.js"; /** @internal Key under which security schemes are mirrored into tool `_meta`. */ export declare const SECURITY_SCHEMES_META_KEY: "securitySchemes"; /** @internal Server-level facts the scheme resolver needs. */ export interface SecuritySchemeOptions { /** Whether an OAuth provider is configured. */ hasOAuth: boolean; /** Whether `mixedAuth` is enabled. */ mixedAuth: boolean; /** Provider `requiredScopes`, enforced on every tool that needs sign-in. */ baselineScopes: readonly string[]; } /** * Validate a tool's `securitySchemes` against the server configuration and * resolve the schemes the gate enforces and `tools/list` advertises. * * The result lists `noauth` first, and its `oauth2` scopes include the * provider's `requiredScopes`. An omitted declaration resolves to sign-in * with the provider's `requiredScopes`. * * @throws TypeError On an empty or malformed array, a duplicate scheme type, * a scope that is not a single RFC 6749 scope token, * `noauth` without `mixedAuth`, `oauth2` without an OAuth provider, or an * `oauth2` scheme whose scopes are empty when the provider has no * `requiredScopes`. * * @internal */ export declare function resolveSecuritySchemes(name: string, declared: unknown, options: SecuritySchemeOptions): ToolSecurityScheme[]; /** * Whether resolved schemes require sign-in: they do unless one is `noauth`. * * @internal */ export declare function requiresSignIn(schemes: readonly ToolSecurityScheme[]): boolean; /** * The scopes of the resolved `oauth2` scheme: enforced when the tool * requires sign-in, only advertised when it also accepts `noauth`. * * @internal */ export declare function schemeScopes(schemes: readonly ToolSecurityScheme[]): readonly string[]; /** * Warning for hand-written `_meta.securitySchemes`, which mcp-use passes * through for backward compatibility but never enforces. `undefined` when * there is nothing to warn about. * * @internal */ export declare function handWrittenSecuritySchemesWarning(name: string, definition: { securitySchemes?: unknown; _meta?: Record | undefined; }, options: SecuritySchemeOptions): string | undefined;