Properties
auth?
autoInitialize?
cachePartition?
cacheScope is 'private'. Set this to a stable identity
of the authorization context (e.g. the auth subject) when one
responseCacheStore backs several principals. Passed through verbatim.
defaultCacheTtlMs?
ttlMs field.
Default 0 (never served from cache, but still stored). Passed through
verbatim.
defaultOptions?
handlers?
inputRequired?
input_required result instead of a
server→client request. By default the client fulfils these automatically
through the same handlers.sampling/handlers.elicitation callbacks,
retrying up to maxRounds times. Set autoFulfill: false for manual mode.
Has no effect on legacy-era connections. Passed through verbatim to the SDK
client.
legacySSE?
/sse). Default false — such URLs throw a clear error
pointing at Streamable HTTP and this flag, rather than silently connecting
over a transport the MCP SDK itself marks @deprecated. When enabled, a
one-time deprecation warning is logged via console.warn.
prior?
server/discover probe entirely. Takes precedence
over versionNegotiation. { kind: 'modern', discover } adopts a prior
DiscoverResult with zero round trips; { kind: 'legacy' } skips the probe
and runs the plain legacy initialize handshake. Freshness is the caller’s
responsibility — a stale modern verdict fails loudly at the first request; a
stale legacy verdict succeeds silently forever. Reuse only within one
authorization context.
responseCacheStore?
ttlMs/
cacheScope hints on listTools/listResources/listResourceTemplates/
listPrompts/readResource). Defaults to a fresh in-memory store per
client (the SDK’s own default) when omitted. Passed through verbatim.
roots?
versionNegotiation?
'legacy': connect() runs the plain 2025 sequence, byte-identical
to today’s behavior (no probe, no new headers). Pass { mode: 'auto' } to probe
with server/discover and use the modern era when the server supports it
(falling back to legacy otherwise), or { mode: { pin: '2026-07-28' } } to
require the modern era outright. See getProtocolEra() to read the negotiated
result after connecting.