import type { PortableTool } from "../portable-tool.js";
interface ToolRegistryLike {
    addTools(tools: PortableTool[]): void;
    getToolNames(): string[];
    removeTool(name: string): boolean;
}
export interface McpServerEntry {
    /** Server display name */
    name: string;
    /** Transport type: "stdio" (default) or "http" */
    type?: "stdio" | "http";
    /** Command to spawn (stdio only) */
    command?: string;
    /** Command arguments (stdio only) */
    args?: string[];
    /** Extra environment variables (stdio only) */
    env?: Record<string, string>;
    /** Working directory for stdio MCP subprocesses */
    cwd?: string;
    /** HTTP endpoint URL (http only) */
    url?: string;
    /** Extra HTTP headers (http only) */
    headers?: Record<string, string>;
    /** Init timeout (ms) — accepted for config compatibility; mcporter owns connect timeouts. */
    initTimeoutMs?: number;
    /** Whether this server is disabled (skip connection) */
    disabled?: boolean;
}
export interface McpManagerConfig {
    servers: McpServerEntry[];
    log?: {
        info(msg: string): void;
        warn(msg: string): void;
    };
    /** Active workspace boundary for local-path arguments passed into MCP tools. */
    workspaceRoot?: string;
    /** Runtime-owned catalog used for dynamic MCP tool injection. */
    toolCatalog?: ToolRegistryLike;
}
export declare class McpManager {
    private runtime;
    private definitions;
    private toolsByServer;
    private injectedNames;
    private log;
    private workspaceRoot?;
    private toolCatalog?;
    constructor(config: McpManagerConfig);
    private toServerDefinition;
    /**
     * Connect to all configured MCP servers and snapshot their tools.
     * Per-server failures are logged but don't block the rest.
     */
    connectAll(): Promise<void>;
    /**
     * Register all snapshotted MCP tools into the tool pool.
     */
    injectTools(): void;
    /** Get names of all connected servers. */
    getConnectedServers(): string[];
    /** Get total number of MCP tools across all servers. */
    getToolCount(): number;
    /**
     * Close all MCP connections and retract the injected tools, so a config
     * reload never leaves ghost tools bound to a closed runtime.
     */
    disconnectAll(): Promise<void>;
    private toPortableTool;
    private wrapToolsForWorkspaceBoundary;
    private registerTools;
    private removeRegisteredTool;
}
export declare function validateMcpToolWorkspaceBoundary(toolName: string, args: unknown, workspaceRoot: string | undefined): string | null;
export declare function parseMcpConfig(json: unknown): McpServerEntry[];
export {};
