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 and the new binary is placed at the original path. The running MCP process keeps serving; restart it to use the new binary.
Update modes
Section titled “Update modes”The AUTO_UPDATE variable controls how updates are handled:
| Value | Mode | Behavior |
| ---------------- | ----------- | ----------------------------------------------------- |
| true (default) | Auto-apply | Detect and apply updates automatically |
| check | Notify only | Detect updates and log availability, but do not apply |
| false | Disabled | Skip all update checks entirely |
Accepted aliases: 1/yes for true, 0/no for false. The value is case-insensitive.
How it works
Section titled “How it works”sequenceDiagram
participant Server as gitlab-mcp-server
participant Update as Background update goroutine
participant GitHub as GitHub Releases API
participant FS as File System
Server->>Server: CleanupOldBinary()
Server->>Update: Start startup check in background
Server->>Server: Continue MCP startup immediately
Update->>GitHub: GET /repos/:owner/:repo/releases/latest
GitHub-->>Update: Release metadata + asset URLs
alt Update available
Update->>GitHub: Download binary asset
Update->>FS: Write to .tmp staging file
Update->>FS: Rename current → .old
Update->>FS: Rename .tmp → current path
Update->>Server: Log restart advisory
else Up to date
Update->>Server: Log "server is up to date"
end
Startup check (stdio mode)
Section titled “Startup check (stdio mode)”In stdio mode (the default), auto-update runs as a background startup check with a configurable timeout (default: 60 seconds). MCP startup continues immediately while release detection and downloads run in the background:
CleanupOldBinary()removes any leftover.oldfile from a previous update- The server schedules the update check in a background goroutine
- Checks for a newer release on GitHub without blocking MCP tool negotiation
- If mode is
trueand a newer version exists, downloads and replaces the binary - Logs a restart advisory so the next server process uses the new version
The startup check is non-blocking and non-fatal — any error (network timeout, missing releases) is logged as a warning and does not prevent the server from starting or accepting MCP requests.
Periodic check (HTTP mode)
Section titled “Periodic check (HTTP mode)”In HTTP mode, auto-update runs as a background periodic check:
- A goroutine checks for updates every
AUTO_UPDATE_INTERVAL(default: 1 hour) - Each cycle checks GitHub for a newer release with a 30-second timeout
- If mode is
true, applies the update and logs a restart advisory - The goroutine stops when the server shuts down
Configuration
Section titled “Configuration”Environment variables (stdio mode)
Section titled “Environment variables (stdio mode)”| Variable | Default | Description |
| ---------------------- | ---------------------------- | -------------------------------------------------------- |
| AUTO_UPDATE | true | Update mode: true, check, or false |
| AUTO_UPDATE_REPO | jmrplens/gitlab-mcp-server | GitHub repository slug (owner/repo) for release assets |
| AUTO_UPDATE_INTERVAL | 1h | Check interval (used by HTTP mode periodic checks) |
| AUTO_UPDATE_TIMEOUT | 60s | Startup/background update timeout (range: 5s–10m) |
CLI flags (HTTP mode)
Section titled “CLI flags (HTTP mode)”| Flag | Default | Description |
| ------------------------ | ---------------------------- | -------------------------------------------------------- |
| --auto-update | true | Update mode: true, check, or false |
| --auto-update-repo | jmrplens/gitlab-mcp-server | GitHub repository slug (owner/repo) for release assets |
| --auto-update-interval | 1h | Interval between periodic update checks |
| --auto-update-timeout | 60s | Startup/background update timeout (range: 5s–10m) |
Configuration examples
Section titled “Configuration examples”Disable auto-update entirely:
AUTO_UPDATE=falseCheck-only mode (log availability but do not apply):
AUTO_UPDATE=checkUse a custom fork repository:
AUTO_UPDATE_REPO=my-org/my-gitlab-mcp-forkShutdown flag for external updaters
Section titled “Shutdown flag for external updaters”External tools (such as pe-agnostic-store) can terminate all running instances before replacing the binary on disk:
gitlab-mcp-server --shutdownThis flag:
- Finds all running
gitlab-mcp-serverprocesses by name - Sends a graceful termination signal
- Waits up to 5 seconds for processes to exit
- Force-kills any remaining processes
- Exits — no MCP server is started
No admin or root permissions are required. This works on Linux, macOS, and Windows.
Rollback
Section titled “Rollback”If an update causes issues:
- The previous binary is preserved as
gitlab-mcp-server.old(or.exe.oldon Windows) next to the current binary - To rollback, stop the server and rename the
.oldfile back to the original name - The
.oldfile is automatically cleaned up on the next successful startup
Custom repository support
Section titled “Custom repository support”You can point auto-update at any GitHub repository that follows the expected release format:
- Set
AUTO_UPDATE_REPO=owner/repoto your repository - Create GitHub releases with platform binaries named
gitlab-mcp-server-{os}-{arch} - Include a
checksums.txtasset with SHA-256 hashes (goreleaser format)