Ir al contenido

Entornos y despliegues

Los entornos de un proyecto (crear, leer, actualizar, parar y borrar), los registros de despliegue hechos en ellos (listar, leer, crear, actualizar, borrar, los merge requests que entregó un despliegue y aprobar o rechazar un despliegue que espera en una puerta manual) y los periodos de congelación que bloquean los despliegues según un calendario. Los entornos protegidos, que limitan quién puede desplegar en un entorno, son las acciones que se sirven a partir de Premium.

Parar un entorno ejecuta sus jobs de parada, y force se los salta; parar y borrar son destructivas.

  • “Lista los entornos del proyecto 42”
  • “¿Qué está desplegado ahora mismo en production?”
  • “Añade una congelación de despliegues durante las vacaciones de fin de año”
  • “Aprueba el despliegue que espera en production”
  • Dinámica, la superficie predeterminada: llama a gitlab_execute_action con action igual al ID de la acción, como environment.create, y sus parámetros en params. gitlab_find_action encuentra un ID a partir de una descripción de la tarea.
  • Meta (GITLAB_MCP_TOOL_SURFACE=meta): llama a gitlab_environment con action igual al nombre de la acción, como create, y sus parámetros en params.
  • Individual (GITLAB_MCP_TOOL_SURFACE=individual): llama a la herramienta propia de la acción, como gitlab_environment_create, pasándole directamente sus parámetros.

Cuántas de estas acciones sirve una instancia en cada nivel, de un total de 23:

  • Free: 18
  • Premium: 23
  • Ultimate: 23

Acciones de solo lectura: 9 de 23, las que conserva un despliegue en modo de solo lectura.

La descripción de cada acción, y la de cada uno de sus parámetros, es el texto que sirve el servidor para ella en la superficie predeterminada, citado tal cual; por eso está en inglés. Una acción destructiva solo se ejecuta una vez confirmada, salvo que GITLAB_MCP_YOLO_MODE (o AUTOPILOT) se salte ese paso: la superficie dinámica necesita confirm: true en gitlab_execute_action, y las otras dos aceptan un parámetro confirm o la pregunta del cliente (Acciones destructivas).

AcciónNivelIndividual
environment.createFreegitlab_environment_create
environment.deleteFreegitlab_environment_delete
environment.deployment_approve_or_rejectFreegitlab_deployment_approve_or_reject
environment.deployment_createFreegitlab_deployment_create
environment.deployment_deleteFreegitlab_deployment_delete
environment.deployment_getFreegitlab_deployment_get
environment.deployment_listFreegitlab_deployment_list
environment.deployment_merge_requestsFreegitlab_list_deployment_merge_requests
environment.deployment_updateFreegitlab_deployment_update
environment.freeze_createFreegitlab_create_freeze_period
environment.freeze_deleteFreegitlab_delete_freeze_period
environment.freeze_getFreegitlab_get_freeze_period
environment.freeze_listFreegitlab_list_freeze_periods
environment.freeze_updateFreegitlab_update_freeze_period
environment.getFreegitlab_environment_get
environment.listFreegitlab_environment_list
environment.protected_getPremiumgitlab_protected_environment_get
environment.protected_listPremiumgitlab_protected_environment_list
environment.protected_protectPremiumgitlab_protected_environment_protect
environment.protected_unprotectPremiumgitlab_protected_environment_unprotect
environment.protected_updatePremiumgitlab_protected_environment_update
environment.stopFreegitlab_environment_stop
environment.updateFreegitlab_environment_update

Create an environment in a project. Use when introducing new runtime targets such as review, staging, or production environments.

  • Meta-herramienta: gitlab_environment, acción create
  • Herramienta individual: gitlab_environment_create
  • Nivel: Free
  • Comportamiento: escribe, no idempotente
ParámetroTipoRequeridoDescripción
namestringsíEnvironment name (e.g. production, staging)
project_idstring/integersíProject ID or URL-encoded path
auto_stop_settingstring (always, with_action)noAuto-stop behavior: always or with_action
cluster_agent_idintegernoID of the cluster agent to associate with this environment
descriptionstringnoDescription of the environment
external_urlstringnoURL of the environment’s external deployment
flux_resource_pathstringnoFlux resource path used to track the environment’s deployment status
kubernetes_namespacestringnoKubernetes namespace for the cluster agent
tierstring (production, staging, testing, development, other)noDeployment tier: production, staging, testing, development, other

Delete a stopped environment from a project. Returns: a success confirmation naming the deleted environment. See also: environment.stop, environment.list, environment.get.

  • Meta-herramienta: gitlab_environment, acción delete
  • Herramienta individual: gitlab_environment_delete
  • Nivel: Free
  • Comportamiento: escribe, destructiva (necesita confirmación), idempotente
ParámetroTipoRequeridoDescripción
environment_idintegersíEnvironment ID
project_idstring/integersíProject ID or URL-encoded path

Approve or reject a blocked deployment awaiting protected-environment approval, optionally with a comment and an approval rule to represent. Returns: a confirmation message naming the deployment and the applied status. See also: environment.deployment_get, environment.deployment_update.

  • Meta-herramienta: gitlab_environment, acción deployment_approve_or_reject
  • Herramienta individual: gitlab_deployment_approve_or_reject
  • Nivel: Free
  • Comportamiento: escribe, idempotente
ParámetroTipoRequeridoDescripción
deployment_idintegersíDeployment ID
project_idstring/integersíProject ID or URL-encoded path
statusstring (approved, rejected)síApproval status: approved or rejected
commentstringnoOptional comment for the approval or rejection
represented_asstringnoName of the approval rule to act as, when the user belongs to multiple approval rules

Create a deployment record for an environment at a given ref and sha with an initial status. Returns: the created deployment with id, iid, ref, sha, status, and nested user, environment, and deployable objects. See also: environment.get, environment.deployment_list, environment.deployment_update.

  • Meta-herramienta: gitlab_environment, acción deployment_create
  • Herramienta individual: gitlab_deployment_create
  • Nivel: Free
  • Comportamiento: escribe, no idempotente
ParámetroTipoRequeridoDescripción
environmentstringsíName of the environment to deploy to
project_idstring/integersíProject ID or URL-encoded path
refstringsíGit branch or tag to deploy
shastringsíGit SHA to deploy
statusstring (running, success, failed, canceled)noInitial deployment status: running or success or failed or canceled. GitLab 19 rejects created when creating a deployment
tagbooleannoWhether the ref is a tag. GitLab 19 requires this explicitly: pass false for branch refs and true for tag refs (default: false)

Delete a deployment record by deployment_id within a project. Returns: a confirmation that the deployment was deleted. See also: environment.deployment_get, environment.deployment_list.

  • Meta-herramienta: gitlab_environment, acción deployment_delete
  • Herramienta individual: gitlab_deployment_delete
  • Nivel: Free
  • Comportamiento: escribe, destructiva (necesita confirmación), idempotente
ParámetroTipoRequeridoDescripción
deployment_idintegersíDeployment ID
project_idstring/integersíProject ID or URL-encoded path

Get one deployment by deployment_id for a project. Use when investigating a specific deployment state, environment, or actor metadata.

  • Meta-herramienta: gitlab_environment, acción deployment_get
  • Herramienta individual: gitlab_deployment_get
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
deployment_idintegersíDeployment ID
project_idstring/integersíProject ID or URL-encoded path

List deployments in a project with environment, status, and date filters plus offset or keyset pagination. Returns: matching deployments with ref, sha, status, user, environment, and deployable (CI job) objects, and pagination metadata. See also: environment.deployment_get, environment.list, pipeline.get.

  • Meta-herramienta: gitlab_environment, acción deployment_list
  • Herramienta individual: gitlab_deployment_list
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
project_idstring/integersíProject ID or URL-encoded path
environmentstringnoFilter by environment name
finished_afterstringnoReturn deployments finished after this RFC3339 timestamp (GitLab 14+ only)
finished_beforestringnoReturn deployments finished before this RFC3339 timestamp (GitLab 14+ only)
order_bystring (id, iid, created_at, updated_at, finished_at, ref)noOrder by id or iid or created_at or updated_at or finished_at or ref (default: id)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sortstring (asc, desc)noSort order: asc or desc (default: asc)
statusstring (created, running, success, failed, canceled, blocked)noFilter by status: created or running or success or failed or canceled
updated_afterstringnoReturn deployments updated after this RFC3339 timestamp (GitLab < 14 only)
updated_beforestringnoReturn deployments updated before this RFC3339 timestamp (GitLab < 14 only)

List the merge requests associated with a deployment, with merge-request filtering (state, approval, author, assignee, draft, created date) and offset or keyset pagination. Returns: matching merge requests with full metadata (author, assignees, reviewers, labels, milestone, pipelines, time stats, timestamps) and pagination metadata. See also: merge_request.get, merge_request.list, environment.deployment_list.

  • Meta-herramienta: gitlab_environment, acción deployment_merge_requests
  • Herramienta individual: gitlab_list_deployment_merge_requests
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
deployment_idintegersíDeployment ID
project_idstring/integersíProject ID or URL-encoded path
approved_by_idsinteger/string[]noFilter by MRs approved by all listed user IDs. Accepts user IDs, or exactly one of “Any” (approved by someone) or “None” (unapproved)
approved_by_usernamesstring[]noFilter by MRs approved by all listed usernames
approver_idsinteger/string[]noFilter by MRs with all listed users as eligible approvers. Accepts user IDs, or exactly one of “Any” (has approvers) or “None” (has none)
assignee_idintegernoFilter by assignee user ID
author_idintegernoFilter by author user ID
author_usernamestringnoFilter by author username
created_afterstringnoReturn MRs created after date (ISO 8601, e.g. 2025-01-01T00:00:00Z)
created_beforestringnoReturn MRs created before date (ISO 8601, e.g. 2025-12-31T23:59:59Z)
draftbooleannoFilter by draft status (true=only drafts, false=only non-drafts)
instringnoFields the search parameter matches. Accepts title, description, or both joined with a comma. Default is title,description
labelsstring[]noLabel names to filter by
milestonestringnoMilestone title to filter by
my_reaction_emojistringnoFilter by MRs the caller reacted to with this emoji (e.g. thumbsup)
non_archivedbooleannoReturn merge requests from non-archived projects only. Default is true
not_author_usernamestringnoExclude MRs authored by this username
not_labelsstring[]noLabel names to exclude
order_bystring (created_at, updated_at, merged_at, label_priority, priority, milestone_due, popularity, title)noOrder by: created_at, updated_at, merged_at, label_priority, priority, milestone_due, popularity, or title (default created_at)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
reviewer_idintegernoFilter by reviewer user ID
reviewer_usernamestringnoFilter by reviewer username
scopestring (created_by_me, assigned_to_me, reviews_for_me, all)noFilter by scope: created_by_me, assigned_to_me, reviews_for_me, or all
searchstringnoSearch in title and description
sortstring (asc, desc)noSort order: asc or desc
source_branchstringnoFilter by source branch name
statestring (opened, closed, locked, merged, all)noFilter by state: opened, closed, locked, merged, or all (default all)
target_branchstringnoFilter by target branch name
updated_afterstringnoReturn MRs updated after date (ISO 8601, e.g. 2025-01-01T00:00:00Z)
updated_beforestringnoReturn MRs updated before date (ISO 8601, e.g. 2025-12-31T23:59:59Z)
wipstringnoFilter by draft/WIP status: ‘yes’ for draft MRs, ‘no’ for non-draft

Update a deployment’s status by deployment_id within a project. Returns: the updated deployment with id, iid, ref, sha, status, and nested user, environment, and deployable objects. See also: environment.deployment_get, environment.deployment_list, environment.deployment_approve_or_reject.

  • Meta-herramienta: gitlab_environment, acción deployment_update
  • Herramienta individual: gitlab_deployment_update
  • Nivel: Free
  • Comportamiento: escribe, idempotente
ParámetroTipoRequeridoDescripción
deployment_idintegersíDeployment ID
project_idstring/integersíProject ID or URL-encoded path
statusstring (running, success, failed, canceled)síNew deployment status: running or success or failed or canceled

Create a deploy freeze period for a project. Returns: the created freeze period with id, freeze_start/freeze_end cron expressions, and cron_timezone.

  • Meta-herramienta: gitlab_environment, acción freeze_create
  • Herramienta individual: gitlab_create_freeze_period
  • Nivel: Free
  • Comportamiento: escribe, no idempotente
ParámetroTipoRequeridoDescripción
freeze_endstringsíCron expression for freeze end (e.g. 0 7 * * 1)
freeze_startstringsíCron expression for freeze start (e.g. 0 23 * * 5)
project_idstring/integersíProject ID or URL-encoded path
cron_timezonestringnoTimezone for cron expressions (e.g. America/New_York)

Delete a deploy freeze period. Returns: no content on success (HTTP 204).

  • Meta-herramienta: gitlab_environment, acción freeze_delete
  • Herramienta individual: gitlab_delete_freeze_period
  • Nivel: Free
  • Comportamiento: escribe, destructiva (necesita confirmación), idempotente
ParámetroTipoRequeridoDescripción
freeze_period_idintegersíFreeze period ID
project_idstring/integersíProject ID or URL-encoded path

Get a specific deploy freeze period. Returns: the freeze period’s id, freeze_start/freeze_end cron expressions, cron_timezone, and created/updated timestamps.

  • Meta-herramienta: gitlab_environment, acción freeze_get
  • Herramienta individual: gitlab_get_freeze_period
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
freeze_period_idintegersíFreeze period ID
project_idstring/integersíProject ID or URL-encoded path

List deploy freeze periods for a project. Returns: each freeze period’s id, freeze_start/freeze_end cron expressions, cron_timezone, and created/updated timestamps.

  • Meta-herramienta: gitlab_environment, acción freeze_list
  • Herramienta individual: gitlab_list_freeze_periods
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
project_idstring/integersíProject ID or URL-encoded path
order_bystringnoColumn to order results by
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sortstring (asc, desc)noSort direction (asc, desc)

Update an existing deploy freeze period. Returns: the updated freeze period with id, freeze_start/freeze_end cron expressions, and cron_timezone.

  • Meta-herramienta: gitlab_environment, acción freeze_update
  • Herramienta individual: gitlab_update_freeze_period
  • Nivel: Free
  • Comportamiento: escribe, idempotente
ParámetroTipoRequeridoDescripción
freeze_period_idintegersíFreeze period ID
project_idstring/integersíProject ID or URL-encoded path
cron_timezonestringnoTimezone for cron expressions
freeze_endstringnoCron expression for freeze end
freeze_startstringnoCron expression for freeze start

Get one environment by environment_id. Use when inspecting state, tier, external URL, and stop behavior of a specific environment.

  • Meta-herramienta: gitlab_environment, acción get
  • Herramienta individual: gitlab_environment_get
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
environment_idintegersíEnvironment ID
project_idstring/integersíProject ID or URL-encoded path

List environments in one project with filters and pagination. Use this to discover environment IDs before get/update/stop/delete operations.

  • Meta-herramienta: gitlab_environment, acción list
  • Herramienta individual: gitlab_environment_list
  • Nivel: Free
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
project_idstring/integersíProject ID or URL-encoded path
namestringnoFilter by exact environment name
order_bystringnoColumn to order results by (e.g. id, name)
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
searchstringnoSearch environments by name (fuzzy)
sortstring (asc, desc)noSort order: asc or desc
statesstring (available, stopping, stopped)noFilter by state: available, stopping, stopped

Get a single protected (or wildcard) environment by name. Returns: the environment with its deploy access levels (id, access level, user/group, group inheritance) and approval rules. See also: environment.protected_list, environment.protected_update, environment.protected_unprotect.

  • Meta-herramienta: gitlab_environment, acción protected_get
  • Herramienta individual: gitlab_protected_environment_get
  • Nivel: Premium
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
environmentstringsíEnvironment name
project_idstring/integersíProject ID or URL-encoded path

List protected environments in a project with order_by/sort and offset or keyset pagination. Returns: protected environments with their deploy access levels, required approval count, approval rules, and pagination metadata. See also: environment.protected_get, environment.protected_protect, environment.list.

  • Meta-herramienta: gitlab_environment, acción protected_list
  • Herramienta individual: gitlab_protected_environment_list
  • Nivel: Premium
  • Comportamiento: solo lectura, idempotente
ParámetroTipoRequeridoDescripción
project_idstring/integersíProject ID or URL-encoded path
order_bystringnoColumn to order keyset-paginated results by
pageintegernoPage number to fetch, 1-based. Defaults to 1. Use the next_page field from the previous response to paginate forward.
page_tokenstringnoKeyset pagination cursor: record id at which to fetch the next page, taken from the previous keyset response. Only used when pagination=‘keyset’.
paginationstringnoPagination method: ‘keyset’ for keyset-based pagination on large ordered result sets, or ‘offset’ (the default). Keyset avoids deep-offset cost.
per_pageintegernoItems per page. Defaults to 20, minimum 1, maximum 100. Use 100 to minimize round trips when the result set is large.
sortstring (asc, desc)noSort direction (asc, desc)

Protect a single environment or wildcard with deploy access levels and approval rules. Returns: the newly protected environment with its deploy access levels, required approval count, and approval rules. See also: environment.protected_get, environment.protected_update, environment.protected_unprotect.

  • Meta-herramienta: gitlab_environment, acción protected_protect
  • Herramienta individual: gitlab_protected_environment_protect
  • Nivel: Premium
  • Comportamiento: escribe, no idempotente
ParámetroTipoRequeridoDescripción
deploy_access_levelsobject[]síDeploy access levels
namestringsíEnvironment name to protect
project_idstring/integersíProject ID or URL-encoded path
approval_rulesobject[]noApproval rules
required_approval_countintegernoRequired number of approvals

Unprotect a single environment or wildcard, removing its deployment gates. Returns: a success confirmation naming the unprotected environment. See also: environment.protected_list, environment.protected_protect.

  • Meta-herramienta: gitlab_environment, acción protected_unprotect
  • Herramienta individual: gitlab_protected_environment_unprotect
  • Nivel: Premium
  • Comportamiento: escribe, destructiva (necesita confirmación), idempotente
ParámetroTipoRequeridoDescripción
environmentstringsíEnvironment name to unprotect
project_idstring/integersíProject ID or URL-encoded path

Update a protected environment’s deploy access levels and approval rules (use _destroy to remove an entry). Returns: the updated environment with its deploy access levels, required approval count, and approval rules. See also: environment.protected_get, environment.protected_protect, environment.protected_unprotect.

  • Meta-herramienta: gitlab_environment, acción protected_update
  • Herramienta individual: gitlab_protected_environment_update
  • Nivel: Premium
  • Comportamiento: escribe, idempotente
ParámetroTipoRequeridoDescripción
environmentstringsíEnvironment name
project_idstring/integersíProject ID or URL-encoded path
approval_rulesobject[]noUpdated approval rules
deploy_access_levelsobject[]noUpdated deploy access levels
namestringnoNew environment name
required_approval_countintegernoRequired number of approvals

Stop an active environment. This is modeled as a delete-style action but intentionally marked non-destructive because it changes runtime state without deleting the environment resource.

  • Meta-herramienta: gitlab_environment, acción stop
  • Herramienta individual: gitlab_environment_stop
  • Nivel: Free
  • Comportamiento: escribe, destructiva (necesita confirmación), idempotente
ParámetroTipoRequeridoDescripción
environment_idintegersíEnvironment ID
project_idstring/integersíProject ID or URL-encoded path
forcebooleannoForce stop even if environment has active deployments

Update an existing environment in a project. Returns: the updated environment with state, tier, external URL, cluster agent, Kubernetes namespace, Flux resource path, and auto-stop settings. See also: environment.get, environment.list, environment.stop.

  • Meta-herramienta: gitlab_environment, acción update
  • Herramienta individual: gitlab_environment_update
  • Nivel: Free
  • Comportamiento: escribe, idempotente
ParámetroTipoRequeridoDescripción
environment_idintegersíEnvironment ID
project_idstring/integersíProject ID or URL-encoded path
auto_stop_settingstring (always, with_action)noAuto-stop behavior: always or with_action
cluster_agent_idintegernoID of the cluster agent to associate with this environment
descriptionstringnoUpdated description
external_urlstringnoUpdated external URL
flux_resource_pathstringnoFlux resource path used to track the environment’s deployment status
kubernetes_namespacestringnoKubernetes namespace for the cluster agent
namestringnoNew environment name
tierstring (production, staging, testing, development, other)noUpdated tier: production, staging, testing, development, other