![]() |
Qore json Module 1.11.0
|
The McpServerHandler module provides server-side support for the Model Context Protocol (MCP) using the HttpServer module. It exposes tools, resources, prompts, and notifications via JSON-RPC over HTTP and Server-Sent Events (SSE).
This module implements the full MCP 2025-11-25 protocol specification.
The following classes are provided by this module:
The handler supports MCP notifications over SSE. Clients can open a GET request with an Accept: text/event-stream header to receive notifications and streamed responses.
The handler supports the MCP Tasks API for background task execution:
tasks/get: Get task status by IDtasks/result: Block until task completes and return resulttasks/cancel: Cancel a running tasktasks/list: List all tasks for the sessionTo execute a tool call as a background task, include _meta.task: true in the request.
The handler supports:
resources/subscribe and resources/unsubscribe resources/templates/list notifications/resources/updated The server can send progress notifications using the sendProgress() method. Include _meta.progressToken in requests to enable progress tracking.
The server can request LLM completions from the client using requestSampling() and user input using requestElicitationForm() (requires client capability support).
tasks/get, tasks/result, tasks/cancel, tasks/list)_meta.task parameter)resources/subscribe, resources/unsubscribe)resources/templates/list)notifications/progress)McpTaskStatus enum, McpTaskInfo, McpResourceSubscription, McpResourceTemplateInfo, McpProgressInfo, McpPendingRequest, McpCancellationInfo