Implements
Constructors
Constructor
Parameters
input
ClientTransportInput
options?
ClientOptions
Returns
Client
Methods
[asyncDispose]()
Returns
Promise<void>
Implementation of
IClient.[asyncDispose]
callTool()
Type Parameters
TData
TData = unknown
Parameters
name
string
args?
Record<string, unknown>
options?
CallToolOptions
Returns
Promise<CallToolResult<TData>>
Implementation of
IClient.callTool
callToolRaw()
Type Parameters
TData
TData = unknown
Parameters
name
string
args?
Record<string, unknown>
options?
CallToolOptions
Returns
Promise<CallToolResult<TData>>
close()
Returns
Promise<void>
Implementation of
IClient.close
complete()
Parameters
ref
| {name: string;
type: "ref/prompt";
}
| {
type: "ref/resource";
uri: string;
}
argument
name
string
value
string
context?
arguments?
Record<string, string>
options?
RequestOptions
Returns
Promise<CompletionResult>
Implementation of
IClient.complete
connect()
Returns
Promise<void>
Implementation of
IClient.connect
getPrompt()
Parameters
name
string
args?
Record<string, string>
options?
RequestOptions
Returns
Promise<{
[key: string]: unknown;
}>
Implementation of
IClient.getPrompt
getProtocolEra()
'modern' for 2026-07-28 (per-request
envelope), 'legacy' for 2025-11-25 and earlier (the initialize handshake).
undefined before connect(). See ClientOptions.versionNegotiation.
Returns
ProtocolEra | undefined
isConnected()
Returns
boolean
Implementation of
IClient.isConnected
listPrompts()
Parameters
options?
RequestOptions
Returns
Promise<{
}[]>
Implementation of
IClient.listPrompts
listResources()
Parameters
options?
RequestOptions
Returns
Promise<{
}[]>
Implementation of
IClient.listResources
listResourceTemplates()
Parameters
options?
RequestOptions
Returns
Promise<{
}[]>
Implementation of
IClient.listResourceTemplates
listTools()
Parameters
options?
RequestOptions
Returns
Promise<{
}[]>
Implementation of
IClient.listTools
notifyRootsChanged()
Returns
Promise<void>
ping()
ping RPC. On a
modern (2026-07-28) connection ping is not a wire method — the era’s
registry deliberately excludes it — so this sends server/discover
instead: any successful response is equally strong liveness evidence, and
discover() is the SDK-native modern equivalent (rather than a
hand-rolled substitute). Returns false only on legacy ping’s own
result; a modern-era failure throws, matching ping()’s existing
throw-on-failure contract.
Parameters
options?
RequestOptions
Returns
Promise<boolean>
Implementation of
IClient.ping
readResource()
Parameters
uri
string
options?
RequestOptions
Returns
Promise<(
| {
}
| {
})[]>
Implementation of
IClient.readResource
readResourceRaw()
Parameters
uri
string
options?
RequestOptions
Returns
Promise<{
[key: string]: unknown;
}>
setLogLevel()
logging/setLevel RPC, unchanged. On
a modern (2026-07-28) connection logging/setLevel is deprecated (SEP-2577)
and physically absent from the era’s registry — there is no RPC to send.
Instead, the level is recorded and threaded into
_meta['io.modelcontextprotocol/logLevel'] on every subsequent request via
_metaParams(), per request; user-supplied _meta still wins if a caller
passes one explicitly (there is no such call site in this class today).
Parameters
level
LoggingLevel
options?
RequestOptions
Returns
Promise<void>
Implementation of
IClient.setLogLevel
subscribeResource()
handler fires whenever
the server sends a matching update, on either protocol era: on a legacy
(2025-era) connection via the resources/subscribe RPC and unsolicited
notifications/resources/updated push, or on a modern (2026-07-28) connection
via a subscriptions/listen stream opted into resourceSubscriptions — both
dispatch to the same notifications/resources/updated handler registered in
_registerHandlers, so this method is the only era-aware part.
Parameters
uri
string
handler
ResourceUpdateHandler
options?
RequestOptions
Returns
Promise<void>
Implementation of
IClient.subscribeResource
unsubscribeResource()
Parameters
uri
string
options?
RequestOptions
Returns
Promise<void>
Implementation of
IClient.unsubscribeResource
connect()
Call Signature
Parameters
input
McpConfig
options?
MultiServerOptions
Returns
Promise<MultiServerClient>
Call Signature
await using for automatic cleanup.
Parameters
input
ClientTransportInput
options?
ClientOptions
Returns
Promise<Client>