import type { ResolvedAccount } from "./accounts.js"; import { parseCodexMcpList, type McpServerState } from "./tools.js"; export interface AccountMcpServer { name: string; /** The URL or the command line (never headers or environment). */ target: string; transport?: string; state: McpServerState; detail?: string; /** Where it is configured: `user`, `project`, `local`, `managed`, `plugin`, `connector` (claude.ai / ChatGPT), … */ source?: string; /** The plugin that ships it. */ plugin?: string; /** Tools it offered (when it connected). */ tools?: number; } export interface AccountMcpPlugin { id: string; version?: string; enabled: boolean; } export interface AccountMcp { servers: AccountMcpServer[]; plugins?: AccountMcpPlugin[]; /** `status`: the CLI's own connection report; `list`: the plain listing (an older CLI). */ via?: "status" | "list"; /** The listing failed or is incomplete. */ error?: string; checked_at: string; } export interface ProbeMcpOptions { command: string | string[]; /** The account's environment (`withAccountEnv`). */ env: Record; timeoutMs?: number; /** Claude Code: ask at least this long, so the claude.ai connectors (fetched in the background) are listed. Default 3 s. */ settleMs?: number; } /** A CLI's error, one line and short (Codex's carry the whole transport chain). */ export declare function shortError(text: string): string; /** `mcp_status`: `{mcpServers: [{name, status, serverInfo, error, error_code, config, scope, source, tools}]}`. */ export declare function parseClaudeMcpStatus(response: unknown): AccountMcpServer[] | undefined; export declare function probeClaudeMcp(options: ProbeMcpOptions): Promise; /** `mcpServerStatus/list`: `{data: [{name, pluginId, httpOrigin, serverInfo, tools, toolsError, authStatus}], nextCursor}`. */ export declare function parseCodexMcpStatus(result: unknown): { servers: Map; next?: string; }; /** What is configured (`codex mcp list --json`) and what connected (`mcpServerStatus/list`), one row per server. */ export declare function mergeCodexMcp(configured: ReturnType, status: ReturnType["servers"] | undefined): AccountMcpServer[]; export declare function probeCodexMcp(options: ProbeMcpOptions): Promise; /** The account's MCP servers, connectors and plugins, from its CLI, with the account's environment. */ export declare function probeAccountMcp(account: Pick, options: ProbeMcpOptions): Promise; /** "7/9": servers that connected of those that are not disabled. */ export declare function mcpSummary(mcp: AccountMcp | undefined): string;