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/:idis a follow-up) - Toolset:
:core(same asget_project) - Governance:
container_argumentsdeclares record resolvers for bothnamespace_idandnamespace_path, following thefork_repositorypattern. 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_paramshelper toProjectsHelpers(includestemplate_name) - Create
SaveProjectServicewith schema, governance, and argument transformation - Resolve
namespace_pathintonamespace_idbefore 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_projectannotations in the CE and EElist_toolsspecs - Document
save_projectin the MCP server tools docs - Add enabled
tools/callrequest specs forsave_project, including the instance visibility default and namespace access checks - URL-decode
namespace_pathbefore the namespace lookup - Remove the unused public
create_projectalias; 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
- Start GDK with the branch checked out
- Use an MCP client (opencode, Claude Code, etc.) authenticated to GDK
- Test creating a project:
Use save_project to create a project named "test-project" with visibility private
- Verify the project was created at
root/test-project
EE template testing (requires Ultimate license)
- Set up instance-level custom templates via Admin > Settings > Templates
- 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.