import { type MCPConfigFile, type MCPServerConfig } from "./types"; /** * Read an MCP config file. * Returns empty config if file doesn't exist. */ export declare function readMCPConfigFile(filePath: string): Promise; /** * Write an MCP config file atomically. * Creates parent directories if they don't exist. */ export declare function writeMCPConfigFile(filePath: string, config: MCPConfigFile): Promise; /** * Validate server name. * @returns Error message if invalid, undefined if valid */ export declare function validateServerName(name: string): string | undefined; /** * Add an MCP server to a config file. * Validates the config before writing. * * @throws Error if server name already exists or validation fails */ export declare function addMCPServer(filePath: string, name: string, config: MCPServerConfig): Promise; /** * Update an existing MCP server in a config file. * If the server doesn't exist, this will add it. * * @throws Error if validation fails */ export declare function updateMCPServer(filePath: string, name: string, config: MCPServerConfig): Promise; /** * Result of an {@link upsertMCPServer} call. * - `added`: server did not exist and was written. * - `updated`: server existed and was overwritten because `force` was set. * - `skipped`: server existed and `force` was not set, so nothing was written. */ export type UpsertMCPServerResult = { status: "added"; } | { status: "updated"; } | { status: "skipped"; reason: "exists"; }; /** * Add an MCP server, or overwrite an existing one only when `force` is set. * * Collision-aware wrapper over {@link addMCPServer} / {@link updateMCPServer} used by * `gjc migrate`. Never connects to the server. Reuses the underlying writers so the * rest of the config file (including `disabledServers`) is preserved on update. * * @throws Error if the server name or config is invalid (validated before any write). */ export declare function upsertMCPServer(filePath: string, name: string, config: MCPServerConfig, options?: { force?: boolean; }): Promise; /** * Remove an MCP server from a config file. * * @throws Error if server doesn't exist */ export declare function removeMCPServer(filePath: string, name: string): Promise; /** * Get a specific server config from a file. * Returns undefined if server doesn't exist. */ export declare function getMCPServer(filePath: string, name: string): Promise; /** * List all server names in a config file. */ export declare function listMCPServers(filePath: string): Promise; /** * Set a server's autoload flag for explicit runtime MCP consumers. * * Autoload defaults to true for consumers that honor it, so turning it on * removes the key to keep the config file free of redundant fields; turning it * off writes `autoload: false`. * * @throws Error if the server doesn't exist */ export declare function setServerAutoload(filePath: string, name: string, autoload: boolean): Promise; /** * Read the disabled servers list from a config file. */ export declare function readDisabledServers(filePath: string): Promise; /** * Add or remove a server name from the disabled servers list. */ export declare function setServerDisabled(filePath: string, name: string, disabled: boolean): Promise;