HeaderFactory
FinalYes
The HTTP headers a modern-era client puts on every POST (SEP-2243, SEP-2575).
These exist so an intermediary can route and authorize MCP traffic without parsing the body. That only works if the headers cannot disagree with what they mirror, so they are derived here from the very message that is about to be sent — never from what the caller believes it is sending.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- forMessage() : array<string, string>
Properties
$tools read-only
private
ToolCatalog
$tools
Methods
__construct()
public
__construct(ToolCatalog $tools) : mixed
Parameters
- $tools : ToolCatalog
forMessage()
public
forMessage(array<string, mixed> $payload, ProtocolVersion $protocolVersion) : array<string, string>
Parameters
- $payload : array<string, mixed>
-
a serialized JSON-RPC message
- $protocolVersion : ProtocolVersion