Skip to content

feat(duo claude): add MCP server integration for enhanced Claude Code functionality

Enables glab duo claude to automatically provide Claude Code with comprehensive knowledge of all glab commands and their parameters.

  • Automatic glab knowledge: Claude Code now understands all glab commands, their parameters, types, descriptions, and usage patterns
  • Rich parameter schemas: Each glab command is exposed with detailed JSON Schema including parameter types, descriptions, defaults, and constraints
  • Smart command classification: Read-only commands (list, view, status) are marked as safe while write operations (create, delete, merge) require confirmation
  • Zero configuration: Works automatically when launching glab duo claude with no additional setup required
  • Complete CLI coverage: Every glab command becomes available as a tool that Claude Code can use intelligently

This transforms the Claude Code experience by giving it deep knowledge of how to interact with GitLab through glab commands, enabling natural language GitLab workflows like "list all open issues assigned to me" or "show the latest pipeline status."

Implementation adds an MCP server (glab mcp serve) that dynamically introspects all glab commands and exposes them with proper schemas, automatically configured when launching Claude Code.

Examples

~/projects/cli$ glab duo claude
╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                         │
│                                                   │
│   /help for help, /status for your current setup  │
│                                                   │
│   cwd: /Users/josephburnett/projects/cli          │
│                                                   │
│   ─────────────────────────────────────────────── │
│                                                   │
│   Overrides (via env):                            │
│                                                   │
│   • API Base URL:                                 │
│   https://cloud.gitlab.com/ai/v1/proxy/anthropic  │
╰───────────────────────────────────────────────────╯

> /mcp
╭─────────────────────────────────────────────────────────────────────────────╮
│ Glab MCP Server                                                             │
│                                                                             │
│ Status: ✔ connected                                                         │
│ Command: /Users/josephburnett/bin/glab                                      │
│ Args: mcp serve                                                             │
│ Config location: Dynamically configured                                     │
│ Capabilities: tools                                                         │
│ Tools: 158 tools                                                            │
│                                                                             │
│ ❯ 1. View tools                                                             │
│   2. Reconnect                                                              │
╰─────────────────────────────────────────────────────────────────────────────╯
> Do I have any open merge requests?

⏺ glab - glab_mr_list (MCP)(output: "text")
  ⎿  Showing 30 open merge requests on gitlab-org/cli. (Page 1)

     !2361      gitlab-org/cli!2361     Add MCP server integration for enhanced Clau
     … +66 lines (ctrl+r to expand)

⏺ Yes, you have one open merge request:

  !2361 - Add MCP server integration for enhanced Claude Code functionality

  (main) ← (jburnett/glab-mcp)

╭────────────────────────────────────────────────────────────────────────────────────╮
│ >                                                                                  │
╰────────────────────────────────────────────────────────────────────────────────────╯

Knows all the command details.

> /mcp
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ glab_mr_list (glab) [open-world]                                                                              │
│                                                                                                               │
│ Tool name: glab_mr_list                                                                                       │
│ Full name: mcp__glab__glab_mr_list                                                                            │
│                                                                                                               │
│ Description:                                                                                                  │
│ List merge requests.                                                                                          │
│                                                                                                               │
│ Parameters:                                                                                                   │
│   • all: boolean - Get all merge requests.                                                                    │
│   • assignee: array - Get only merge requests assigned to users.                                              │
│   • author: string - Filter merge request by author <username>.                                               │
│   • closed: boolean - Get only closed merge requests.                                                         │
│   • draft: boolean - Filter by draft merge requests.                                                          │
│   • group: string - Select a group/subgroup. This option is ignored if a repo argument is set.                │
│   • label: array - Filter merge request by label <name>.                                                      │
│   • merged: boolean - Get only merged merge requests.                                                         │
│   • milestone: string - Filter merge request by milestone <id>.                                               │
│   • not_draft: boolean - Filter by non-draft merge requests.                                                  │
│   • not_label: array - Filter merge requests by not having label <name>.                                      │
│   • order: string - Order merge requests by <field>. Order options: created_at, title, merged_at or           │
│   updated_at.                                                                                                 │
│   • output: string - Format output as: text, json.                                                            │
│   • page: number - Page number.                                                                               │
│   • per_page: number - Number of items to list per page.                                                      │
│   • repo: string - Select another repository. Can use either `OWNER/REPO` or `GROUP/NAMESPACE/REPO` format.   │
│   Also accepts full URL or Git URL.                                                                           │
│   • reviewer: array - Get only merge requests with users as reviewer.                                         │
│   • search: string - Filter by <string> in title and description.                                             │
│   • sort: string - Sort merge requests by <field>. Sort options: asc, desc.                                   │
│   • source_branch: string - Filter by source branch <name>.                                                   │
│   • target_branch: string - Filter by target branch <name>.                                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────

How has this been tested?

  • Verified glab duo claude automatically configures MCP integration
  • Tested Claude Code can intelligently use glab commands:
    • glab_repo_view - Shows detailed repository information with proper parameter understanding
    • glab_issue_list - Lists issues with pagination and filtering options
    • glab_ci_list - Shows CI pipelines with all available parameters
    • glab_mr_list - Lists merge requests with rich parameter schemas
    • glab_version - Shows version information
  • Confirmed Claude Code understands parameter types, descriptions, and constraints
  • Verified command classification correctly identifies safe vs destructive operations
  • Tested error handling for invalid parameters and failed commands
Edited by Joe Burnett

Merge request reports

Loading