GitLab

by martijndormans

Not rated
GitHub

About

Manage GitLab projects, files, and repositories using the GitLab API.

Details

Author
martijndormans
Categories
Developer Tools, Other

Setup

Install GitLab in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/martijndormans/mcp-gitlab

Follow the installation instructions in the repository README, then restart your MCP client.

🚀 MCP Server for the GitLab API, enabling project management, file operations, and more.

- 🌿 Automatic Branch Creation: When creating/updating files or pushing changes, branches are automatically created if they don't exist
- 🛡️ Comprehensive Error Handling: Clear error messages for common issues
- 📚 Git History Preservation: Operations maintain proper Git history without force pushing
- 📦 Batch Operations: Support for both single-file and multi-file operations

- Create or update a single file in a project
- Inputs:

- project_id(string): Project ID or URL-encoded path
- file_path(string): Path where to create/update the file
- content(string): Content of the file
- commit_message(string): Commit message
- branch(string): Branch to create/update the file in
- previous_path(optional string): Path of the file to move/rename

- Push multiple files in a single commit
- Inputs:

- project_id(string): Project ID or URL-encoded path
- branch(string): Branch to push to
- files(array): Files to push, each withfile_pathandcontent
- commit_message(string): Commit message

- Search for GitLab projects
- Inputs:

- search(string): Search query
- page(optional number): Page number for pagination
- per_page(optional number): Results per page (default 20)

- Create a new GitLab project
- Inputs:

- name(string): Project name
- description(optional string): Project description
- visibility(optional string): 'private', 'internal', or 'public'
- initialize_with_readme(optional boolean): Initialize with README

- Get contents of a file or directory
- Inputs:

- project_id(string): Project ID or URL-encoded path
- file_path(string): Path to file/directory
- ref(optional string): Branch/tag/commit to get contents from

- Create a new issue
- Inputs:

- project_id(string): Project ID or URL-encoded path
- title(string): Issue title
- description(optional string): Issue description
- assignee_ids(optional number[]): User IDs to assign
- labels(optional string[]): Labels to add
- milestone_id(optional number): Milestone ID

- Create a new merge request
- Inputs:

- project_id(string): Project ID or URL-encoded path
- title(string): MR title
- description(optional string): MR description
- source_branch(string): Branch containing changes
- target_branch(string): Branch to merge into
- draft(optional boolean): Create as draft MR
- allow_collaboration(optional boolean): Allow commits from upstream members

- Get a merge request information of the difference in a raw format
- Inputs:

- project_id(string): Project ID or URL-encoded path
- merge_request_id(string): ID of the merge request

- Fork a project
- Inputs:

- project_id(string): Project ID or URL-encoded path
- namespace(optional string): Namespace to fork to

- Create a new branch
- Inputs:

- project_id(string): Project ID or URL-encoded path
- branch(string): Name for new branch
- ref(optional string): Source branch/commit for new branch

- Retrieve the logs from a job
- Inputs:

- project_id(string): Project ID or URL-encoded path
- job_id(string): ID of the job

Create a GitLab Personal Access Tokenwith appropriate permissions:

- Go to User Settings > Access Tokens in GitLab
- Select the required scopes:

- apifor full API access
- read_apifor read-only access
- read_repositoryandwrite_repositoryfor repository operations

Add the following to yourclaude_desktop_config.json:

{ "mcpServers": { "gitlab": { "command": "docker", "args": [ "run", "--rm", "-i", "-e", "GITLAB_PERSONAL_ACCESS_TOKEN", "-e", "GITLAB_API_URL", "mcp/gitlab" ], "env": { "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>", "GITLAB_API_URL": "https://gitlab.com/api/v4" // Optional, for self-hosted instances } } } }
{ "mcpServers": { "gitlab": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-gitlab"], "env": { "GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>", "GITLAB_API_URL": "https://gitlab.com/api/v4" // Optional, for self-hosted instances } } } }
docker build -t vonwig/gitlab:mcp -f src/gitlab/Dockerfile .

- GITLAB_PERSONAL_ACCESS_TOKEN: Your GitLab personal access token (required)
- GITLAB_API_URL: Base URL for GitLab API (optional, defaults tohttps://gitlab.com/api/v4)

Creates commit messages from staged files in a local git repository.

An MCP server for interacting with the AtomGit API for version control and code hosting.

A portable MCP server for performing various GitHub operations on any repository.

Manage Forgejo repositories and execute commands through an MCP-compatible chat interface.

Integrates with the Gerrit code review system to review code changes and details.

Make git commits on behalf of AI to track AI contributions in your codebase.

Performs deep, file-level forensics on Git repositories to analyze file histories, changes, and patterns.

Interact with the GitHub API for file operations, repository management, and search.

Manage GitHub repositories using a personal access token via CLI or environment variables.

Allows AI assistants to interact with the GitHub API for repository management, code collaboration, and other development tasks.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.