# `ExMCP.Plugs.ProtocolVersion`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.0.0/lib/ex_mcp/plugs/protocol_version.ex#L1)

Plug for validating and extracting the MCP-Protocol-Version header.

This plug ensures that incoming HTTP requests carry a protocol version the
server actually supports.

## Behavior

- If no header is present, the configured default
  (also returned by `ExMCP.protocol_version/0`) is assumed
- If an unsupported version is provided, returns 400 Bad Request
- Adds the validated version to conn.assigns[:mcp_version]

The supported list and default come from ExMCP's canonical internal version
registry, so clients, server transports, and this plug cannot drift.

## Usage

    plug ExMCP.Plugs.ProtocolVersion

# `default_version`

```elixir
@spec default_version() :: String.t()
```

Get the default protocol version.

# `supported_versions`

```elixir
@spec supported_versions() :: [String.t()]
```

Get the list of supported protocol versions.

---

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