Add save_project MCP tool

What does this MR do and why?

Implements the save_project MCP tool that creates GitLab projects via the REST API (POST /projects).

REST-backed aggregated tool following the SaveMergeRequestService pattern:

  • Inherits from Mcp::Tools::Base::AggregatedService
  • Create-only (no update path; PUT /projects/:id is a follow-up)
  • Toolset: :core (same as get_project)
  • Governance: container_arguments declares record resolvers for both namespace_id and namespace_path, following the fork_repository pattern. Personal namespaces are excluded from tool-rule governance.

Exposed parameters: name, path, namespace_id, namespace_path, description, visibility, initialize_with_readme, default_branch, topics, and template_name (built-in templates, all tiers). Custom-template params template_project_id, use_custom_template, and group_with_project_templates_id are added by the EE override (Premium and Ultimate). Import, CI/CD catalog, storage, and admin-only params are intentionally excluded.

Changes

  • Add create_project_mcp_params helper to ProjectsHelpers (includes template_name)
  • Create SaveProjectService with schema, governance, and argument transformation
  • Resolve namespace_path into namespace_id before dispatch, with permission checks for both inputs and the same error for missing or inaccessible namespaces
  • Add EE extension for the custom-template params plus EE specs
  • Lock save_project annotations in the CE and EE list_tools specs
  • Document save_project in the MCP server tools docs
  • Add enabled tools/call request specs for save_project, including the instance visibility default and namespace access checks
  • URL-decode namespace_path before the namespace lookup
  • Remove the unused public create_project alias; keep the internal REST sub-tool name unchanged
  • Describe omitted visibility as using the instance default, and record the tool's introduction in GitLab 19.6

If visibility is omitted, the REST API uses the instance default project visibility, subject to the namespace's visibility restrictions.

Dependency

!259413 (merged) merged on October 26, 2026. It fixes the JSON-RPC id leak that caused the EE project-create route to return 404 Project Not Found.

This branch has been rebased onto master, and the temporary copy of that fix has been dropped. The merged fix is inherited from master; its implementation and regression spec are no longer part of this MR's diff. The save_project request specs remain enabled.

References

Closes #585569 (closed)

Related bug: #631936 (closed)

Screenshots or screen recordings

Not applicable - backend MCP tool with no UI changes.

How to set up and validate locally

  1. Start GDK with the branch checked out
  2. Use an MCP client (opencode, Claude Code, etc.) authenticated to GDK
  3. Test creating a project:
    • Use save_project to create a project named "test-project" with visibility private
  4. Verify the project was created at root/test-project

EE template testing (requires Ultimate license)

  1. Set up instance-level custom templates via Admin > Settings > Templates
  2. Test: Use save_project to create a project named "from-template" with use_custom_template true and template_name "<template-project-name>"

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.

Edited by Tanvir Singh

Merge request reports

Loading
Loading