GitLab Integration

DevBoy tools provides full integration with GitLab for managing issues, merge requests, and code reviews through AI assistants. Both GitLab.com and self-hosted GitLab instances are supported.

Quick Config Generator

Go to your project's main page — the numeric ID is shown below the project name. You can also use the full path (e.g., group/subgroup/project).

Required token scopes

When creating a GitLab Personal Access Token, you need to select the following scopes:

ScopeDescriptionRequired For
apiFull API accessReading/creating issues, MRs, comments, diffs, and starting manual CI jobs
read_userRead user informationIdentifying the current user

Configuration

Basic configuration

# Set GitLab instance URL (defaults to https://gitlab.com)
devboy config set gitlab.url https://gitlab.com

# Set project ID (numeric ID or full path)
devboy config set gitlab.project_id group/project

# Store token in OS keychain
devboy config set-secret gitlab.token <token>

Configuration file

Settings are stored in ~/.config/devboy-tools/config.toml:

[gitlab]
url = "https://gitlab.com"
project_id = "group/project"

The token is stored separately in the OS keychain for security.

Self-hosted GitLab

For GitLab Enterprise or self-managed instances, set the url to your instance:

devboy config set gitlab.url https://gitlab.example.com
devboy config set gitlab.project_id my-group/my-project
devboy config set-secret gitlab.token <token>

MCP tools

Once configured, the following MCP tools are available:

Issue tools

ToolDescription
get_issuesList issues with filters (state, labels, assignee)
get_issueGet a single issue by key (e.g., gitlab#123)
get_issue_commentsGet all comments for an issue
create_issueCreate a new issue
update_issueUpdate an existing issue
add_issue_commentAdd a comment to an issue

Merge request tools

ToolDescription
get_merge_requestsList MRs with filters (state, author, labels, branches)
get_merge_requestGet a single MR by key (e.g., mr#123)
get_merge_request_discussionsGet code review discussions with resolution status
get_merge_request_diffsGet file diffs for a MR
create_merge_requestCreate a new merge request
create_merge_request_commentAdd a comment (general or inline code review)

CI/CD tools

ToolDescription
get_pipelineGet the latest pipeline for a branch or merge request, including job IDs and statuses
get_job_logsRead a job log in smart, search, paginated, or full mode
run_pipeline_jobStart an existing manual job after verifying its pipeline and current status

To start a manual job, first call get_pipeline and copy both IDs from its output:

devboy tools call get_pipeline '{"branch":"main","includeFailedLogs":false}'
devboy tools call run_pipeline_job '{"pipelineId":"501","jobId":"701"}'

Optional CI variables must have string values. GitLab 18.10 and later also accept typed jobInputs:

devboy tools call run_pipeline_job '{
  "pipelineId": "501",
  "jobId": "701",
  "variables": {
    "DEPLOY_ENV": "test"
  },
  "jobInputs": {
    "dry_run": true,
    "replicas": 2
  }
}'

run_pipeline_job fails closed: it fetches the job immediately before the write and refuses to call GitLab's /play endpoint when the job is missing, belongs to another pipeline, or is no longer in the manual state.

Output formats

All tools support three output formats via the format parameter:

  • markdown (default) - Human-readable with formatting
  • compact - Condensed format for limited context
  • json - Raw JSON data

Example:

{
  "key": "gitlab#123",
  "format": "json"
}

Testing

Verify your GitLab configuration:

devboy test gitlab

This will test the connection and display your GitLab user information.

Troubleshooting

"401 Unauthorized" error

  • Verify your token is copied correctly
  • Check that the token hasn't expired
  • Ensure the token has the required api scope

"404 Not Found" error

  • Verify the project ID or path is correct
  • Ensure the project exists and is accessible with your token
  • For paths with subgroups, use the full path (e.g., group/subgroup/project)

"403 Forbidden" error

  • Your token may lack the required scope
  • The project may have restricted API access
  • Check if your account has the necessary project permissions

Rate limiting

GitLab API has rate limits:

  • GitLab.com: 2,000 requests per minute for authenticated users
  • Self-hosted: depends on instance configuration
  • The tool will show a rate limit error if exceeded