$darkmode
McpServer class definition; to be registered as a handler in the HttpServer class. More...
Inherits JsonRpcHandler, and ServerSentEventHandler.
Public Member Methods | |
constructor (Logger::LoggerInterface logger, HttpServer::AbstractAuthenticator auth) | |
Creates the handler. | |
constructor (HttpServer::AbstractAuthenticator auth) | |
Creates the handler. | |
constructor () | |
Creates the handler. | |
registerTool (string name, string desc, *AbstractDataProviderType input, code tool) | |
Registers a tool. | |
*string | getCompatV1Endpoint (hash< auto > cx, hash< auto > hdr) |
Returns the 2024-11-05 JSON-RPC compatible endpoint, if any. | |
ServerSentEventConnection | getConnectionImpl (Socket sock, hash< auto > cx, hash< auto > hdr, string cid) |
Called when a connection is established; the default implementation creates a ServerSentEventConnection object. | |
Public Attributes | |
const | NoInputDescription = ... |
The input description for tools that do not require any input. | |
const | SseHandlerOpts = ... |
Default SSE handler options. | |
Private Member Methods | |
registerNewConnectionIntern (string cid, ServerSentEventConnection conn) | |
Called while holding the write lock to register the new connection. | |
Private Attributes | |
hash< string, hash< McpToolInfo > > | tmap |
Registered tools: name -> tool. | |
hash< string, hash< McpSessionInfo > > | smap |
Session map; session ID -> session info. | |
hash< string, int > | sidmap |
Session ID map. | |
McpServer class definition; to be registered as a handler in the HttpServer class.