Split the MCP 403 message by denial reason
What does this MR do?
The MCP server REST API at /api/v4/mcp returns HTTP 403 for two different reasons, but it always showed the same text: 403 Forbidden - MCP server disabled. That text is correct for only one of the two cases
This MR splits the message by reason:
-
On GitLab Self-Managed, when an administrator turns off the instance setting, the response now says
MCP server disabled for this instance -
On GitLab.com, when the user belongs to no top-level group that has the MCP server turned on, the response now says
MCP server not enabled for any of your groups. Nothing is disabled instance wide in this case, so the old text did not describe the problem or point to a fix -
The HTTP status stays 403 in both cases. Only the message text changes
Follow-up of issue #629050 (closed)