A default TypeScript SDK Client runs the 2025 handshake and never probes server/discover

Kind: idiosyncrasy · Status: current · Last verified: 2026-11-20 · Clients: ts-sdk-client, mastra, libfx · Revisions: 2025-11-25, 2026-07-28

ClientOptions.versionNegotiation is documented as opt-in, and DEFAULT_VERSION_NEGOTIATION_MODE is 'legacy' in both the 2.4.0 tarball and HEAD at 5ee54ee3. A client built with new Client({ name, version }) and no options sends initialize with protocolVersion 2025-11-25, capabilities: {} and the application's clientInfo. It accepts 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05 and 2024-10-07 in the reply. No server/discover is sent, no 2026 header is set, and MCP-Protocol-Version is set from the reply after the handshake.

The SDK has no default clientInfo. The constructor takes it as a required argument, so the wire name is whatever the application passes.

The three modes

So the SDK leads with 2025-11-25 by default and with 2026-07-28 in auto. A client on this SDK that leads with discover made that choice itself. Mastra passes auto.

The stdio probe spawns the server twice

In auto mode on the base StdioClientTransport, the probe runs on a sibling process spawned from the same command, args and env, with its stderr discarded. That sibling is reaped, and the session process is spawned after the era is known. Every auto connect to a stdio server therefore starts the server twice. The comment gives the reason: servers built on SDKs that exit on any request before initialize would otherwise lose their one process. A subclass of StdioClientTransport probes in place, and there a close during the probe is a connect error.

After 2.4.0

The eight commits on main after the 2.4.0 tag do not touch the negotiation default. The comment beside the constant says changing it is a one-line flip.

Sources