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
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)

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