Sunset SemanticCodeSearchService MCP tool

What this does

Replaces the custom Mcp::Tools::SemanticCodeSearchService MCP tool with the auto-generated MCP tool backed by the REST endpoint GET /projects/278964/search/semantic

(added in !227817 (merged)),

discovered via route_setting :mcp — the same ApiTool mechanism as get_issue, create_merge_request, search, etc.

It also removes the now-fully-rolled-out mcp_semantic_code_search_use_rest_api feature flag (enabled globally on GitLab.com — Slack rollout).

This is a clean recreation of !227818 (closed) on current master.

Changes

  • Empty EE_CUSTOM_TOOLSsemantic_code_search is now discovered as a REST ApiTool.
  • Remove the dead flag branch (use_rest_api_for_mcp_tool?) from get_tool / build_ee_tools.
  • Delete ee/app/services/mcp/tools/semantic_code_search_service.rb and its spec.
  • Delete the mcp_semantic_code_search_use_rest_api feature flag definition.
  • Update manager_spec / list_tools_spec to assert the ApiTool-backed tool.

Net: +30 / −1532 (mostly the deleted service + its 1115-line spec).

Behavior change to note

The old custom service was hidden from tools/list when semantic search wasn't available for a project (it subclassed BaseService, which the list handler gates on available?). The REST ApiTool is not gated this way, so semantic_code_search is now always listed and availability is enforced at execution time (authorization + indexing checks still apply). This matches how every other REST-backed MCP tool behaves.

Screenshot — semantic_code_search returning results via MCP

Screenshot_2026-06-04_at_22.30.09

Edited by Tian Gao

Merge request reports

Loading