/** * Structural feature probes. * * Every question about the shape of a server object is answered here, by * duck-typing the object in front of us — never by reading a package version or * a protocol constant. Two reasons this is a rule and not a preference: * * - The two SDK majors expose the same capability under different names (v1's * `.tool()` vs v2's `.registerTool()`), so "which SDK is installed" answers a * different question than "can this object register a tool". * - A single v2 server serves both protocol eras, request by request, so no * module-level constant describes it. v2's exported `LATEST_PROTOCOL_VERSION` * is `2025-11-25`. * * Nothing here imports `@modelcontextprotocol/*`; that boundary is pinned by * `sdk-import-boundary.test.ts`. */ type UnknownRecord = Record; /** A high-level `McpServer` wrapper: it holds the low-level server on `.server`. */ export declare function hasNestedLowLevelServer(server: unknown): server is UnknownRecord & { server: UnknownRecord; }; /** No `.server` property, so the object is itself the low-level `Server`. */ export declare function isBareServerShape(server: unknown): boolean; /** The high-level registry we read tool metadata from and wrap callbacks in. */ export declare function hasToolRegistry(server: unknown): boolean; /** * The object can register a tool. * * v1 offers both `tool()` and `registerTool()`; v2 dropped the deprecated * `tool()` and keeps only `registerTool()`. Requiring `tool()` specifically is * what made `instrument()` reject every v2 high-level server — and, because * `instrument()` swallows compatibility errors, reject it silently. */ export declare function canRegisterTools(server: unknown): boolean; /** Handler registration, which we patch to wrap late registrations. */ export declare function canSetRequestHandler(server: unknown): boolean; /** The live handler map we read and write directly. A real `Map` on both majors. */ export declare function hasRequestHandlerMap(server: unknown): boolean; /** `getClientVersion()` — still present on v2, and a link in B1's identity chain. */ export declare function hasClientVersionAccessor(server: unknown): boolean; /** * `getNegotiatedProtocolVersion()` — v2 only, and the last link in the protocol * version chain. A v1 server does not have it, which is why the chain probes for * it instead of branching on which SDK is installed. */ export declare function hasNegotiatedProtocolVersionAccessor(server: unknown): boolean; /** `_serverInfo`, which names the server on every event. */ export declare function hasServerInfo(server: unknown): boolean; export {}; //# sourceMappingURL=detect.d.ts.map