Labsco
doozMen logo

GitLab CLI MCP Server

β˜… 1

from doozMen

Seamlessly integrate AI assistants with GitLab using the glab CLI tool.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

GitLab MCP Server (Swift)

A Model Context Protocol (MCP) server that wraps the GitLab CLI (glab) to provide GitLab functionality to AI assistants like Claude Desktop.

Features

  • πŸš€ Native Swift implementation using the official MCP Swift SDK
  • πŸ”§ Full GitLab CLI integration - supports all glab commands
  • 🎯 Smart prompts for common workflows (merge requests, CI/CD, daily standup)
  • πŸ“Š JSON output parsing with fallback to plain text
  • πŸ” Secure authentication via system glab credentials
  • ⚑ High performance with Swift's async/await concurrency

Authentication

The server uses your existing glab CLI authentication:

Copy & paste β€” that's it
# Login to GitLab
glab auth login

# Check authentication status
glab auth status

Available Tools

Core Tools

  • glab_mr - Merge request operations (list, create, view, merge, approve)
  • glab_issue - Issue management (list, create, view, close, update)
  • glab_ci - CI/CD pipeline operations (view, list, run, retry)
  • glab_repo - Repository operations (clone, fork, view, archive)
  • glab_api - Direct GitLab API access
  • glab_auth - Authentication management
  • glab_version - Version information
  • glab_raw - Execute any glab command directly

Prompts

The server includes intelligent prompts for common workflows:

  • my-mrs - Check your merge requests
  • create-mr - Create a merge request with guided parameters
  • daily-standup - Gather GitLab activity for daily standups
  • review-pipeline - Review CI/CD pipeline status

Development

Building from Source

Copy & paste β€” that's it
# Clone the repository
git clone https://github.com/yourusername/gitlab-mcp-swift.git
cd gitlab-mcp-swift

# Build in debug mode
swift build

# Run tests
swift test

# Build for release
swift build -c release

Project Structure

Copy & paste β€” that's it
gitlab-mcp-swift/
β”œβ”€β”€ Sources/
β”‚   └── GitLabMCP/
β”‚       β”œβ”€β”€ GitLabMCPServer.swift    # Main server implementation
β”‚       β”œβ”€β”€ GitLabMCPCommand.swift   # CLI entry point
β”‚       └── GitLabCLI.swift          # GitLab CLI wrapper
β”œβ”€β”€ Package.swift                     # Swift package manifest
β”œβ”€β”€ install.sh                        # Installation script
└── README.md                         # This file

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

License

MIT License - see LICENSE file for details

Acknowledgments