import { McpServer } from "@modelcontextprotocol/server"; import type { RequestOptions, ServerContext } from "@modelcontextprotocol/server"; /** * Bypass the SDK's `elicitation.url` capability gate by calling the underlying * protocol `request()` method directly. This lets us send URL-mode elicitations * to clients (like Claude Code) that support them at the protocol level even when * the SDK's newer capability check doesn't recognise the advertised capabilities. * * Falls back gracefully: callers should catch errors and offer the URL in text. */ export declare function elicitUrl(server: McpServer, params: { mode: "url"; elicitationId: string; message: string; url: string; }, options?: RequestOptions): Promise<{ [x: string]: unknown; action: "cancel" | "accept" | "decline"; _meta?: { [x: string]: unknown; "io.modelcontextprotocol/serverInfo"?: { version: string; name: string; websiteUrl?: string | undefined; description?: string | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; } | undefined; } | undefined; content?: { [x: string]: string | number | boolean | string[]; } | undefined; }>; /** * Ask a local host to open a URL. Stateless hosted requests cannot correlate * elicitation replies across requests; return the tool's clickable URL instead. */ export declare function openUrl(server: McpServer, url: string, message: string, options?: RequestOptions): Promise; /** * Emit periodic progress notifications while a long-running operation (e.g. the * one-shot AI catalog generation behind prepare_*) is awaited. Clients that * reset their request timeout on progress stay connected instead of timing out * during the dead air. Returns a stop function to call in a `finally`. */ export declare function startProgressHeartbeat(context: ServerContext | undefined, message: string, intervalMs?: number): () => void; export interface ReadReceiptStore { record(args: { generationId: string; variantId?: string; }): void; has(args: { generationId: string; variantId?: string; }): boolean; consume(args: { generationId: string; variantId?: string; }): void; } /** * In-memory get-before-edit gate keyed by generationId + variantId. The timestamp * is retained for a future TTL sweep; current callers only check presence. */ export declare function createReadReceiptStore(): ReadReceiptStore; /** * Hosted MCP requests are intentionally stateless, so the local in-memory * get-before-edit gate cannot span two tool calls. These signed, short-lived * receipts prove that the same access token fetched the exact target shortly * before attempting an edit, without storing bearer tokens or server state. */ export declare function createHostedReadReceipt(target: string, bearerToken: string, now?: number): string; export declare function verifyHostedReadReceipt(receipt: string | undefined, target: string, bearerToken: string, now?: number): boolean; export declare function hostedMcpEnabled(): boolean; export declare function ok(data: unknown, message?: string): { content: { type: "text"; text: string; }[]; structuredContent: { message?: string | undefined; success: boolean; data: unknown; }; }; interface ValidationIssue { path?: Array | string; message?: string; code?: string; expected?: unknown; received?: unknown; maximum?: unknown; minimum?: unknown; } export declare function fail(error: unknown): { isError: boolean; content: { type: "text"; text: any; }[]; structuredContent: { success: boolean; error: { recovery?: import("./limit-recovery.js").LimitRecovery | undefined; issues?: ValidationIssue[] | undefined; code: any; type: any; message: any; status: number; details: any; } | { code: string; type: string; message: string; }; }; }; /** Preserve only a fixed category when upstream errors may contain upload secrets. */ export declare function safeFail(error: unknown, message: string): { structuredContent: { success: boolean; error: { status?: number | undefined; code: string; type: string; category: string; message: string; }; }; isError: boolean; content: { type: "text"; text: any; }[]; }; export {};