MCP TypeScript SDK (V2)
    Preparing search index...
    ClientOptions: ProtocolOptions & {
        capabilities?: ClientCapabilities;
        jsonSchemaValidator?: jsonSchemaValidator;
        listChanged?: ListChangedHandlers;
    }

    Type Declaration

    • Optionalcapabilities?: ClientCapabilities

      Capabilities to advertise as being supported by this client.

    • OptionaljsonSchemaValidator?: jsonSchemaValidator

      JSON Schema validator for tool output validation.

      The validator is used to validate structured content returned by tools against their declared output schemas.

    • OptionallistChanged?: ListChangedHandlers

      Configure handlers for list changed notifications (tools, prompts, resources).

      const client = new Client(
      { name: 'my-client', version: '1.0.0' },
      {
      listChanged: {
      tools: {
      onChanged: (error, tools) => {
      if (error) {
      console.error('Failed to refresh tools:', error);
      return;
      }
      console.log('Tools updated:', tools);
      }
      },
      prompts: {
      onChanged: (error, prompts) => console.log('Prompts updated:', prompts)
      }
      }
      }
      );