|
| 1 | +sep: 2243 |
| 2 | +spec_url: https://modelcontextprotocol.io/specification/draft/basic/transports#standard-mcp-request-headers |
| 3 | +requirements: |
| 4 | + - check: sep-2243-client-includes-standard-headers |
| 5 | + text: 'The client MUST include the standard MCP request headers on each POST request. These headers are REQUIRED for compliance.' |
| 6 | + - check: sep-2243-header-name-case-insensitive |
| 7 | + text: 'Clients and servers MUST use case-insensitive comparisons for header names.' |
| 8 | + - check: sep-2243-server-reject-mismatch |
| 9 | + text: 'Servers that process the request body MUST reject requests where the values specified in the headers do not match the corresponding values in the request body.' |
| 10 | + - check: sep-2243-server-reject-status |
| 11 | + text: 'When rejecting a request due to header validation failure, servers MUST return HTTP status 400 Bad Request.' |
| 12 | + - check: sep-2243-server-reject-error-code |
| 13 | + text: 'When rejecting a request due to header validation failure, servers SHOULD include a JSON-RPC error response using error code -32001.' |
| 14 | + - check: sep-2243-client-supports-custom-headers |
| 15 | + text: 'MCP clients MUST support this feature [custom headers via x-mcp-header].' |
| 16 | + - check: sep-2243-client-mirrors-designated-params |
| 17 | + text: 'When a client invokes a tool whose definition includes such designations, conforming clients MUST mirror the designated parameter values into HTTP headers as described below.' |
| 18 | + - check: sep-2243-x-mcp-header-not-empty |
| 19 | + text: 'The x-mcp-header value MUST NOT be empty.' |
| 20 | + url: https://modelcontextprotocol.io/specification/draft/server/tools#custom-headers |
| 21 | + - check: sep-2243-x-mcp-header-charset |
| 22 | + text: 'The x-mcp-header value MUST contain only ASCII characters (excluding space and `:`).' |
| 23 | + url: https://modelcontextprotocol.io/specification/draft/server/tools#custom-headers |
| 24 | + - check: sep-2243-x-mcp-header-unique |
| 25 | + text: 'The x-mcp-header value MUST be case-insensitively unique within a single tool definition.' |
| 26 | + url: https://modelcontextprotocol.io/specification/draft/server/tools#custom-headers |
| 27 | + - check: sep-2243-x-mcp-header-primitive-only |
| 28 | + text: 'x-mcp-header MUST only be applied to parameters with primitive types (number, string, or boolean).' |
| 29 | + url: https://modelcontextprotocol.io/specification/draft/server/tools#custom-headers |
| 30 | + - check: sep-2243-client-reject-invalid-tool |
| 31 | + text: 'Clients MUST reject tool definitions where any x-mcp-header value violates these constraints. Rejection means the client MUST exclude the invalid tool from the set of tools returned by tools/list.' |
| 32 | + url: https://modelcontextprotocol.io/specification/draft/server/tools#custom-headers |
| 33 | + - check: sep-2243-client-encode-values |
| 34 | + text: 'Clients MUST encode parameter values before including them in HTTP headers: number values MUST be converted to their decimal string representation; boolean values MUST be converted to the lowercase strings "true" or "false".' |
| 35 | + - check: sep-2243-client-base64-unsafe |
| 36 | + text: 'When a value cannot be safely represented as plain ASCII (e.g., contains non-ASCII characters, control characters, or leading/trailing whitespace), clients MUST use Base64 encoding of the UTF-8 representation, wrapped as =?base64?{encoded}?=.' |
| 37 | + - check: sep-2243-server-decode-base64 |
| 38 | + text: 'Servers and intermediaries that need to inspect these values MUST decode them accordingly.' |
| 39 | + - check: sep-2243-client-omit-null |
| 40 | + text: 'Parameter value is null or omitted: Client MUST omit the header.' |
| 41 | + - check: sep-2243-server-not-expect-null |
| 42 | + text: 'Parameter value is null or omitted: Server MUST NOT expect the header.' |
| 43 | + - check: sep-2243-server-reject-missing-required |
| 44 | + text: 'Required parameter is omitted: Server MUST reject with JSON-RPC error.' |
| 45 | + - check: sep-2243-server-reject-invalid-param-chars |
| 46 | + text: 'Servers MUST reject requests with a recognized Mcp-Param-{Name} header that contain invalid characters.' |
| 47 | + - check: sep-2243-server-validate-param-match |
| 48 | + text: 'Any server that processes the message body MUST validate that encoded header values, after decoding if Base64-encoded, match the corresponding parameter values in the body.' |
| 49 | + - check: sep-2243-server-reject-param-mismatch |
| 50 | + text: 'Servers MUST reject requests with a 400 Bad Request HTTP status and JSON-RPC error code -32001 if any validation fails.' |
| 51 | + |
| 52 | + - text: 'Clients SHOULD log a warning when rejecting a tool definition due to invalid x-mcp-header, including the tool name and the reason.' |
| 53 | + excluded: 'Log output is not wire-observable.' |
| 54 | + - text: 'Server developers SHOULD NOT mark sensitive parameters (such as passwords, API keys, tokens, or PII) with x-mcp-header.' |
| 55 | + excluded: 'Design guidance to humans; not protocol-observable.' |
| 56 | + - text: 'Intermediaries MUST return an appropriate HTTP error status for validation failures.' |
| 57 | + excluded: 'Intermediary requirement; conformance harness tests clients and servers, not intermediaries.' |
| 58 | + - text: 'Intermediate servers that do not recognize an Mcp-Param-{Name} header MUST forward it and otherwise ignore it.' |
| 59 | + excluded: 'Intermediary requirement; conformance harness tests clients and servers, not intermediaries.' |
0 commit comments