# `Backplane.McpProtocol.Transport.WebSocket`

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

> ## Notes {: .info}
>
> For initialization and setup, check our [Installation & Setup](./installation.html) and
> the [Transport options](./transport_options.html) guides for reference.

# `option`

```elixir
@type option() ::
  {:name, GenServer.name()}
  | {:client, GenServer.server()}
  | {:server, server()}
  | {:headers, map()}
  | {:transport_opts, keyword() | map()}
  | 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 WebSocket upgrade request.
- `:transport_opts` - A keyword list or map of options passed to `HTTP.WebSocket.new/3`,
  including the library's supported string map keys. The transport always overrides
  owner and headers, including string keys. Only browser mode with legacy delivery
  is supported; ACK delivery and proxy mode are rejected. Incoming text messages
  are forwarded to the client; binary messages are ignored. TLS verification uses
  the library defaults unless explicitly configured through these options.

# `params_t`

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

# `server`

```elixir
@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`

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

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get_schema`

# `options_schema`

# `options_schema!`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
