Skip to content

Auto-update

GitLab MCP Server can automatically detect, download, and apply new releases from GitHub. Updates use a rename trick — the running binary is renamed to .old, the new binary is placed at the original path, and on Unix the process re-executes seamlessly.

The AUTO_UPDATE variable controls how updates are handled:

ValueModeBehavior
true (default)Auto-applyDetect and apply updates automatically
checkNotify onlyDetect updates and log availability, but do not apply
falseDisabledSkip all update checks entirely

Accepted aliases: 1/yes for true, 0/no for false. The value is case-insensitive.

sequenceDiagram
    participant Server as gitlab-mcp-server
    participant GitHub as GitHub Releases API
    participant FS as File System

    Server->>Server: CleanupOldBinary()
    Server->>GitHub: GET /repos/:owner/:repo/releases/latest
    GitHub-->>Server: Release metadata + asset URLs
    alt Update available
        Server->>GitHub: Download binary asset
        Server->>FS: Write to .tmp staging file
        Server->>FS: Rename current → .old
        Server->>FS: Rename .tmp → current path
        alt Unix
            Server->>Server: syscall.Exec(self) — seamless re-exec
        else Windows
            Server->>Server: Update takes effect on next restart
        end
    else Up to date
        Server->>Server: Log "server is up to date"
    end

In stdio mode (the default), auto-update runs as a pre-start check with a 15-second timeout before the MCP server begins accepting connections:

  1. CleanupOldBinary() removes any leftover .old file from a previous update
  2. Checks for a newer release on GitHub
  3. If mode is true and a newer version exists, downloads and replaces the binary
  4. On Linux/macOS: re-executes via syscall.Exec() — same PID, same stdin/stdout pipes, no interruption to the MCP client
  5. On Windows: logs that the update will take effect on next restart

The startup check is non-fatal — any error (network timeout, missing releases) is logged as a warning and does not prevent the server from starting.

In HTTP mode, auto-update runs as a background periodic check:

  1. A goroutine checks for updates every AUTO_UPDATE_INTERVAL (default: 1 hour)
  2. Each cycle checks GitHub for a newer release with a 30-second timeout
  3. If mode is true, applies the update and logs a restart advisory
  4. The goroutine stops when the server shuts down
VariableDefaultDescription
AUTO_UPDATEtrueUpdate mode: true, check, or false
AUTO_UPDATE_REPOjmrplens/gitlab-mcp-serverGitHub repository slug (owner/repo) for release assets
AUTO_UPDATE_INTERVAL1hCheck interval (used by HTTP mode periodic checks)
FlagDefaultDescription
--auto-updatetrueUpdate mode: true, check, or false
--auto-update-repojmrplens/gitlab-mcp-serverGitHub repository slug (owner/repo) for release assets
--auto-update-interval1hInterval between periodic update checks

Disable auto-update entirely:

AUTO_UPDATE=false

Check-only mode (log availability but do not apply):

AUTO_UPDATE=check

Use a custom fork repository:

AUTO_UPDATE_REPO=my-org/my-gitlab-mcp-fork

External tools (such as pe-agnostic-store) can terminate all running instances before replacing the binary on disk:

Terminal window
gitlab-mcp-server --shutdown

This flag:

  1. Finds all running gitlab-mcp-server processes by name
  2. Sends a graceful termination signal
  3. Waits up to 5 seconds for processes to exit
  4. Force-kills any remaining processes
  5. Exits — no MCP server is started

No admin or root permissions are required. This works on Linux, macOS, and Windows.

If an update causes issues:

  1. The previous binary is preserved as gitlab-mcp-server.old (or .exe.old on Windows) next to the current binary
  2. To rollback, stop the server and rename the .old file back to the original name
  3. The .old file is automatically cleaned up on the next successful startup

You can point auto-update at any GitHub repository that follows the expected release format:

  1. Set AUTO_UPDATE_REPO=owner/repo to your repository
  2. Create GitHub releases with platform binaries named gitlab-mcp-server-{os}-{arch}
  3. Include a checksums.txt asset with SHA-256 hashes (goreleaser format)