Interface: MCPSubscription
Defined in: node_modules/.bun/@modelcontextprotocol+client@2.2.0/node_modules/@modelcontextprotocol/client/dist/index.d.mts:2103
A handle to an open subscriptions/listen stream (protocol revision
2026-07-28). Change notifications delivered on the stream dispatch to the
existing Client.setNotificationHandler registrations.
Properties
closed
readonlyclosed:Promise<"local"|"graceful"|"remote">
Defined in: node_modules/.bun/@modelcontextprotocol+client@2.2.0/node_modules/@modelcontextprotocol/client/dist/index.d.mts:2128
Resolves exactly once when the subscription has terminated. Never rejects — this is an observation, not an operation.
'local'— you calledclose(or aborted theRequestOptions.signalyou passed tolisten()).'graceful'— the server ended the subscription deliberately by sending the emptysubscriptions/listenresponse (e.g. on shutdown).'remote'— the stream ended without a response, or the transport dropped — an unexpected disconnect. Re-listen if you still want events.
honoredFilter
readonlyhonoredFilter:object
Defined in: node_modules/.bun/@modelcontextprotocol+client@2.2.0/node_modules/@modelcontextprotocol/client/dist/index.d.mts:2108
The subset of the requested filter the server agreed to honor (from
notifications/subscriptions/acknowledged).
promptsListChanged?
optionalpromptsListChanged?:boolean
resourcesListChanged?
optionalresourcesListChanged?:boolean
resourceSubscriptions?
optionalresourceSubscriptions?:string[]
toolsListChanged?
optionaltoolsListChanged?:boolean
Methods
close()
close():
Promise<void>
Defined in: node_modules/.bun/@modelcontextprotocol+client@2.2.0/node_modules/@modelcontextprotocol/client/dist/index.d.mts:2115
Tears the subscription down. Idempotent. Aborts the listen request's
stream (where the transport supports it) AND sends
notifications/cancelled referencing the listen request id — both,
always, so close works on any transport.
Returns
Promise<void>