cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
mcp::client::ClientHandler Struct Reference

Optional callback bundle for configuring a Client in one call. More...

#include <handler.hpp>

Public Types

using InitializedHandler = Client::InitializedHandler
 
using CancelledHandler = Client::CancelledHandler
 
using LoggingMessageHandler = Client::LoggingMessageHandler
 
using ChangedHandler = Client::ListChangedHandler
 
using ResourceUpdatedHandler = Client::ResourceUpdatedHandler
 
using ProgressHandler = Client::ProgressHandler
 
using ElicitationCompleteHandler = Client::ElicitationCompleteHandler
 
using TaskStatusHandler = Client::TaskStatusHandler
 
using RootsListRequestHandler = Client::RootsListRequestHandler
 
using SamplingRequestHandler = Client::SamplingRequestHandler
 
using ElicitationRequestHandler = Client::ElicitationRequestHandler
 
using CustomRequestHandler = Client::CustomRequestHandler
 
using RawNotificationHandler = Client::RawNotificationHandler
 

Public Member Functions

void apply_to (Client &client) const
 Applies all non-empty callbacks to a client.
 

Public Attributes

InitializedHandler on_initialized
 Called when the server sends an initialized notification.
 
CancelledHandler on_cancelled
 Called when the server cancels a request.
 
LoggingMessageHandler on_logging_message
 Called for server logging message notifications.
 
ChangedHandler on_tool_list_changed
 Called when the server's tool list changes.
 
ChangedHandler on_prompt_list_changed
 Called when the server's prompt list changes.
 
ChangedHandler on_resource_list_changed
 Called when the server's resource list changes.
 
ResourceUpdatedHandler on_resource_updated
 Called when a subscribed resource URI is updated.
 
ProgressHandler on_progress
 Called for progress notifications.
 
ElicitationCompleteHandler on_elicitation_complete
 Called when an elicitation flow completes.
 
TaskStatusHandler on_task_status
 Called when a task status notification is received.
 
ChangedHandler on_roots_list_changed
 Called when the client's roots list changes.
 
RootsListRequestHandler on_list_roots_request
 Handles server list-roots requests.
 
Client::RootsListRequestCancellationHandler on_list_roots_request_with_cancellation
 
SamplingRequestHandler on_create_message_request
 Handles server sampling createMessage requests.
 
Client::SamplingRequestCancellationHandler on_create_message_request_with_cancellation
 
ElicitationRequestHandler on_create_elicitation_request
 Handles server elicitation requests.
 
Client::ElicitationRequestCancellationHandler on_create_elicitation_request_with_cancellation
 
CustomRequestHandler on_custom_request
 Handles custom server requests.
 
Client::CustomRequestCancellationHandler on_custom_request_with_cancellation
 
RootsListRequestHandler on_roots_list_request
 Compatibility alias for on_list_roots_request.
 
Client::RootsListRequestCancellationHandler on_roots_list_request_with_cancellation
 
SamplingRequestHandler on_sampling_request
 Compatibility alias for on_create_message_request.
 
Client::SamplingRequestCancellationHandler on_sampling_request_with_cancellation
 
ElicitationRequestHandler on_elicitation_request
 Compatibility alias for on_create_elicitation_request.
 
Client::ElicitationRequestCancellationHandler on_elicitation_request_with_cancellation
 
RawNotificationHandler on_raw_notification
 Observes raw inbound notifications after built-in dispatch.
 
RawNotificationHandler on_custom_notification
 Compatibility alias for on_raw_notification.
 

Detailed Description

Optional callback bundle for configuring a Client in one call.

Each member mirrors a Client::on_* registration function. apply_to() and Client::set_handler() install only non-empty members; empty members leave any existing callback on the target Client unchanged.

Member Function Documentation

◆ apply_to()

void mcp::client::ClientHandler::apply_to ( Client client) const
inline

Applies all non-empty callbacks to a client.

Parameters
clientClient to configure.

The documentation for this struct was generated from the following file: