Repository: envoyproxy/envoy
File: api/envoy/extensions/filters/http/mcp/v3/mcp.proto (Protocol Buffers)

Code before:
    // This is the default mode.
    PASS_THROUGH = 0;

    // Reject requests that are not following MCP spec.
    // Valid MCP requests are:
    // - POST requests with JSON-RPC 2.0 messages
    // - GET requests for SSE streams (with Accept: text/event-stream)
    REJECT_NO_MCP = 1;
  }

  // Configures how the filter handles non-MCP traffic.
  TrafficMode traffic_mode = 1 [(validate.rules).enum = {defined_only: true}];

  // When set to true, the filter will clear the route cache after setting dynamic metadata.
  // This allows the route to be re-selected based on the MCP metadata (e.g., method, params).
  // Defaults to false.
  bool clear_route_cache = 2;

  // Maximum size of the request body to buffer for JSON-RPC validation.
  // If the request body exceeds this size, the request is rejected with 413 Payload Too Large.
  // This limit applies to both REJECT_NO_MCP and PASS_THROUGH modes to prevent unbounded buffering.
  // Default: 8KB (8192 bytes)
  // Maximum allowed: 10MB (10485760 bytes)
  // Set to 0 to disable the limit (not recommended for production).
  google.protobuf.UInt32Value max_request_body_size = 3 [(validate.rules).uint32 = {lte: 10485760}];
}

// McpOverride for MCP filter
message McpOverride {
  // Optional per-route traffic mode override
  Mcp.TrafficMode traffic_mode = 1 [(validate.rules).enum = {defined_only: true}];
}


Review comment (suggestion):
```suggestion
  // Maximum size of the request body to buffer for JSON-RPC validation.
  // If the request body exceeds this size, the request is rejected with ``413 Payload Too Large``.
  // This limit applies to both ``REJECT_NO_MCP`` and ``PASS_THROUGH`` modes to prevent unbounded buffering.
  //
  // It defaults to 8KB (8192 bytes) and the maximum allowed value is 10MB (10485760 bytes).
  //
  // Setting it to 0 would disable the limit. It is not recommended to do so in production.
  google.protobuf.UInt32Value max_request_body_size = 3 [(validate.rules).uint32 = {lte: 10485760}];
```

Code after:
    // This is the default mode.
    PASS_THROUGH = 0;

    // Reject requests that are not following MCP spec.
    // Valid MCP requests are:
    // - POST requests with JSON-RPC 2.0 messages
    // - GET requests for SSE streams (with Accept: text/event-stream)
    REJECT_NO_MCP = 1;
  }

  // Configures how the filter handles non-MCP traffic.
  TrafficMode traffic_mode = 1 [(validate.rules).enum = {defined_only: true}];

  // When set to true, the filter will clear the route cache after setting dynamic metadata.
  // This allows the route to be re-selected based on the MCP metadata (e.g., method, params).
  // Defaults to false.
  bool clear_route_cache = 2;

  // Maximum size of the request body to buffer for JSON-RPC validation.
  // If the request body exceeds this size, the request is rejected with ``413 Payload Too Large``.
  // This limit applies to both ``REJECT_NO_MCP`` and ``PASS_THROUGH`` modes to prevent unbounded buffering.
  //
  // It defaults to 8KB (8192 bytes) and the maximum allowed value is 10MB (10485760 bytes).
  //
  // Setting it to 0 would disable the limit. It is not recommended to do so in production.
  google.protobuf.UInt32Value max_request_body_size = 3 [(validate.rules).uint32 = {lte: 10485760}];
}

// McpOverride for MCP filter
message McpOverride {
  // Optional per-route traffic mode override
  Mcp.TrafficMode traffic_mode = 1 [(validate.rules).enum = {defined_only: true}];
}