McpValidationFilter
Validates Model Context Protocol (MCP) requests:
| This feature has Evolving interface stability. It’s subject to change without notice, even in a minor or maintenance release. |
-
Validates the
Originheader against a list of allowed origins. -
Validates the
Acceptheader content types. -
Validates the JSON-RPC format of the payload.
-
Validates the MCP client message format, excluding the
toolsschemas. -
Rewrites the MCP protocol version in the
initializerequest to the supported version. PingGateway supports versions2025-06-18and2025-11-25(new in 2026.6). -
Adds an McpContext for further processing.
-
Optionally records metrics for MCP requests.
|
If your MCP server uses server-sent events (SSE), make sure you enable streaming in PingGateway. |
Usage
{
"name": string,
"type": "McpValidationFilter",
"config": {
"acceptedOrigins": [ configuration expression<pattern>, … ],
"metricsEnabled": configuration expression<boolean>,
"preferredServerVersion": configuration expression<string>
}
}
}
Properties
"acceptedOrigins": array of configuration expression<pattern>, required-
Pattern or array of patterns matching the accepted origins for MCP requests.
The filter uses this for cross-origin request sharing (CORS) validation of the
Originheader. "metricsEnabled": configuration expression<boolean>, optional-
Whether to record metrics for MCP requests.
Default:
true "preferredServerVersion": configuration expression<string>, optional-
the preferred protocol version of the protected MCP server.
This feature requires PingGateway 2026.6 or later. Default: the latest supported version, currently
2025-11-25