Skip param validation for MCP requests

What does this MR do and why?

This code change adds special handling for MCP (Model Context Protocol) requests in the search API. Previously, certain search parameters like regex, exclude_forks, and fields would return errors when used with regular search requests because they were only supported with a specific search engine called "zoekt".

The update allows MCP requests to bypass these restrictions, meaning users making MCP requests can now use these advanced search parameters without getting error messages. The change includes adding a helper method to detect MCP requests and modifying three validation functions to skip their error checks when an MCP request is detected.

Tests were also added to verify that MCP requests with these previously restricted parameters now work correctly and return successful responses instead of errors.

Problem

The MCP server's search tool exposes the fields parameter when advanced search is enabled. Since LLMs are indeterministic, they may include fields for any scope (including blobs), causing the API to return a 400 error. Prompt-based constraints are fragile and unreliable for enforcing parameter correctness.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist.

Relates to #591579 (closed)

Edited by Ravi Kumar

Merge request reports

Loading