cxxmcp 1.1.6
C++ MCP SDK
Loading...
Searching...
No Matches
mcp::server::ServerHandler Struct Reference

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

#include <handler.hpp>

Public Types

using JsonHandler = Server::JsonHandler
 
using JsonContextHandler = Server::JsonContextHandler
 
using JsonRequestContextHandler = Server::JsonRequestContextHandler
 
using LoggingHandler = Server::LoggingHandler
 
using RawRequestHandler = Server::RawRequestHandler
 
using RawNotificationHandler = Server::RawNotificationHandler
 
using ToolsListHandler = Server::ToolsListHandler
 
using PromptsListHandler = Server::PromptsListHandler
 
using ResourcesListHandler = Server::ResourcesListHandler
 
using ResourceTemplatesListHandler = Server::ResourceTemplatesListHandler
 
using TaskListHandler = Server::TaskListHandler
 
using TaskGetHandler = Server::TaskGetHandler
 
using TaskCancelHandler = Server::TaskCancelHandler
 
using TaskResultHandler = Server::TaskResultHandler
 
using RootsListChangedHandler = Server::RootsListChangedHandler
 
using ProgressHandler = Server::ProgressHandler
 
using ListChangedHandler = Server::ListChangedHandler
 
using ResourceUpdatedHandler = Server::ResourceUpdatedHandler
 

Public Member Functions

void apply_to (Server &server) const
 Applies all non-empty callbacks to a server.
 

Public Attributes

JsonHandler on_completion
 Handles completion requests.
 
JsonHandler on_sampling
 Handles sampling requests.
 
LoggingHandler on_logging
 Handles logging notifications.
 
RawRequestHandler on_raw_request
 Optionally handles raw requests before built-in dispatch.
 
RawNotificationHandler on_raw_notification
 Handles raw notifications.
 
RawRequestHandler on_custom_request
 Optionally handles custom requests.
 
RawNotificationHandler on_custom_notification
 Handles custom notifications.
 
ToolsListHandler on_tools_list
 Handles tools/list requests.
 
PromptsListHandler on_prompts_list
 Handles prompts/list requests.
 
ResourcesListHandler on_resources_list
 Handles resources/list requests.
 
ResourceTemplatesListHandler on_resource_templates_list
 Handles resources/templates/list requests.
 
TaskListHandler on_task_list
 Handles task list requests.
 
TaskGetHandler on_task_get
 Handles task get requests.
 
TaskCancelHandler on_task_cancel
 Handles task cancel requests.
 
TaskResultHandler on_task_result
 Handles task result requests.
 
ProgressHandler on_progress
 Handles progress notifications from clients.
 
RootsListChangedHandler on_roots_list_changed
 Handles roots-list-changed notifications from clients.
 
ListChangedHandler on_tool_list_changed
 Handles tool-list-changed notifications from clients.
 
ListChangedHandler on_prompt_list_changed
 Handles prompt-list-changed notifications from clients.
 
ListChangedHandler on_resource_list_changed
 Handles resource-list-changed notifications from clients.
 
ResourceUpdatedHandler on_resource_updated
 Handles resource-updated notifications from clients.
 
JsonContextHandler on_completion_with_context
 Handles completion requests with session context.
 
JsonContextHandler on_sampling_with_context
 Handles sampling requests with session context.
 
JsonRequestContextHandler on_completion_with_request_context
 Handles completion requests with session context and cancellation.
 
JsonRequestContextHandler on_sampling_with_request_context
 Handles sampling requests with session context and cancellation.
 

Detailed Description

Optional callback bundle for configuring a Server in one call.

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

Member Function Documentation

◆ apply_to()

void mcp::server::ServerHandler::apply_to ( Server server) const
inline

Applies all non-empty callbacks to a server.

Parameters
serverServer to configure.

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