import type { Icon } from "@modelcontextprotocol/server"; import type { FetchHandler } from "./fetch-app.js"; /** Normalized server branding shared by browser and MCP identity surfaces. */ export interface ServerBranding { /** * Source selected for `/favicon.ico`, after applying explicit-favicon and * first-icon inference. */ readonly favicon?: string; /** MIME type of the selected favicon when known. */ readonly faviconMimeType?: string; /** Icons reported in MCP implementation metadata, in author order. */ readonly icons?: readonly Icon[]; /** Server website reported in MCP implementation metadata. */ readonly websiteUrl?: string; } /** * Validate and freeze the branding fields from server configuration. * * @param config - Untyped-compatible branding input. * @returns Immutable normalized branding and the selected favicon MIME type. * * @internal */ export declare function normalizeServerBranding(config: { favicon?: unknown; icons?: unknown; websiteUrl?: unknown; }): ServerBranding; /** * Resolve configured icons for MCP implementation and tool metadata. * * Absolute HTTP(S) and data URLs pass through. Public-relative sources become * request-scoped absolute URLs under `${basePath}/_mcp-use/public/`. * * @param icons - Configured icons, in author order. * @param request - HTTP request used to derive the public asset origin. * @param basePath - MCP endpoint base path. * @returns Icons suitable for official SDK implementation and tool descriptors. * * @internal */ export declare function resolveImplementationIcons(icons: readonly Icon[], request: Request | undefined, basePath: string): Icon[]; /** * Whether any configured branding source needs the local public route. * * @param branding - Normalized branding to inspect. * @returns `true` when the favicon or an MCP icon uses a `public/` path. * * @internal */ export declare function hasLocalBrandingAsset(branding: ServerBranding): boolean; /** * Create the root-level `/favicon.ico` handler for normalized branding. * * Local public files and data URLs are streamed directly. Absolute HTTP(S) * sources receive a temporary redirect, avoiding server-side remote fetches. * * @param branding - Normalized server branding. * @param options - Public directory resolution mode. * @returns A GET/HEAD handler, or `undefined` when no favicon is configured. * * @internal */ export declare function createFaviconHandler(branding: ServerBranding, options: { dev: boolean; projectRoot: string; deferCors?: boolean; }): FetchHandler | undefined;