GitLab MCP Server logo

GitLab MCP Server

by modelcontextprotocol

The GitLab MCP Server enables project management, file operations, and more through the GitLab API. It facilitates interaction with GitLab repositories programmatically.

View on GitHub

Last updated: N/A

What is GitLab MCP Server?

This server is a Model Context Protocol (MCP) server designed to interface with the GitLab API. It provides a set of standardized tools for automating various GitLab operations, such as file management, project creation, issue tracking, and merge request handling.

How to use GitLab MCP Server?

To use this server, you need a GitLab Personal Access Token with appropriate permissions (api, read_api, read_repository, write_repository). Configure the server within your claude_desktop_config.json using either Docker or NPX, providing the token and optionally the GitLab API URL (for self-hosted instances). Then call the exposed tools.

Key features of GitLab MCP Server

  • Automatic Branch Creation

  • Comprehensive Error Handling

  • Git History Preservation

  • Batch Operations

Use cases of GitLab MCP Server

  • Automating file creation and updates in GitLab projects.

  • Programmatically managing project repositories.

  • Creating and managing issues and merge requests.

  • Searching for repositories and obtaining file contents.

FAQ from GitLab MCP Server

What is a GitLab Personal Access Token?

A Personal Access Token allows you to interact with the GitLab API without using your username and password directly.

What permissions are required for the token?

The token should have scopes like api (full API access), read_api (read only api access), read_repository, and write_repository depending on your use case.

How do I setup this server?

You can set it up using Docker or NPX as outlined in the README, after generating the personal access token.

What is the purpose of the GITLAB_API_URL environment variable?

The GITLAB_API_URL variable is used to specify the base URL for the GitLab API, particularly useful for self-hosted GitLab instances.

What operations does this tool support?

This tool supports most basic repository functions, such as create_repository, push_files, create_merge_request, create_issue and more advanced file interaction using simple commands.