The GitLab MCP Server is an API for managing projects and performing file operations on the GitLab platform, providing a streamlined interface for Git tasks.
To begin using it, generate a Personal Access Token in your GitLab account settings. Then, configure your Claude Desktop application with this token and your GitLab API URL. You can then utilize its endpoints for tasks like project creation and file management.
Key features include automatic branch creation during file operations, comprehensive error handling with clear messages, accurate Git history preservation without force pushes, and support for both single and batch file operations.
Common use cases are programmatic repository management, automating file updates across multiple projects, and facilitating team collaboration through issue and merge request management.
For a Personal Access Token, navigate to User Settings > Access Tokens on GitLab. Be aware of potential API rate limits based on your account tier. The server also works with self-hosted GitLab instances by setting the GITLAB_API_URL environment variable.
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>",
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}