# `ExMCP.Transport.Local`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/transport/local.ex#L1)

Local BEAM transport for ExMCP.

This module provides a high-performance transport for BEAM-based communication.
It carries MCP-shaped JSON-RPC messages as Elixir terms between local
processes. The transport itself does not JSON encode or decode messages.

## Features

- MCP-shaped message passing without JSON serialization
- Direct process-to-process communication
- Built-in fault tolerance
- Low latency for local communication

## Configuration

This transport is configured via `ExMCP.Client.start_link/1`:

    {:ok, client} = ExMCP.Client.start_link(
      transport: :beam,
      server: server_pid
    )

Options:
- `:server` - Required for client mode if connecting to a server process.
- `:timeout` - Optional. Call timeout in milliseconds (default: 5000).

# `t`

```elixir
@type t() :: %ExMCP.Transport.Local{
  connected: boolean(),
  forwarder_pid: term(),
  role: :client | :server,
  server_pid: pid() | nil,
  subscriber: term(),
  timeout: pos_integer()
}
```

# `receive_message`

# `subscribe`

Subscribe to receive transport events (push model).

For the Local transport, the peer already sends `{:transport_message, msg}`
to the client process. The Client GenServer handles these directly,
so subscribe just signals that no receiver task is needed.

---

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