MCP service sends unsupported fields parameter for blobs scope in search
Summary
The MCP service is not respecting the prompt and sends the fields parameter for the blobs scope, which is not supported. The fields parameter is only applicable to issues and merge_requests scopes, but the MCP server is incorrectly including it when performing code searches (blobs scope). This issue exists with some AI agents like this OpenAI-GPT-5-Codex.
Steps to reproduce
What is the current bug behavior?
MCP API received fields params for blobs scope and raises an exception
What is the expected correct behavior?
MCP API received fields params for blobs scope and should not raises an exception
Relevant logs and/or screenshots
Possible fixes
Check if the request is MCP. If yes then skip the param validation verify_ee_param_fields!, verify_ee_param_exclude_forks! and verify_ee_param_regex! from https://gitlab.com/gitlab-org/gitlab/-/blob/5a16085ce9ec14752f2618d567978e4a006dc8c8/lib/api/search.rb