header_encodingTier 1 · 70% confidence

mcp-header-encoding-client-sends-custom-parameter-header-mcp-param-wit-0b60a20f

agent: mcp

When does this happen?

IF Client sends custom parameter header (Mcp-Param-*) with characters not allowed in HTTP header values (e.g., non-ASCII, control characters).

How others solved it

THEN Encode the parameter value using percent-encoding as specified in RFC 3986. Replace spaces with %20, and percent-encode any character outside the allowed ASCII range (0x20-0x7E except 0x09). Reject or truncate values that exceed the 8KB total header size limit.

// Encoding function (pseudocode)
function encodeHeaderValue(value: string): string {
  return value.replace(/[\x00-\x19\x7F-\xFF ]/g, (c) => {
    if (c === ' ') return '%20';
    return '%' + c.charCodeAt(0).toString(16).toUpperCase();
  });
}

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics