McpClient.headersFor

ClientProtocol.headersFor: compute the protocol-derived request headers for an outgoing message, which the transport pulls through the ClientProtocol seam. For a draft client this is the MCP-Protocol-Version header plus the standard Mcp-Method / Mcp-Name headers and any Mcp-Param-* mirrored tool arguments (draft basic/transports). For a stable client it is just MCP-Protocol-Version after initialize. Called with Json.undefined (no message — e.g. the GET server stream) it returns only the version header. Keeps the draft-header logic and the tool inputSchema cache in the client rather than the transport.

class McpClient
@safe
string[string]
headersFor
(
Json message
)