{
  "name": "gitlab",
  "display_name": "GitLab",
  "description": "GitLab API, enabling project management",
  "repository": {
    "type": "git",
    "url": "https://github.com/modelcontextprotocol/servers"
  },
  "homepage": "https://github.com/modelcontextprotocol/servers/blob/main/src/gitlab",
  "author": {
    "name": "modelcontextprotocol"
  },
  "license": "MIT",
  "categories": [
    "Dev Tools"
  ],
  "tags": [
    "GitLab",
    "API"
  ],
  "installations": {
    "npm": {
      "type": "npm",
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "${GITLAB_PERSONAL_ACCESS_TOKEN}",
        "GITLAB_API_URL": "${GITLAB_API_URL}"
      }
    },
    "docker": {
      "type": "docker",
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "-i",
        "-e",
        "GITLAB_PERSONAL_ACCESS_TOKEN",
        "-e",
        "GITLAB_API_URL",
        "mcp/gitlab"
      ],
      "env": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "${GITLAB_PERSONAL_ACCESS_TOKEN}",
        "GITLAB_API_URL": "${GITLAB_API_URL}"
      }
    }
  },
  "arguments": {
    "GITLAB_PERSONAL_ACCESS_TOKEN": {
      "description": "Your GitLab personal access token",
      "required": true
    },
    "GITLAB_API_URL": {
      "description": "Base URL for GitLab API",
      "required": false,
      "example": "https://gitlab.com/api/v4"
    }
  },
  "tools": [
    {
      "name": "create_or_update_file",
      "description": "Create or update a single file in a GitLab project",
      "inputSchema": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "Project ID or URL-encoded path"
          },
          "file_path": {
            "type": "string",
            "description": "Path where to create/update the file"
          },
          "content": {
            "type": "string",
            "description": "Content of the file"
          },
          "commit_message": {
            "type": "string",
            "description": "Commit message"
          },
          "branch": {
            "type": "string",
            "description": "Branch to create/update the file in"
          },
          "previous_path": {
            "type": "string",
            "description": "Path of the file to move/rename"
          }
        },
        "required": [
          "project_id",
          "file_path",
          "content",
          "commit_message",
          "branch"
        ]
      }
    },
    {
      "name": "search_repositories",
      "description": "Search for GitLab projects",
      "inputSchema": {
        "type": "object",
        "properties": {
          "search": {
            "type": "string",
            "description": "Search query"
          },
          "page": {
            "type": "number",
            "description": "Page number for pagination (default: 1)"
          },
          "per_page": {
            "type": "number",
            "description": "Number of results per page (default: 20)"
          }
        },
        "required": [
          "search"
        ]
      }
    },
    {
      "name": "create_repository",
      "description": "Create a new GitLab project",
      "inputSchema": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Repository name"
          },
          "description": {
            "type": "string",
            "description": "Repository description"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "private",
              "internal",
              "public"
            ],
            "description": "Repository visibility level"
          },
          "initialize_with_readme": {
            "type": "boolean",
            "description": "Initialize with README.md"
          }
        },
        "required": [
          "name"
        ]
      }
    },
    {
      "name": "get_file_contents",
      "description": "Get the contents of a file or directory from a GitLab project",
      "inputSchema": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "Project ID or URL-encoded path"
          },
          "file_path": {
            "type": "string",
            "description": "Path to the file or directory"
          },
          "ref": {
            "type": "string",
            "description": "Branch/tag/commit to get contents from"
          }
        },
        "required": [
          "project_id",
          "file_path"
        ]
      }
    },
    {
      "name": "push_files",
      "description": "Push multiple files to a GitLab project in a single commit",
      "inputSchema": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "Project ID or URL-encoded path"
          },
          "branch": {
            "type": "string",
            "description": "Branch to push to"
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "file_path": {
                  "type": "string",
                  "description": "Path where to create the file"
                },
                "content": {
                  "type": "string",
                  "description": "Content of the file"
                }
              },
              "required": [
                "file_path",
                "content"
              ],
              "additionalProperties": false
            },
            "description": "Array of files to push"
          },
          "commit_message": {
            "type": "string",
            "description": "Commit message"
          }
        },
        "required": [
          "project_id",
          "branch",
          "files",
          "commit_message"
        ]
      }
    },
    {
      "name": "create_issue",
      "description": "Create a new issue in a GitLab project",
      "inputSchema": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "Project ID or URL-encoded path"
          },
          "title": {
            "type": "string",
            "description": "Issue title"
          },
          "description": {
            "type": "string",
            "description": "Issue description"
          },
          "assignee_ids": {
            "type": "array",
            "items": {
              "type": "number"
            },
            "description": "Array of user IDs to assign"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Array of label names"
          },
          "milestone_id": {
            "type": "number",
            "description": "Milestone ID to assign"
          }
        },
        "required": [
          "project_id",
          "title"
        ]
      }
    },
    {
      "name": "create_merge_request",
      "description": "Create a new merge request in a GitLab project",
      "inputSchema": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "Project ID or URL-encoded path"
          },
          "title": {
            "type": "string",
            "description": "Merge request title"
          },
          "description": {
            "type": "string",
            "description": "Merge request description"
          },
          "source_branch": {
            "type": "string",
            "description": "Branch containing changes"
          },
          "target_branch": {
            "type": "string",
            "description": "Branch to merge into"
          },
          "draft": {
            "type": "boolean",
            "description": "Create as draft merge request"
          },
          "allow_collaboration": {
            "type": "boolean",
            "description": "Allow commits from upstream members"
          }
        },
        "required": [
          "project_id",
          "title",
          "source_branch",
          "target_branch"
        ]
      }
    },
    {
      "name": "fork_repository",
      "description": "Fork a GitLab project to your account or specified namespace",
      "inputSchema": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "Project ID or URL-encoded path"
          },
          "namespace": {
            "type": "string",
            "description": "Namespace to fork to (full path)"
          }
        },
        "required": [
          "project_id"
        ]
      }
    },
    {
      "name": "create_branch",
      "description": "Create a new branch in a GitLab project",
      "inputSchema": {
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string",
            "description": "Project ID or URL-encoded path"
          },
          "branch": {
            "type": "string",
            "description": "Name for the new branch"
          },
          "ref": {
            "type": "string",
            "description": "Source branch/commit for new branch"
          }
        },
        "required": [
          "project_id",
          "branch"
        ]
      }
    }
  ],
  "is_official": true,
  "is_archived": true,
  "docker_url": "https://hub.docker.com/r/mcp/gitlab"
}