Hermes.Transport.WebSocket (hermes_mcp v0.9.1)

A transport implementation that uses WebSockets for bidirectional communication with the MCP server.

Notes

For initialization and setup, check our Installation & Setup and the Transport options guides for reference.

Summary

Types

The options for the WebSocket transport.

The options for the MCP server.

t()

Functions

Returns a specification to start this module under a supervisor.

Types

option()

@type option() ::
  {:name, GenServer.name()}
  | {:client, GenServer.server()}
  | {:server, server()}
  | {:headers, map()}
  | {:transport_opts, keyword()}
  | GenServer.option()

The options for the WebSocket transport.

  • :name - The name of the transport process, respecting the GenServer "Name Registration" section.
  • :client - The client to send the messages to, respecting the GenServer "Name Registration" section.
  • :server - The server configuration.
  • :headers - The headers to send with the HTTP requests.
  • :transport_opts - The underlying transport options to pass to Gun.

params_t()

@type params_t() :: Enumerable.t(option())

server()

@type server() ::
  Enumerable.t(
    {:base_url, String.t()}
    | {:base_path, String.t()}
    | {:ws_path, String.t()}
  )

The options for the MCP server.

  • :base_url - The base URL of the MCP server (e.g. http://localhost:8000) (required).
  • :base_path - The base path of the MCP server (e.g. /mcp).
  • :ws_path - The path to the WebSocket endpoint (e.g. /mcp/ws) (default :base_path + /ws).

t()

@type t() :: GenServer.server()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_schema(atom)

options_schema(data)

options_schema!(data)