object

mcp_server

MCP server facade. Selects spec and transport (stdio or Streamable HTTP).

Availability:
logtalk_load(mcp_server(loader))
Author: Paulo Moura
Version: 2:0:0
Date: 2026-09-02
Compilation flags:
static, context_switching_calls
Imports:
public options
Uses:
Remarks:
  • Specs: '2025-06-18' (default), '2025-11-25', and '2026-07-28' via spec/1.

  • Transports: stdio (default) and streamable_http via transport/1.

  • OAuth: Streamable HTTP servers can be protected using the oauth/4 option.

Public predicates

start/2

Starts the MCP server with default options.

Compilation flags:
static
Template:
start(Name,Application)
Mode and number of proofs:
start(+atom,+object_identifier) - one

start/3

Starts the MCP server with options (spec/1, transport/1, HTTP options, …).

Compilation flags:
static
Template:
start(Name,Application,Options)
Mode and number of proofs:
start(+atom,+object_identifier,+list) - one_or_error
Exceptions:
The Options list specifies an invalid MCP server configuration:
domain_error(mcp_server_configuration,Version-Transport)

start/4

Starts with custom streams and default options.

Compilation flags:
static
Template:
start(Name,Application,Input,Output)
Mode and number of proofs:
start(+atom,+object_identifier,+stream,+stream) - one

start/5

Starts with custom streams and options.

Compilation flags:
static
Template:
start(Name,Application,Input,Output,Options)
Mode and number of proofs:
start(+atom,+object_identifier,+stream,+stream,+list) - one_or_error
Exceptions:
The Options list specifies a unsupported MCP server configuration:
domain_error(mcp_server_configuration,Version-Transport)

notify/1

Publishes an application event to the active adapter.

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

Protected predicates

(no local declarations; see entity ancestors if any)

Private predicates

active_transport_object_/1

Currently active transport object.

Compilation flags:
dynamic
Template:
active_transport_object_(TransportObject)
Mode and number of proofs:
active_transport_object_(?object_identifier) - zero_or_one

Operators

(none)