/**
 * MCP OAuth Callback Server
 *
 * HTTP server that handles OAuth callbacks from the authorization server.
 * Uses Node.js http module for compatibility.
 */
interface EnsureCallbackServerOptions {
    strictPort?: boolean;
    /** Preferred port to bind on (e.g., from a custom redirectUri). Takes precedence over the configured default. */
    preferredPort?: number;
}
/**
 * Ensure the callback server is running.
 * If strictPort is true, requires binding on the configured callback port.
 * If strictPort is false, scans forward for an available local port.
 */
export declare function ensureCallbackServer(options?: EnsureCallbackServerOptions): Promise<void>;
/**
 * Wait for a callback with the given OAuth state.
 * Returns a promise that resolves with the authorization code.
 */
export declare function waitForCallback(oauthState: string): Promise<string>;
/**
 * Cancel a pending authorization by state.
 */
export declare function cancelPendingCallback(oauthState: string): void;
/**
 * Stop the callback server and reject all pending authorizations.
 */
export declare function stopCallbackServer(): Promise<void>;
/**
 * Check if the callback server is running.
 */
export declare function isCallbackServerRunning(): boolean;
/**
 * Get the number of pending authorizations.
 */
export declare function getPendingAuthCount(): number;
export {};
//# sourceMappingURL=mcp-callback-server.d.ts.map