import type { ShellPathService } from '../runtime/shell-paths.js'; export interface McpServerConfig { /** Unique server name, used as namespace prefix: mcp:: */ name: string; /** Executable command to start a stdio MCP server process. Exactly one of command/url. */ command?: string | undefined; /** Streamable HTTP endpoint of a remote MCP server. Exactly one of command/url. */ url?: string | undefined; /** Arguments to pass to the command */ args?: string[] | undefined; /** Optional environment variables to merge with process.env */ env?: Record | undefined; /** Optional role used by runtime coherence checks. */ role?: 'general' | 'docs' | 'filesystem' | 'git' | 'database' | 'browser' | 'automation' | 'ops' | 'remote' | undefined; /** Optional initial trust mode for the runtime MCP trust layer. */ trustMode?: 'constrained' | 'ask-on-risk' | 'allow-all' | 'blocked' | undefined; /** Optional allowed path prefixes for filesystem-oriented tools. */ allowedPaths?: string[] | undefined; /** Optional allowed network hostnames for network-oriented tools. */ allowedHosts?: string[] | undefined; } export interface McpConfig { servers: McpServerConfig[]; } export type McpConfigRoots = Pick; export type McpConfigScope = 'project' | 'global'; export interface McpConfigLocation { readonly scope: McpConfigScope | 'external'; readonly kind: 'global-xdg' | 'global-dotdir' | 'claude-desktop' | 'project-mcp' | 'project-goodvibes'; readonly path: string; readonly writable: boolean; } export interface McpServerConfigEntry { readonly server: McpServerConfig; readonly source: McpConfigLocation; } export interface McpEffectiveConfig { readonly servers: readonly McpServerConfigEntry[]; readonly locations: readonly McpConfigLocation[]; } export declare function getMcpConfigLocations(roots: McpConfigRoots): readonly McpConfigLocation[]; /** * loadMcpConfig - Scan multiple locations in precedence order (later wins). * Returns merged config from all found files. Returns empty config on failure. */ export declare function loadMcpConfig(roots: McpConfigRoots): McpConfig; export declare function loadMcpEffectiveConfig(roots: McpConfigRoots): McpEffectiveConfig; export declare function loadWritableMcpConfig(roots: McpConfigRoots, scope: McpConfigScope): McpConfig; /** * Write a server entry, creating or replacing it by name. * * `env` is the one field an omitted value PRESERVES rather than clears. * * Every other field is a full replacement, which is right: the caller can see * what it is replacing. `env` it cannot, the read side reports `envKeys` and * never the values, so an admin editing an unrelated field (a URL, an * allowedHost) round-trips the server object with `env` missing and silently * destroys credentials nobody could have known to resend. That is a wipe * caused by the read redaction, not by anything the admin asked for. * * Supplying `env` still replaces it wholesale, so clearing or removing a * variable stays possible and stays explicit: send the map you want. */ export declare function upsertMcpServerConfig(roots: McpConfigRoots, scope: McpConfigScope, server: McpServerConfig): { readonly path: string; readonly config: McpConfig; }; export declare function removeMcpServerConfig(roots: McpConfigRoots, scope: McpConfigScope, serverName: string): { readonly path: string; readonly removed: boolean; readonly config: McpConfig; }; //# sourceMappingURL=config.d.ts.map