import { type ReactNode } from "react"; export type McpServerScope = "user" | "org"; export interface McpServer { id: string; scope: McpServerScope; name: string; url: string; headers?: Record; authMode: "none" | "headers" | "oauth"; description?: string; firstParty?: boolean; createdAt: number; mergedId: string; status: { state: "connected"; toolCount: number; error?: string; } | { state: "error"; error: string; } | { state: "unknown"; }; } export interface McpServersList { user: McpServer[]; org: McpServer[]; orgId: string | null; role: string | null; } export interface McpServersApi { list: () => Promise; create: (args: CreateMcpServerArgs) => Promise; delete: (args: { id: string; scope: McpServerScope; }) => Promise; reconnect: (args: ReconnectMcpServerArgs) => Promise; test: (url: string, headers?: Record) => Promise; testExisting: (args: { id: string; scope: McpServerScope; }) => Promise; } export declare function McpServersApiProvider({ api, children, }: { api: McpServersApi; children: ReactNode; }): import("react").FunctionComponentElement>; export declare function useMcpServersApi(): McpServersApi; export interface UseMcpServersOptions { defer?: boolean; } export type McpServersQuery = ReturnType; /** * True until a list read has settled (success or error). Deferred call sites * must treat this as pending: hold empty states, permission derivation, and * connect affordances until it clears instead of reading the undefined data * as "no servers". */ export declare function isMcpServersPending(query: McpServersQuery): boolean; export declare function useMcpServers(options?: UseMcpServersOptions): import("@tanstack/react-query").UseQueryResult, Error>; export interface CreateMcpServerArgs { scope: McpServerScope; name: string; url: string; headers?: Record; description?: string; } export declare function useCreateMcpServer(): import("@tanstack/react-query").UseMutationResult; export interface ReconnectMcpServerArgs { id: string; scope: McpServerScope; } export declare function useDeleteMcpServer(): import("@tanstack/react-query").UseMutationResult; export declare function useReconnectMcpServer(): import("@tanstack/react-query").UseMutationResult; export interface TestMcpUrlResult { ok: boolean; error?: string; toolCount?: number; tools?: string[]; } export declare function getMcpUrlValidationError(rawUrl: string): string | null; export declare function formatMcpServerError(error: unknown): string; export declare function formatMcpServersLoadError(error: unknown): string; export declare function testMcpServerUrl(url: string, headers?: Record): Promise; export declare function mcpVirtualId(scope: McpServerScope, serverId: string): string; export declare function parseMcpVirtualId(id: string): { scope: McpServerScope; serverId: string; } | null;