Add list_projects MCP tool

What does this MR do and why?

The GitLab MCP server has no primitive for listing projects. Agents building a project picker, or trying to resolve which project a user means, have to either hard code IDs and paths or fall back to the generic search tool, which requires a search term and cannot filter by group, visibility, or archived state.

This adds a GraphQL-backed list_projects tool, built on Query.projects (Resolvers::ProjectsResolver), supporting optional group scoping (group_id, accepting either a numeric ID or a full path), search, visibility, and archived filters, with cursor pagination (first/after).

References

#591304 (closed)

How to set up and validate locally

  1. Restart rails-web so Mcp::Tools::Manager picks up the new registration.
  2. Call tools/list on POST /api/v4/mcp with a personal access token that has the mcp scope, and confirm list_projects is advertised.
  3. Call tools/call with { "name": "list_projects", "arguments": { "group_id": "gitlab-org", "first": 5 } } and confirm it returns projects under that group.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading