unmbt/ciallo-mcp/protocol does not have a README file

    InputRequired

    pub(all) suberror InputRequired {
    InputRequired(input_requests~ : Map[String, InputRequest]?, request_state~ : String?, meta~ : Map[String,
    Json
    ]?)
    } derive(Eq,
    Debug
    )

    Raised by a tools/call, prompts/get, or resources/read handler to pause execution and request client input (SEP-2322 multi-round-trip).

    McpProtocolError

    pub(all) suberror McpProtocolError {
    ProtocolError(code~ : Int, message~ : String, data~ :
    Json
    ?)
    } derive(Eq,
    Debug
    )

    Structured MCP JSON-RPC protocol error raised by handlers or client RPCs.

    McpProtocolError::header_mismatch

    fn McpProtocolError::header_mismatch(detail : String, header~ : String, body~ : String) -> McpProtocolError

    Emits -32020 (HeaderMismatch) with data: { mismatch: { header, body } }.

    McpProtocolError::internal_error

    fn McpProtocolError::internal_error(message : String, data? :
    Json
    ) -> McpProtocolError

    McpProtocolError::invalid_params

    fn McpProtocolError::invalid_params(message : String, data? :
    Json
    ) -> McpProtocolError

    McpProtocolError::method_not_found

    fn McpProtocolError::method_not_found(meth : String) -> McpProtocolError

    McpProtocolError::missing_required_client_capability

    fn McpProtocolError::missing_required_client_capability(required_capabilities :
    Json
    ) -> McpProtocolError

    Emits -32021 (MissingRequiredClientCapability) with data: { requiredCapabilities }.

    McpProtocolError::resource_not_found

    fn McpProtocolError::resource_not_found(uri : String) -> McpProtocolError

    MCP 2025-11-25 spec: missing resource emits -32602 with data: { "uri": uri }.

    McpProtocolError::unsupported_protocol_version

    fn McpProtocolError::unsupported_protocol_version(version : String) -> McpProtocolError

    McpProtocolError::unsupported_protocol_version_list

    fn McpProtocolError::unsupported_protocol_version_list(requested? : String, supported? : Array[String]) -> McpProtocolError

    Emits -32022 (UnsupportedProtocolVersion) with data: { supported, requested? }.

    McpProtocolError::url_elicitation_required

    fn McpProtocolError::url_elicitation_required(message : String, elicitations : Array[ElicitUrlParams]) -> McpProtocolError

    RequestStateError

    pub(all) suberror RequestStateError {
    InvalidKeyLength(Int)
    Malformed
    InvalidMac
    Expired
    BindMismatch
    } derive(Eq,
    Debug
    )

    Opaque error raised by RequestStateCodec::verify (never leaks decoded payload or binding values).

    CacheHint

    pub(all) struct CacheHint {
    ttl_ms : Int
    cache_scope : CacheScope
    } derive(Eq,
    Debug
    )

    SEP-2549 cache hint (ttlMs and cacheScope) for 2026-07-28 cacheable results.

    CacheHint::CacheHint

    fn CacheHint::CacheHint(ttl_ms? : Int, cache_scope? : CacheScope) -> CacheHint

    CacheScope

    pub(all) enum CacheScope {
    Public
    Private
    } derive(Eq,
    Debug
    )

    SEP-2549 cache scope for 2026-07-28 cacheable results.

    CacheScope::as_str

    fn CacheScope::as_str(self : CacheScope) -> String

    CallToolResult

    pub(all) struct CallToolResult {
    content : Array[ContentBlock]
    structured_content :
    Json
    ?
    is_error : Bool
    meta : Map[String,
    Json
    ]?
    } derive(Eq,
    Debug
    )

    Result of executing a tool (tools/call).

    CallToolResult::CallToolResult

    fn CallToolResult::CallToolResult(content : Array[ContentBlock], structured_content? :
    Json
    , is_error? : Bool, meta? : Map[String,
    Json
    ]) -> CallToolResult

    CallToolResult::json

    fn CallToolResult::json(value :
    Json
    , is_error? : Bool) -> CallToolResult

    CallToolResult::text

    fn CallToolResult::text(text : String, is_error? : Bool, structured_content? :
    Json
    ) -> CallToolResult

    CallToolResult::to_json

    CallToolResult::to_json_for_era

    fn CallToolResult::to_json_for_era(self : CallToolResult, is_modern~ : Bool, output_schema? :
    Json
    ) ->
    Json

    Serializes CallToolResult respecting era wire rules (SEP-2106):
    • 搂4.3 TextContent auto-append (both eras): when structuredContent is a non-object value (array/primitive/null) and content carries no Text block, appends { "type": "text", "text": structuredContent.stringify() }.
    • On 2025-11-25 (is_modern=false), structuredContent MUST be a JSON object (non-object values are wrapped as { "result": value }).
    • On 2026-07-28 (is_modern=true), any JSON value is emitted verbatim.

    CompiledXMcpHeaders

    pub struct CompiledXMcpHeaders {
    // private fields
    } derive(Eq,
    Debug
    )

    Pre-scanned SEP-2243 x-mcp-header declarations cached once per tool at registration time.

    CompiledXMcpHeaders::fault

    fn CompiledXMcpHeaders::fault(self : CompiledXMcpHeaders) -> String?

    CompiledXMcpHeaders::header_count

    fn CompiledXMcpHeaders::header_count(self : CompiledXMcpHeaders) -> Int

    CompiledXMcpHeaders::is_empty

    fn CompiledXMcpHeaders::is_empty(self : CompiledXMcpHeaders) -> Bool

    CompleteContext

    pub(all) struct CompleteContext {
    arguments : Map[String, String]
    } derive(Eq,
    Debug
    )

    CompleteContext::CompleteContext

    fn CompleteContext::CompleteContext(arguments? : Map[String, String]) -> CompleteContext

    CompleteResult

    pub(all) struct CompleteResult {
    values : Array[String]
    total : Int?
    has_more : Bool?
    } derive(Eq,
    Debug
    )

    CompleteResult::CompleteResult

    fn CompleteResult::CompleteResult(values : Array[String], total? : Int, has_more? : Bool) -> CompleteResult

    CompleteResult::to_json

    MCP spec caps completion.values at 100 items and adjusts total / hasMore.

    ContentBlock

    pub(all) enum ContentBlock {
    Text(text~ : String, annotations~ : McpAnnotations?, meta~ : Map[String,
    Json
    ]?)
    Image(data~ : String, mime_type~ : String, annotations~ : McpAnnotations?, meta~ : Map[String,
    Json
    ]?)
    Audio(data~ : String, mime_type~ : String, annotations~ : McpAnnotations?, meta~ : Map[String,
    Json
    ]?)
    ResourceLink(uri~ : String, name~ : String, title~ : String?, description~ : String?, mime_type~ : String?, size~ : Int64?, icons~ : Array[McpIcon], annotations~ : McpAnnotations?, meta~ : Map[String,
    Json
    ]?)
    EmbeddedResource(resource~ : ResourceContents, annotations~ : McpAnnotations?, meta~ : Map[String,
    Json
    ]?)
    } derive(Eq,
    Debug
    )

    Multimodal MCP 2025-11-25 ContentBlock union (text, image, audio, resource_link, resource).

    ContentBlock::audio_bytes

    fn ContentBlock::audio_bytes(bytes : Bytes, mime_type~ : String, annotations? : McpAnnotations, meta? : Map[String,
    Json
    ]) -> ContentBlock

    ContentBlock::embedded_resource

    fn ContentBlock::embedded_resource(resource : ResourceContents, annotations? : McpAnnotations, meta? : Map[String,
    Json
    ]) -> ContentBlock

    ContentBlock::image_bytes

    fn ContentBlock::image_bytes(bytes : Bytes, mime_type~ : String, annotations? : McpAnnotations, meta? : Map[String,
    Json
    ]) -> ContentBlock

    fn ContentBlock::resource_link(uri~ : String, name~ : String, title? : String, description? : String, mime_type? : String, size? : Int64, icons? : Array[McpIcon], annotations? : McpAnnotations, meta? : Map[String,
    Json
    ]) -> ContentBlock

    ContentBlock::text

    fn ContentBlock::text(text : String, annotations? : McpAnnotations, meta? : Map[String,
    Json
    ]) -> ContentBlock

    ContentBlock::to_json

    CreateMessageParams

    pub(all) struct CreateMessageParams {
    messages : Array[SamplingMessage]
    max_tokens : Int
    system_prompt : String?
    model_preferences : ModelPreferences?
    temperature : Double?
    stop_sequences : Array[String]
    include_context : String?
    metadata :
    Json
    ?
    tools : Array[
    Json
    ]
    tool_choice :
    Json
    ?
    } derive(Eq,
    Debug
    )

    CreateMessageParams::CreateMessageParams

    fn CreateMessageParams::CreateMessageParams(messages~ : Array[SamplingMessage], max_tokens~ : Int, system_prompt? : String, model_preferences? : ModelPreferences, temperature? : Double, stop_sequences? : Array[String], include_context? : String, metadata? :
    Json
    , tools? : Array[
    Json
    ], tool_choice? :
    Json
    ) -> CreateMessageParams

    CreateMessageParams::to_json

    CreateMessageResult

    pub(all) struct CreateMessageResult {
    role : PromptRole
    content : ContentBlock
    model : String
    stop_reason : String?
    } derive(Eq,
    Debug
    )

    ElicitAction

    pub(all) enum ElicitAction {
    Accept
    Decline
    Cancel
    } derive(Eq,
    Debug
    )

    ElicitAction::as_str

    fn ElicitAction::as_str(self : ElicitAction) -> String

    ElicitAction::parse

    fn ElicitAction::parse(s : StringView) -> ElicitAction?

    ElicitFormParams

    pub(all) struct ElicitFormParams {
    message : String
    requested_schema :
    Json

    } derive(Eq,
    Debug
    )

    ElicitFormParams::ElicitFormParams

    fn ElicitFormParams::ElicitFormParams(message~ : String, requested_schema~ :
    Json
    ) -> ElicitFormParams

    ElicitFormParams::to_json

    ElicitResult

    pub(all) struct ElicitResult {
    action : ElicitAction
    content : Map[String,
    Json
    ]?
    } derive(Eq,
    Debug
    )

    ElicitUrlParams

    pub(all) struct ElicitUrlParams {
    message : String
    elicitation_id : String
    url : String
    } derive(Eq,
    Debug
    )

    ElicitUrlParams::ElicitUrlParams

    fn ElicitUrlParams::ElicitUrlParams(message~ : String, elicitation_id~ : String, url~ : String) -> ElicitUrlParams

    ElicitUrlParams::to_json

    GetPromptResult

    pub(all) struct GetPromptResult {
    description : String?
    messages : Array[PromptMessage]
    meta : Map[String,
    Json
    ]?
    } derive(Eq,
    Debug
    )

    GetPromptResult::GetPromptResult

    fn GetPromptResult::GetPromptResult(messages : Array[PromptMessage], description? : String, meta? : Map[String,
    Json
    ]) -> GetPromptResult

    GetPromptResult::to_json

    HttpResponseMode

    pub(all) enum HttpResponseMode {
    Auto
    Sse
    Json
    } derive(Eq,
    Debug
    )

    How mount_http shapes HTTP responses for modern (2026-07-28) request exchanges (matches @modelcontextprotocol/server PerRequestResponseMode).

    IconTheme

    pub(all) enum IconTheme {
    Light
    Dark
    } derive(Eq,
    Debug
    )

    IconTheme::as_str

    fn IconTheme::as_str(self : IconTheme) -> String

    InputRequest

    pub(all) enum InputRequest {
    ElicitForm(ElicitFormParams)
    ElicitUrl(message~ : String, url~ : String, elicitation_id~ : String?)
    CreateMessage(CreateMessageParams)
    ListRoots
    } derive(Eq,
    Debug
    )

    Embedded client input request for MCP 2026-07-28 multi-round-trip requests (SEP-2322). Works seamlessly across both eras: emitted as resultType: "input_required" on 2026-07-28, and automatically shimmed over bidirectional Server鈫扖lient JSON-RPC requests on 2025-11-25.

    InputRequest::create_message

    fn InputRequest::create_message(params : CreateMessageParams) -> InputRequest

    InputRequest::elicit_form

    fn InputRequest::elicit_form(params : ElicitFormParams) -> InputRequest

    InputRequest::elicit_url

    fn InputRequest::elicit_url(message~ : String, url~ : String, elicitation_id? : String) -> InputRequest

    InputRequest::list_roots

    fn InputRequest::list_roots() -> InputRequest

    InputRequest::to_json

    Serializes an InputRequest into the 2026-07-28 de-JSON-RPC'd wire format.

    LegacyHttpMode

    pub(all) enum LegacyHttpMode {
    Stateless
    Reject
    } derive(Eq,
    Debug
    )

    How mount_http handles legacy (pre-2026-07-28, envelope-less) HTTP requests.

    McpAnnotations

    pub(all) struct McpAnnotations {
    audience : Array[PromptRole]?
    priority : Double?
    last_modified : String?
    } derive(Eq,
    Debug
    )

    MCP content / resource annotations (audience, priority, lastModified).

    McpAnnotations::McpAnnotations

    fn McpAnnotations::McpAnnotations(audience? : Array[PromptRole], priority? : Double, last_modified? : String) -> McpAnnotations

    McpAnnotations::to_json

    McpEra

    pub(all) enum McpEra {
    Legacy
    Modern
    } derive(Eq,
    Debug
    )

    Protocol era: Legacy (2025-11-25 and earlier via initialize) or Modern (2026-07-28 and later via server/discover & per-request _meta envelope).

    McpFilter

    pub(all) struct McpFilter {
    prefix : String?
    tags : Array[String]
    exclude_paths : Array[String]
    include_streaming : Bool
    } derive(Eq,
    Debug
    )

    McpFilter::McpFilter

    fn McpFilter::McpFilter(prefix? : String, tags? : Array[String], exclude_paths? : Array[String], include_streaming? : Bool) -> McpFilter

    McpHttpOptions

    pub(all) struct McpHttpOptions {
    legacy_mode : LegacyHttpMode
    response_mode : HttpResponseMode
    max_request_body_size : Int64
    keep_alive_ms : Int
    allowed_origins : Array[String]?
    allowed_hosts : Array[String]?
    } derive(Eq,
    Debug
    )

    Configuration for McpServer::mount_http (Streamable HTTP + dual-era 2026-07-28/2025-11-25).

    McpHttpOptions::McpHttpOptions

    fn McpHttpOptions::McpHttpOptions(legacy_mode? : LegacyHttpMode, response_mode? : HttpResponseMode, max_request_body_size? : Int64, keep_alive_ms? : Int, allowed_origins? : Array[String], allowed_hosts? : Array[String]) -> McpHttpOptions

    McpIcon

    pub(all) struct McpIcon {
    src : String
    mime_type : String?
    sizes : Array[String]
    theme : IconTheme?
    } derive(Eq,
    Debug
    )

    McpIcon::McpIcon

    fn McpIcon::McpIcon(src~ : String, mime_type? : String, sizes? : Array[String], theme? : IconTheme) -> McpIcon

    McpIcon::to_json

    McpImplementation

    pub(all) struct McpImplementation {
    name : String
    version : String
    title : String?
    description : String?
    website_url : String?
    icons : Array[McpIcon]
    } derive(Eq,
    Debug
    )

    Rich MCP server / client Implementation descriptor (2025-11-25).

    McpImplementation::McpImplementation

    fn McpImplementation::McpImplementation(name~ : String, version~ : String, title? : String, description? : String, website_url? : String, icons? : Array[McpIcon]) -> McpImplementation

    McpImplementation::from_openapi

    McpImplementation::to_json

    McpLogLevel

    pub(all) enum McpLogLevel {
    Debug
    Info
    Notice
    Warning
    Error
    Critical
    Alert
    Emergency
    } derive(Eq,
    Debug
    )

    RFC-5424 8-level MCP Logging severity.

    McpLogLevel::as_str

    fn McpLogLevel::as_str(self : McpLogLevel) -> String

    McpLogLevel::parse

    fn McpLogLevel::parse(s : StringView) -> McpLogLevel?

    McpLogLevel::rank

    fn McpLogLevel::rank(self : McpLogLevel) -> Int

    McpResourceInfo

    pub(all) struct McpResourceInfo {
    uri : String
    name : String
    title : String?
    description : String?
    mime_type : String?
    size : Int64?
    icons : Array[McpIcon]
    annotations : McpAnnotations?
    meta : Map[String,
    Json
    ]?
    } derive(Eq,
    Debug
    )

    Static or listed MCP Resource metadata descriptor.

    McpResourceInfo::McpResourceInfo

    fn McpResourceInfo::McpResourceInfo(uri~ : String, name~ : String, title? : String, description? : String, mime_type? : String, size? : Int64, icons? : Array[McpIcon], annotations? : McpAnnotations, meta? : Map[String,
    Json
    ]) -> McpResourceInfo

    McpResourceInfo::to_json

    McpResourceTemplateInfo

    pub(all) struct McpResourceTemplateInfo {
    uri_template : String
    name : String
    title : String?
    description : String?
    mime_type : String?
    icons : Array[McpIcon]
    annotations : McpAnnotations?
    meta : Map[String,
    Json
    ]?
    } derive(Eq,
    Debug
    )

    RFC 6570 Resource Template metadata descriptor.

    McpResourceTemplateInfo::McpResourceTemplateInfo

    fn McpResourceTemplateInfo::McpResourceTemplateInfo(uri_template~ : String, name~ : String, title? : String, description? : String, mime_type? : String, icons? : Array[McpIcon], annotations? : McpAnnotations, meta? : Map[String,
    Json
    ]) -> McpResourceTemplateInfo

    McpResourceTemplateInfo::to_json

    McpRoot

    pub(all) struct McpRoot {
    uri : String
    name : String?
    } derive(Eq,
    Debug
    )

    Client filesystem / workspace root returned by roots/list.

    McpRoot::McpRoot

    fn McpRoot::McpRoot(uri~ : String, name? : String) -> McpRoot

    McpRoot::to_json

    McpTool

    pub(all) struct McpTool {
    name : String
    title : String?
    description : String
    input_schema :
    Json

    output_schema :
    Json
    ?
    annotations : ToolAnnotations?
    icons : Array[McpIcon]
    meta : Map[String,
    Json
    ]?
    meth :
    Method

    path : String
    param_names : Array[String]
    query_names : Array[String]
    body_is_wrapped : Bool
    body_fields : Array[String]
    bearer_auth : Bool
    is_streaming : Bool
    } derive(Eq,
    Debug
    )

    McpTool::to_anthropic_tool_json

    fn McpTool::to_anthropic_tool_json(self : McpTool) ->
    Json

    McpTool::to_mcp_json

    McpTool::to_openai_function_json

    fn McpTool::to_openai_function_json(self : McpTool) ->
    Json

    McpTransport

    pub(all) enum McpTransport {
    Stdio
    StreamableHttp
    } derive(Eq,
    Debug
    )

    Identifies the active MCP transport executing a request.

    ModelHint

    pub(all) struct ModelHint {
    name : String?
    } derive(Eq,
    Debug
    )

    ModelHint::ModelHint

    fn ModelHint::ModelHint(name? : String) -> ModelHint

    ModelHint::to_json

    ModelPreferences

    pub(all) struct ModelPreferences {
    hints : Array[ModelHint]
    cost_priority : Double?
    speed_priority : Double?
    intelligence_priority : Double?
    } derive(Eq,
    Debug
    )

    ModelPreferences::ModelPreferences

    fn ModelPreferences::ModelPreferences(hints? : Array[ModelHint], cost_priority? : Double, speed_priority? : Double, intelligence_priority? : Double) -> ModelPreferences

    ModelPreferences::to_json

    PromptArgument

    pub(all) struct PromptArgument {
    name : String
    description : String?
    required : Bool
    } derive(Eq,
    Debug
    )

    PromptArgument::PromptArgument

    fn PromptArgument::PromptArgument(name~ : String, description? : String, required? : Bool) -> PromptArgument

    PromptArgument::to_json

    PromptMessage

    pub(all) struct PromptMessage {
    role : PromptRole
    content : ContentBlock
    } derive(Eq,
    Debug
    )

    PromptMessage::PromptMessage

    fn PromptMessage::PromptMessage(role~ : PromptRole, content~ : ContentBlock) -> PromptMessage

    PromptMessage::assistant_text

    fn PromptMessage::assistant_text(text : String) -> PromptMessage

    PromptMessage::to_json

    PromptMessage::user_text

    fn PromptMessage::user_text(text : String) -> PromptMessage

    PromptRole

    pub(all) enum PromptRole {
    User
    Assistant
    } derive(Eq,
    Debug
    )

    PromptRole::as_str

    fn PromptRole::as_str(self : PromptRole) -> String

    PromptRole::parse

    fn PromptRole::parse(s : StringView) -> PromptRole?

    ReadResourceResult

    pub(all) struct ReadResourceResult {
    contents : Array[ResourceContents]
    meta : Map[String,
    Json
    ]?
    } derive(Eq,
    Debug
    )

    ReadResourceResult::ReadResourceResult

    fn ReadResourceResult::ReadResourceResult(contents : Array[ResourceContents], meta? : Map[String,
    Json
    ]) -> ReadResourceResult

    ReadResourceResult::to_json

    RequestStateCodec

    pub struct RequestStateCodec {
    // private fields
    }

    Opt-in HMAC-SHA256 integrity codec for MCP 2026-07-28 multi-round-trip requestState (exact wire format parity with @modelcontextprotocol/server createRequestStateCodec):

    "v1." b64url({"p":<payload>,"exp":<unixSeconds>,"b":<bindTag>?}) "." b64url(mac)

    where bindTag = b64url(HMAC-SHA256(key, "mcp.requestState.bind:" + bind_value)[:16]). Signed, not encrypted; verification is fail-closed and constant-time.

    RequestStateCodec::RequestStateCodec

    fn RequestStateCodec::RequestStateCodec(key~ : Bytes, ttl_seconds? : Int64, has_bind? : Bool) -> RequestStateCodec raise RequestStateError

    Creates a RequestStateCodec. key MUST be at least 32 bytes (256 bits).

    RequestStateCodec::from_secret

    fn RequestStateCodec::from_secret(secret~ : String, ttl_seconds? : Int64, has_bind? : Bool) -> RequestStateCodec raise RequestStateError

    Convenience constructor accepting a UTF-8 string secret (must be >= 32 UTF-8 bytes).

    RequestStateCodec::mint

    fn RequestStateCodec::mint(self : RequestStateCodec, payload :
    Json
    , now_seconds~ : Int64, bind_value? : String) -> String raise RequestStateError

    Seals payload into a versioned HMAC-SHA256-authenticated requestState string. now_seconds is the current Unix timestamp in seconds; bind_value must be provided when the codec was created with has_bind=true.

    RequestStateCodec::verify

    fn RequestStateCodec::verify(self : RequestStateCodec, state : String, now_seconds~ : Int64, bind_value? : String) ->
    Json
    raise RequestStateError

    Verifies an echoed requestState string (fail-closed, constant-time MAC & bind-tag check) and returns the original JSON payload.

    ResourceContents

    pub(all) enum ResourceContents {
    Text(uri~ : String, mime_type~ : String?, text~ : String, meta~ : Map[String,
    Json
    ]?)
    Blob(uri~ : String, mime_type~ : String?, blob~ : String, meta~ : Map[String,
    Json
    ]?)
    } derive(Eq,
    Debug
    )

    Text or Base64-encoded binary resource contents.

    ResourceContents::blob

    fn ResourceContents::blob(uri~ : String, blob~ : String, mime_type? : String, meta? : Map[String,
    Json
    ]) -> ResourceContents

    ResourceContents::blob_bytes

    fn ResourceContents::blob_bytes(uri~ : String, bytes~ : Bytes, mime_type? : String, meta? : Map[String,
    Json
    ]) -> ResourceContents

    ResourceContents::text

    fn ResourceContents::text(uri~ : String, text~ : String, mime_type? : String, meta? : Map[String,
    Json
    ]) -> ResourceContents

    ResourceContents::to_json

    SamplingMessage

    pub(all) struct SamplingMessage {
    role : PromptRole
    content : ContentBlock
    } derive(Eq,
    Debug
    )

    SamplingMessage::SamplingMessage

    fn SamplingMessage::SamplingMessage(role~ : PromptRole, content~ : ContentBlock) -> SamplingMessage

    SamplingMessage::to_json

    ServerEvent

    pub(all) enum ServerEvent {
    ToolsListChanged
    PromptsListChanged
    ResourcesListChanged
    ResourceUpdated(String)
    } derive(Eq,
    Debug
    )

    Change event published onto McpServer's internal event bus for subscriptions/listen delivery (SEP-1865).

    SubscriptionFilter

    pub(all) struct SubscriptionFilter {
    tools_list_changed : Bool
    prompts_list_changed : Bool
    resources_list_changed : Bool
    resource_subscriptions : Array[String]
    } derive(Eq,
    Debug
    )

    MCP 2026-07-28 SEP-1865 subscriptions/listen filter and event-bus helpers.

    SubscriptionFilter::SubscriptionFilter

    fn SubscriptionFilter::SubscriptionFilter(tools_list_changed? : Bool, prompts_list_changed? : Bool, resources_list_changed? : Bool, resource_subscriptions? : Array[String]) -> SubscriptionFilter

    SubscriptionFilter::is_empty

    fn SubscriptionFilter::is_empty(self : SubscriptionFilter) -> Bool

    SubscriptionFilter::to_json

    ToolAnnotations

    pub(all) struct ToolAnnotations {
    title : String?
    read_only_hint : Bool?
    destructive_hint : Bool?
    idempotent_hint : Bool?
    open_world_hint : Bool?
    } derive(Eq,
    Debug
    )

    MCP 2025-11-25 ToolAnnotations behavioral hints for LLM hosts.

    ToolAnnotations::ToolAnnotations

    fn ToolAnnotations::ToolAnnotations(title? : String, read_only_hint? : Bool, destructive_hint? : Bool, idempotent_hint? : Bool, open_world_hint? : Bool) -> ToolAnnotations

    ToolAnnotations::to_json

    UriTemplate

    pub struct UriTemplate {
    // private fields
    }

    Pure MoonBit RFC 6570 URI Template engine (zero regex, ReDoS-safe). Supports operators "", +, #, ., /, ;, ?, & and explode modifier *.

    UriTemplate::expand

    fn UriTemplate::expand(self : UriTemplate, vars : Map[String, String]) -> String

    Expands the template using the supplied variable map.

    UriTemplate::is_template

    fn UriTemplate::is_template(s : String) -> Bool

    Returns true if s contains an RFC 6570 {...} template expression.

    UriTemplate::match_uri

    fn UriTemplate::match_uri(self : UriTemplate, uri : String) -> Map[String, String]?

    Matches a concrete URI against this RFC 6570 template, returning extracted variable bindings on success or None if it does not match.

    UriTemplate::parse

    fn UriTemplate::parse(template : String) -> UriTemplate raise McpProtocolError

    Parses an RFC 6570 URI template string.

    UriTemplate::to_string

    fn UriTemplate::to_string(self : UriTemplate) -> String

    UriTemplate::variable_names

    fn UriTemplate::variable_names(self : UriTemplate) -> Array[String]

    carries_valid_modern_envelope_claim

    fn carries_valid_modern_envelope_claim(params_opt : Map[String,
    Json
    ]?) -> Bool

    Returns true if params carries a valid modern (>= 2026-07-28) per-request _meta envelope claim.

    compile_x_mcp_headers

    fn compile_x_mcp_headers(input_schema :
    Json
    ) -> CompiledXMcpHeaders

    Scans input_schema once and returns reusable compiled x-mcp-header metadata.

    decode_mcp_param_value

    fn decode_mcp_param_value(value : String) -> String?

    Decodes an SEP-2243 Mcp-Name / Mcp-Param-* HTTP header value. Handles the =?base64?{b64}?= sentinel (canonical padded RFC 4648 Base64 + valid UTF-8). Returns None if the sentinel is present but malformed.

    encode_mcp_param_value

    fn encode_mcp_param_value(value : String) -> String

    Encodes a string value for SEP-2243 Mcp-Name / Mcp-Param-* headers. Safe plain-ASCII RFC 9110 field values pass through unchanged; all other values (empty, leading/trailing whitespace, non-ASCII, control chars, or values already matching the sentinel pattern) are wrapped as =?base64?{b64-of-utf8}?=.

    envelope_claim_version

    fn envelope_claim_version(params_opt : Map[String,
    Json
    ]?) -> String?

    Returns the string value of params._meta["io.modelcontextprotocol/protocolVersion"] if present and a string.

    err_header_mismatch

    let err_header_mismatch : Int

    SEP-2243 HTTP header/body mismatch error code (protocol revision 2026-07-28).

    err_internal_error

    let err_internal_error : Int

    err_invalid_params

    let err_invalid_params : Int

    err_invalid_request

    let err_invalid_request : Int

    err_method_not_found

    let err_method_not_found : Int

    err_missing_required_client_capability

    let err_missing_required_client_capability : Int

    Missing required client capability error code (protocol revision 2026-07-28).

    err_parse_error

    let err_parse_error : Int

    Standard JSON-RPC 2.0 & MCP protocol error codes.

    err_resource_not_found

    let err_resource_not_found : Int

    Receive-tolerated legacy resource-not-found code (-32002). Per 2026-07-28 spec, servers MUST emit -32602 for resources/read misses (see McpProtocolError::resource_not_found); kept as a constant for client interop.

    err_server_overloaded

    let err_server_overloaded : Int

    err_unsupported_protocol_version

    let err_unsupported_protocol_version : Int

    Unsupported protocol version error code (protocol revision 2026-07-28).

    err_url_elicitation_required

    let err_url_elicitation_required : Int

    export_anthropic_tools

    Exports Anthropic-compatible Tool Calling JSON Schema array.

    export_mcp_tools

    Exports MCP tools directly from a ciallo OpenApiDocument.

    export_openai_tools

    Exports OpenAI-compatible Function Calling JSON Schema array.

    extract_mime_base

    fn extract_mime_base(content_type : String) -> String

    extract_params_meta

    fn extract_params_meta(params_opt : Map[String,
    Json
    ]?) -> Map[String,
    Json
    ]?

    Extracts params._meta object when present.

    first_modern_protocol_version

    let first_modern_protocol_version : String

    First protocol revision of the modern (2026-07-28+) era.

    has_envelope_claim

    fn has_envelope_claim(params_opt : Map[String,
    Json
    ]?) -> Bool

    Returns true if params._meta carries the 2026 per-request envelope claim key (io.modelcontextprotocol/protocolVersion).

    honored_subscription_filter

    fn honored_subscription_filter(requested : SubscriptionFilter, capabilities :
    Json
    ) -> SubscriptionFilter

    Narrows a requested SubscriptionFilter against the server's advertised capabilities.

    http_status_for_modern_error

    fn http_status_for_modern_error(code : Int, is_ladder : Bool) -> Int

    Maps a JSON-RPC error code to the spec-mandated HTTP status code on the modern (2026-07-28) path.

    is_json_content_type_header

    fn is_json_content_type_header(ct : String?) -> Bool

    is_modern_protocol_version

    fn is_modern_protocol_version(ver : String) -> Bool

    Returns true if ver belongs to the modern (2026-07-28+) protocol era.

    is_non_object_json_schema_root

    fn is_non_object_json_schema_root(schema :
    Json
    ) -> Bool

    Returns true if schema is a JSON Schema object whose root does NOT declare "type": "object" (matching SEP-2106 isNonObjectJsonSchemaRoot).

    is_rev2026_notification_method

    fn is_rev2026_notification_method(meth : String) -> Bool

    Exact 8 notification methods defined in the 2026-07-28 protocol revision.

    is_rev2026_request_method

    fn is_rev2026_request_method(meth : String) -> Bool

    Exact 10 request methods defined in the 2026-07-28 protocol revision.

    is_supported_legacy_version

    fn is_supported_legacy_version(ver : String) -> Bool

    Returns true if ver is in supported_protocol_versions (legacy revisions).

    is_supported_modern_version

    fn is_supported_modern_version(ver : String) -> Bool

    Returns true if ver is in modern_protocol_versions (supported modern revisions).

    json_scalar_to_string

    fn json_scalar_to_string(v :
    Json
    ) -> String

    latest_protocol_version

    let latest_protocol_version : String

    Latest standard MCP protocol version supported by unmbt/ciallo-mcp.

    localhost_allowed_hostnames

    fn localhost_allowed_hostnames() -> Array[String]

    Convenience allowlist for localhost DNS rebinding protection (validate_host_header).

    localhost_allowed_origins

    fn localhost_allowed_origins() -> Array[String]

    Convenience allowlist for localhost browser Origin protection (validate_origin_header).

    make_subscription_ack

    fn make_subscription_ack(subscription_id :
    Json
    , honored : SubscriptionFilter) ->
    Json

    Builds the leading notifications/subscriptions/acknowledged notification stamped with subscriptionId.

    make_subscription_close_result

    fn make_subscription_close_result(subscription_id :
    Json
    , server_info : McpImplementation) ->
    Json

    Builds the graceful-close SubscriptionsListenResult response frame.

    make_subscription_event_notification

    fn make_subscription_event_notification(subscription_id :
    Json
    , event : ServerEvent) ->
    Json

    Builds a subscription-stamped change notification for event.

    meta_key_baggage

    let meta_key_baggage : String

    meta_key_client_capabilities

    let meta_key_client_capabilities : String

    meta_key_client_info

    let meta_key_client_info : String

    meta_key_log_level

    let meta_key_log_level : String

    meta_key_protocol_version

    let meta_key_protocol_version : String

    Reserved _meta key constants for MCP 2026-07-28 per-request envelopes and results.

    meta_key_server_info

    let meta_key_server_info : String

    meta_key_subscription_id

    let meta_key_subscription_id : String

    meta_key_traceparent

    let meta_key_traceparent : String

    Reserved _meta keys for W3C Trace Context / Baggage propagation (SEP-414).

    meta_key_tracestate

    let meta_key_tracestate : String

    missing_capabilities_for_input_requests

    fn missing_capabilities_for_input_requests(input_requests : Map[String, InputRequest], declared_opt :
    Json
    ?) ->
    Json
    ?

    Computes the missing subset of required client capabilities for embedded InputRequests (2026-07-28 SEP-2322 + -32021 MissingRequiredClientCapability). A bare elicitation: {} declaration satisfies elicitation.form per spec.

    modern_protocol_versions

    let modern_protocol_versions : Array[String]

    Modern stateless discovery protocol versions (server/discover).

    parse_create_message_result

    fn parse_create_message_result(result :
    Json
    ) -> CreateMessageResult raise McpProtocolError

    parse_elicit_result

    fn parse_elicit_result(result :
    Json
    ) -> ElicitResult raise McpProtocolError

    parse_roots_result

    fn parse_roots_result(result :
    Json
    ) -> Array[McpRoot] raise McpProtocolError

    parse_subscription_filter

    fn parse_subscription_filter(params_opt : Map[String,
    Json
    ]?) -> SubscriptionFilter raise McpProtocolError

    Parses params.notifications from a subscriptions/listen request.

    strip_http_ows

    fn strip_http_ows(s : String) -> String

    Strips HTTP optional whitespace (SP / HTAB) from both ends of a header value.

    subscription_filter_accepts

    fn subscription_filter_accepts(filter : SubscriptionFilter, event : ServerEvent) -> Bool

    Returns true if filter opted in to event.

    supported_protocol_versions

    let supported_protocol_versions : Array[String]

    Protocol versions accepted during initialize negotiation (newest first).

    validate_envelope_meta

    fn validate_envelope_meta(meta : Map[String,
    Json
    ]) -> (String, String)?

    Validates a 2026-07-28 per-request _meta envelope object. Returns Some((key, problem)) on the first violation, or None when valid.

    validate_host_header

    fn validate_host_header(host_header : String?, allowed_hostnames : Array[String]) -> String?

    Validates an HTTP Host header against a port-agnostic hostname allowlist (matches @modelcontextprotocol/server validateHostHeader). Returns None when allowed, or Some(message) on failure.

    validate_mcp_param_headers

    fn validate_mcp_param_headers(input_schema :
    Json
    , args : Map[String,
    Json
    ], headers :
    Headers
    ) -> McpProtocolError?

    Validates SEP-2243 Mcp-Param-* headers against a tool's inputSchema and request arguments. Returns Some(McpProtocolError) (-32020) on mismatch.

    validate_mcp_param_headers_compiled

    fn validate_mcp_param_headers_compiled(compiled : CompiledXMcpHeaders, args : Map[String,
    Json
    ], headers :
    Headers
    ) -> McpProtocolError?

    Validates SEP-2243 Mcp-Param-* headers using pre-scanned CompiledXMcpHeaders (eliminates per-request JSON Schema tree traversal on tools/call).

    validate_origin_header

    fn validate_origin_header(origin_header : String?, allowed_origin_hostnames : Array[String]) -> String?

    Validates an HTTP Origin header against a port-agnostic hostname allowlist (matches @modelcontextprotocol/server validateOriginHeader). Missing/empty Origin passes (non-browser clients); opaque "null" or unparseable origins fail closed; <scheme>://* (non-http/https) supports browser extensions. Returns None when allowed, or Some(message) on failure.

    validate_standard_headers_2026

    fn validate_standard_headers_2026(meth : String, params_opt : Map[String,
    Json
    ]?, claimed_version : String, headers :
    Headers
    ) -> McpProtocolError?

    Validates SEP-2243 standard headers (MCP-Protocol-Version, Mcp-Method, Mcp-Name) on a modern-era HTTP request POST.

    validate_tool_arguments

    fn validate_tool_arguments(args : Map[String,
    Json
    ], input_schema :
    Json
    ) -> String?

    validate_tool_name

    fn validate_tool_name(name : String) -> Array[String]

    Validates an MCP tool name against SEP-986 (^[A-Za-z0-9._-]{1,128}$). Returns a list of human-readable issues (empty means strictly compliant).

    validate_value_against_schema

    fn validate_value_against_schema(path : String, value :
    Json
    , schema :
    Json
    ) -> String?

    Lightweight runtime JSON Schema validator for programmatic register_tool input_schema. Checks required, property type (string, number, integer, boolean, array, object, null), enum, local #/$defs/<id> $ref, and additionalProperties: false. Returns Some(reason) on first violation.

    validate_x_mcp_headers

    fn validate_x_mcp_headers(input_schema :
    Json
    ) -> String?

    Validates a tool's inputSchema against SEP-2243 x-mcp-header constraints. Returns None when compliant, or Some(reason) on the first violation.

    wrap_output_schema_for_legacy

    fn wrap_output_schema_for_legacy(schema :
    Json
    ) ->
    Json

    SEP-2106 legacy outputSchema projection for 2025-era (2025-11-25) clients: object-rooted schemas (type: "object") pass through unchanged; non-object roots are wrapped in { "type": "object", "properties": { "result": <rewritten> }, "required": ["result"] } with $schema hoisted and same-document $ref/$dynamicRef/$recursiveRef pointers rewritten.