create_or_update_fileLABSCO SUMMARY
GitLab work without leaving the conversation.
The everyday moves — read a file, commit a change, open an issue, raise a merge request — happen where you were already describing them.
What it is
A GitLab API server covering file operations, issues, merge requests and project management. A write that targets a missing branch creates it, and history is preserved rather than force-pushed over.
What you get
- create_or_update_file commits a single file; push_files commits several in one commit
- get_file_contents reads a file or a directory at a branch, tag or commit you name
- create_issue opens an issue with assignee_ids, labels and a milestone_id
- create_merge_request opens an MR between a source_branch and a target_branch; get_merge_request_raw_diff returns the diff itself
- create_branch, fork_repository and create_repository cover the project-level moves
- search_repositories finds projects, paginated with per_page
- Branches are created automatically when a write targets one that is not there yet
Requirements
A GitLab account and an API token with access to the projects you want to work in.
Setup effort
Build from source — git clone https://github.com/martijndormans/mcp-gitlab.git
USE CASES
Committing a fix you just worked out
The change goes in as a real commit with a message, one file or several, without switching to a terminal.
Opening an issue while the details are fresh
Title, description, assignees, labels and milestone are set in the same breath as the discovery that prompted them.
Raising a merge request and reading its diff
The MR is opened between two branches and the raw diff comes back for review in the same session.
Reading a file from another branch
get_file_contents takes a ref, so comparing what is on main with what is on your branch does not need a checkout.
Finding the project you half-remember
A paginated project search across GitLab, so the right repository is located from a partial name.
Starting a branch for a piece of work
create_branch from an existing ref, or just write — the branch is created if it is missing.
11 tools
Listed in project docs. Your client may show a different list.
push_filessearch_repositoriescreate_repositoryget_file_contentscreate_issuecreate_merge_requestget_merge_request_raw_difffork_repositorycreate_branchget_job_logsBEFORE YOU INSTALL
What to know first
Tools you get
11 tools named in the project's documentation.
Requires
- node on PATH
- GITLAB_PERSONAL_ACCESS_TOKEN in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
You clone and build this one yourself.
Server setup
git clone https://github.com/martijndormans/mcp-gitlab.git
cd mcp-gitlab
npm install
npm run buildMCP Clients
Claude Desktop
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": [
"<YOUR_PATH_TO_MCP_GITLAB>/dist/index.js"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>",
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}<YOUR_PATH_TO_MCP_GITLAB> is the folder you cloned, and <YOUR_TOKEN> is a GitLab personal access token. GITLAB_API_URL only needs changing for a self-hosted GitLab.