MCPcopy Create free account
hub / github.com/modelcontextprotocol/typescript-sdk / registerCapabilities

Method registerCapabilities

src/client/index.ts:318–324  ·  view source on GitHub ↗

* Registers new capabilities. This can only be called before connecting to a transport. * * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).

(capabilities: ClientCapabilities)

Source from the content-addressed store, hash-verified

316 * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
317 */
318 public registerCapabilities(capabilities: ClientCapabilities): void {
319 if (this.transport) {
320 throw new Error('Cannot register capabilities after connecting to transport');
321 }
322
323 this._capabilities = mergeCapabilities(this._capabilities, capabilities);
324 }
325
326 /**
327 * Override request handler registration to enforce client-side validation for elicitation.

Callers 1

mcp.test.tsFile · 0.45

Calls 1

mergeCapabilitiesFunction · 0.85

Tested by

no test coverage detected