protocol
mcp_server_spec_protocol
Protocol for MCP server spec (aka data layer) handlers independent of transport. A handler validates and dispatches JSON-RPC messages and returns abstract outcomes that a transport (stdio or Streamable HTTP) renders to the wire.
logtalk_load(mcp_server(loader))staticPublic predicates
spec/1
MCP server spec implemented by this handler (e.g. '2025-06-18' or '2026-07-28').
staticspec(Version)spec(-atom) - oneprepare/2
Initializes handler state for Application with merged Options. Does not open any transport.
staticprepare(Application,Options)prepare(+object_identifier,+list) - one_or_errorOptions is a variable:instantiation_errorOptions is neither a variable nor a list:type_error(list,Options)Option of the list Options is a variable:instantiation_errorOption of the list Options is neither a variable nor a compound term:type_error(compound,Option)Option of the list Options is a compound term but not a valid option:domain_error(option,Option)handle_message/3
Handles one JSON-RPC Message under Options and returns an Outcome for the transport to render. Outcomes include reply(JsonRpcTerm), accepted, no_reply, and transport-agnostic error replies already encoded as JSON-RPC error objects inside reply/1.
statichandle_message(Message,Options,Outcome)handle_message(+nonvar,+list,-nonvar) - onenotify/1
Publishes an application event. Transports that support server-initiated notifications deliver it; others may ignore it.
staticnotify(Event)notify(+compound) - zero_or_onecleanup/0
Releases handler-owned dynamic state.
staticcleanup - oneProtected predicates
(none)
Private predicates
(none)
Operators
(none)