PingGateway

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 Origin header against a list of allowed origins.

  • Validates the Accept header content types.

  • Validates the JSON-RPC format of the payload.

  • Validates the MCP client message format, excluding the tools schemas.

  • Rewrites the MCP protocol version in the initialize request to the supported version. PingGateway supports versions 2025-06-18 and 2025-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 Origin header.

"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