protocol

mcp_server_transport_protocol

Protocol for MCP server transports. The mcp_server facade object selects the transport via the transport/1 option and delegates the server lifecycle to it.

Availability:
logtalk_load(mcp_server(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-08-31
Compilation flags:
static
Dependencies:
(none)
Remarks:
(none)
Inherited public predicates:
(none)

Public predicates

spec/1

Returns the MCP server spec version implemented by this adapter (e.g. '2025-06-18' or '2026-07-28').

Compilation flags:
static
Template:
spec(Version)
Mode and number of proofs:
spec(-atom) - one

start/4

Starts the adapter against the given application object, input/output streams, and normalized server configuration options. Blocks until the client disconnects (EOF) or an exit condition is reached. The adapter is responsible for all request handling, capability negotiation, and cleanup of adapter-owned state.

Compilation flags:
static
Template:
start(Application,Input,Output,Options)
Mode and number of proofs:
start(+object_identifier,+stream,+stream,+list) - one_or_error
Exceptions:
The Options list specifies a non-supported Version spec:
domain_error(protocol_version,Version)

notify/1

Publishes an application event to interested clients. Canonical event terms are tools_list_changed, prompts_list_changed, resources_list_changed, and resource_updated(URI). The 2025-06-18 adapter may ignore or reject events not supported by that specification; the 2026-07-28 adapter filters events through active subscriptions.

Compilation flags:
static
Template:
notify(Event)
Mode and number of proofs:
notify(+compound) - zero_or_one

cleanup/0

Releases any adapter-owned dynamic state. Called by the facade after the server loop terminates (success, failure, exception, or EOF).

Compilation flags:
static
Mode and number of proofs:
cleanup - one

Protected predicates

(none)

Private predicates

(none)

Operators

(none)