import type { Server } from "@modelcontextprotocol/sdk/server/index.js"; import type { Logger } from "@onenomad/przm-cortex-core"; export interface TransportHandle { kind: "stdio" | "http"; close(): Promise; /** Actual bound port (http only). */ port?: number; /** Live session count for /api/status. */ sessionCount?: () => number; } export interface ConnectTransportArgs { /** * Factory invoked once per HTTP session (and once for stdio). Each * call must produce a FRESH Server instance — the MCP SDK's Server * tracks `_initialized` per-instance and rejects a second `initialize` * on the same server, which is what made the old single-Server design * reject the second Claude client. See ADR-018 for the session-scoping * story; this factory is the transport-side half of that design. */ buildMcp: () => Server; logger: Logger; } /** * Dispatch on PRZM_CORTEX_MCP_TRANSPORT (stdio | http). * * stdio (default): what Claude Code spawns as a subprocess. * http: used by containerized deployments — Cortex binds to a port and * Claude Code connects via its MCP HTTP transport config. Pairs with * the Docker/compose path (see docs/HOSTING.md). */ export declare function connectConfiguredTransport(args: ConnectTransportArgs): Promise; //# sourceMappingURL=transport.d.ts.map