Document MCP search: empty merge_requests search returns HTTP 500 (use "*" workaround)

Summary

The GitLab MCP search tool returns HTTP 500 Internal Server Error when scope is merge_requests and search is empty ("") or whitespace-only (" "). The same call with scope: issues and empty search succeeds (returns []).

This affects Cursor users and agents that try to "list all merge requests" via search without a keyword (e.g. /pipeline-status-style listing, backlog commands, or agents omitting the required term).

Environment

  • Client: Cursor IDE + GitLab plugin (MCP over https://gitlab.com/api/v4/mcp)
  • MCP server version: 19.1.0-pre (via get_mcp_server_version)
  • Repro project: investing-for-charity/broker-pdf-processor (any project likely reproduces)

Steps to reproduce

  1. Authenticate to GitLab MCP.
  2. Call search with:
    • scope: merge_requests
    • project_id: investing-for-charity/broker-pdf-processor (or any accessible project)
    • search: "" (empty string)
    • Optional: state: opened or all

Actual behavior

500 Internal Server Error

Expected behavior

One of:

  • 400 Bad Request with a clear message that search is required (docs already mark it required), or
  • Same behavior as issues scope with empty search (e.g. return [] or list/filter by state only), or
  • MCP server coerces empty search to a safe default (e.g. *) before calling the Search API.

Workaround (works today)

Use a non-empty search term, e.g. search: "*" or a project keyword. Example that succeeds:

{
  "scope": "merge_requests",
  "project_id": "investing-for-charity/broker-pdf-processor",
  "search": "*",
  "state": "all",
  "per_page": 10
}

Returns [] when no MRs exist (not 500).

Suggested plugin/docs fix

  • Update plugin commands/skills that imply "list all MRs" to document search: "*".
  • Add a note in README or review-merge-request / agent prompts: never call MR search with empty search.

Upstream

If the root cause is in the GitLab MCP server or Search API (not Cursor plugin templates), please forward to gitlab-org/gitlab with the same repro.

Reporter

Observed while integrating GitLab MCP in Cursor (May 2026).