Qore json Module 1.9.1
Loading...
Searching...
No Matches
McpServerHandler::McpServerHandler Class Reference

McpServer class definition; to be registered as a handler in the HttpServer class. More...

#include <McpServerHandler.qc.dox.h>

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.
 
const MaxMcpToolNameLength = 64
 Maximum name length for an MCP tool.
 

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.
 

Detailed Description

McpServer class definition; to be registered as a handler in the HttpServer class.


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