custom-gitlab-mcp-server

custom-gitlab-mcp-server

0

This project is a GitLab MCP server that allows integration with AI assistants to manage GitLab repositories. It offers tools to search projects, handle file operations, and manage issues and merge requests.

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 NameDescription
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

License

MIT