Skip to content
Agentmart
Submit a tool

How to connect GitLab to Cursor

Here GitLab MCP Server, published by zereight and not flagged as the vendor's own, is set up in Cursor. It runs locally through npx. The listing marks GITLAB_PERSONAL_ACCESS_TOKEN and GITLAB_JOB_TOKEN as optional, so decide which you need. Install data comes from the listing and Cursor's documentation, and the check happens in the MCP logs.

Updated Oct 26, 2026 · Built from catalog data; how we rank and grade

Checked against Cursor's documentation on Oct 26, 2026. Commands and config blocks are generated from the same install data as each listing page.

Before you start

  • Cursor installed and able to start.
  • Node.js with npx (the server starts with npx).
  • GITLAB_PERSONAL_ACCESS_TOKEN (optional): GitLab personal access token for local stdio use. A non-empty value overrides GITLAB_PERSONAL_ACCESS_TOKEN_FILE. One of this token, GITLAB_PERSONAL_ACCESS_TOKEN_FILE, GITLAB_JOB_TOKEN, GITLAB_AUTH_COOKIE_PATH, or GITLAB_USE_OAUTH=true must be set. Create a token with the GitLab scopes the tools need, such as api or read_api.
  • GITLAB_JOB_TOKEN (optional): Optional GitLab CI job token to use instead of a personal access token when running inside GitLab CI.
  1. 1. Check what you need

    Cursor has to be able to run npx, which depends on Node.js. Confirm it with the node --version block.

    Check that it is installed
    node --version
    • It can take GITLAB_PERSONAL_ACCESS_TOKEN and GITLAB_JOB_TOKEN (next step).
  2. 2. Get GITLAB_PERSONAL_ACCESS_TOKEN and GITLAB_JOB_TOKEN

    A personal token suits local use and a job token suits GitLab CI runs, per the listing's descriptions. Create whichever applies in your GitLab account and keep it private.

    • GITLAB_PERSONAL_ACCESS_TOKEN (optional): GitLab personal access token for local stdio use. A non-empty value overrides GITLAB_PERSONAL_ACCESS_TOKEN_FILE. One of this token, GITLAB_PERSONAL_ACCESS_TOKEN_FILE, GITLAB_JOB_TOKEN, GITLAB_AUTH_COOKIE_PATH, or GITLAB_USE_OAUTH=true must be set. Create a token with the GitLab scopes the tools need, such as api or read_api.
    • GITLAB_JOB_TOKEN (optional): Optional GitLab CI job token to use instead of a personal access token when running inside GitLab CI.
  3. 3. Add GitLab MCP Server to Cursor

    The JSON entry hands both variables to the server through an env block that reads from Cursor's own environment, and a shell export provides the values. The package itself is launched with npx.

    Add this to .cursor/mcp.json in the project, or to ~/.cursor/mcp.json for every project.cursor/mcp.json
    {
      "mcpServers": {
        "gitlab-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@zereight/mcp-gitlab@2.3.7"
          ],
          "env": {
            "GITLAB_PERSONAL_ACCESS_TOKEN": "${env:GITLAB_PERSONAL_ACCESS_TOKEN}",
            "GITLAB_JOB_TOKEN": "${env:GITLAB_JOB_TOKEN}"
          }
        }
      }
    }
    Set the variable in the shell you start the host from
    export GITLAB_PERSONAL_ACCESS_TOKEN="paste-your-value-here"
    export GITLAB_JOB_TOKEN="paste-your-value-here"
    • Cursor expands ${env:NAME} from its own environment, so the variable has to be set where Cursor starts.
  4. 4. Restart or reload if it does not appear

    If nothing appears in Cursor after saving the config, this step collects the restart wording and the tool-approval behavior from its docs.

    • The docs do not say whether editing mcp.json needs a restart. They tell you to restart Cursor after updating files of a custom local server.
    • Cursor asks for approval before an agent uses an MCP tool unless you allowlist it.

Check that it works

The MCP Logs channel shows whether GitLab MCP Server connected, and the catalog lists 293 tools to compare against.

  • Open the Output panel (Cmd+Shift+U on macOS), choose MCP Logs, and look for connection errors. A working server lists its tools under Available Tools; agent mcp list shows connection state from the terminal.
  • Once it is connected, Cursor should list its tools; the catalog records 293 for GitLab MCP Server, including approve_deployment, approve_merge_request and bulk_publish_draft_notes.

Troubleshooting

A server fails or an npm-based server misbehaves after an update
Check the MCP Logs channel in the Output panel. For npm-based servers the docs suggest removing the server, running npm cache clean --force, and adding it again. Source

Security notes

  • Publisher: zereight, not listed as the vendor's own server; license MIT.
  • It runs on your machine with your user account's permissions, so it can reach any file or network resource you can. Read its source before you give it access: https://github.com/zereight/gitlab-mcp.
  • Keep GITLAB_PERSONAL_ACCESS_TOKEN and GITLAB_JOB_TOKEN in an environment variable; the config above refers to it by name, so the value is not written to the file.
  • This listing has no security grade: Agent Market has not published security grades yet, so the choice is yours to make from the source and the permissions.

How we grade security · Trust policy

Servers and skills in this guide

Continue with other GitLab servers, a comparison, or the general Cursor guide.

  1. 1

    GitLab MCP server for projects, merge requests, issues, pipelines, wiki, releases, and more.

    ★ 2.1KLast active Oct 23, 2026Local (stdio)Claude Code, Codex, VS Code, Cursor +2

Sources

Cite this page

How to connect GitLab to Cursor. Agent Mart. https://agentmart.dev/guides/connect-gitlab-to-cursor (last updated 2026-10-26)