GitLab MCP Server, how to run?

Hi I have just received docker newsletter/navigator introducing Docker MCP catalog. I am interested in running the Gitlab mcp.
Reading at URL https://hub.docker.com/r/mcp/gitlab, it is indicated

Use this MCP Server
{
  "mcpServers": {
    "gitlab": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITLAB_API_URL",
        "-e",
        "GITLAB_PERSONAL_ACCESS_TOKEN",
        "mcp/gitlab"
      ],
      "env": {
        "GITLAB_API_URL": "https://gitlab.com/api/v4",
        "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

where this file should reside and how it can be called? 2nd, the GITLAB_PERSONAL_ACCESS_TOKEN, is this arbitrarty or I should get a token from Gitlab?

Thanks for your help

In your ide/tool that support mcp servers. For instance vscode does: https://code.visualstudio.com/docs/copilot/chat/mcp-servers, but the syntax of the configuration will be slightly different.

OK thanks, how about the token?

Can you extend on what your exact question is?

The snippet shows how the mcp client needs to be configured to run the mcp server. The exact structure depends on the mcp client, as well as how to deal with tokens and secrets. The vscode link I shared shows how tokens can be entered as input and referenced as such.

meyay, my question is where or how I get a token? is it an arbitrary string that I enter or should I get it from GitLab?

You need to create a personal access token for your profile on the Gitlab server you are using.
If you use a private Gitlab instance, make sure to change the api url as well.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.