MCP server/version-control

Custom GitLab MCP Server

A custom implementation of the GitLab MCP server for AI assistants.

Din-djarin2/custom-gitlab ↗by Din-djarin2updated
Manual setup required. The maintainer's config contains paths only you know - edit the placeholders below before adding it to Claude Code.
1

Prepare the server locally

Run this once before adding it to Claude Code.

npm install
2

Register it in Claude Code

claude mcp add -e "GITLAB_PERSONAL_ACCESS_TOKEN=${GITLAB_PERSONAL_ACCESS_TOKEN}" -e "GITLAB_API_URL=${GITLAB_API_URL}" custom-gitlab -- node /path/to/custom-gitlab-server/index.js

Replace any placeholder paths in the command with the real path on your machine.

Required:GITLAB_PERSONAL_ACCESS_TOKENGITLAB_API_URL
3

Make your agent remember this setup

custom-gitlab's config, env vars, and the gotchas you hit — recalled in every future Claude Code, Cursor, and Codex session.

npx conare@latest

Free · one command · indexes the sessions already on disk. Set up in the browser instead →

What it does

  • Search GitLab repositories
  • Fetch and manage file contents
  • Create and update files with multi-file commit support
  • Manage GitLab issues and merge requests
  • Repository lifecycle management including forking and branching

Tools 9

search_repositoriesSearch for GitLab projects
get_file_contentsGet contents of a file or directory
create_or_update_fileCreate or update a single file
push_filesPush multiple files in a single commit
create_repositoryCreate a new GitLab project
create_issueCreate a new issue
create_merge_requestCreate a new merge request
fork_repositoryFork a project
create_branchCreate a new branch

Environment Variables

GITLAB_PERSONAL_ACCESS_TOKENrequiredPersonal Access Token with API scopes
GITLAB_API_URLrequiredThe base URL for your GitLab instance API

Try it

Search for all repositories in my GitLab account related to the project 'frontend-refactor'.
Create a new issue in the 'my-app' repository titled 'Fix login bug' with a description of the issue.
Read the contents of the README.md file in the main branch of the 'docs-repo' project.
Create a new branch named 'feature/new-ui' in the 'web-app' repository.
Push the updated index.html and styles.css files to the repository in a single commit.
Original README from Din-djarin2/custom-gitlab

Custom GitLab MCP Server

A custom implementation of the GitLab MCP (Model Context Protocol) server for integration with Claude and other MCP-compliant AI assistants.

Overview

This MCP server provides seamless integration with GitLab repositories, allowing AI assistants to:

  • Search GitLab repositories
  • Fetch file contents
  • Create or update files
  • Push multiple files in a single commit
  • Create issues and merge requests
  • Fork repositories
  • Create branches

Fixed Implementation

This custom implementation fixes issues with schema validation that were present in the standard GitLab MCP server implementation, specifically for the search_repositories tool.

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Configure in your Claude settings file or Claude Desktop config file:
    {
      "mcpServers": {
        "github.com/modelcontextprotocol/servers/tree/main/src/gitlab": {
          "command": "node",
          "args": [
            "/path/to/custom-gitlab-server/index.js"
          ],
          "env": {
            "GITLAB_PERSONAL_ACCESS_TOKEN": "your-gitlab-token",
            "GITLAB_API_URL": "https://your-gitlab-instance/api/v4"
          }
        }
      }
    }
    

Prerequisites

  • Node.js (v14 or higher)
  • GitLab Personal Access Token with appropriate scopes:
    • api for full API access
    • read_api for read-only access
    • read_repository and write_repository for repository operations

Available Tools

Tool Name Description
search_repositories Search for GitLab projects
get_file_contents Get contents of a file or directory
create_or_update_file Create or update a single file
push_files Push multiple files in a single commit
create_repository Create a new GitLab project
create_issue Create a new issue
create_merge_request Create a new merge request
fork_repository Fork a project
create_branch Create a new branch

License

MIT

Frequently Asked Questions

What are the key features of Custom GitLab?

Search GitLab repositories. Fetch and manage file contents. Create and update files with multi-file commit support. Manage GitLab issues and merge requests. Repository lifecycle management including forking and branching.

What can I use Custom GitLab for?

Automating repository documentation updates by having Claude read and write files directly.. Streamlining development workflows by creating issues and merge requests via natural language.. Managing multiple repository branches for feature development without leaving the chat interface.. Quickly searching through large GitLab project lists to find relevant codebases..

How do I install Custom GitLab?

Install Custom GitLab by running: npm install

What MCP clients work with Custom GitLab?

Custom GitLab works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Conare · memory for coding agents

Turn this server into reusable context

Keep Custom GitLab docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Set up free$npx conare@latest