MCP PHP SDK

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
see
StandardHeaderValidator

the server that checks this

author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Properties

$tools  : ToolCatalog

Methods

__construct()  : mixed
forMessage()  : array<string, string>

Properties

Methods

forMessage()

public forMessage(array<string, mixed> $payload, ProtocolVersion $protocolVersion) : array<string, string>
Parameters
$payload : array<string, mixed>

a serialized JSON-RPC message

$protocolVersion : ProtocolVersion
Return values
array<string, string>
On this page

Search results