GitLab MCP Server

GitLab MCP Server

gitlab-mcp-server-piatra-automation•bypiatra-automation

An MCP server that lets AI assistants manage GitLab projects, issues, merge requests, files, labels, milestones, and time tracking through a set of exposed tools.

License: MIT•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Creates, updates, deletes, forks, and searches GitLab projects, including creating projects within group namespaces.
  • •Fetches file contents and creates or updates files, including committing multiple files at once.
  • •Manages issues, including filtering, updating attributes, closing and reopening, time tracking, comments, labels, milestones, assignments, and issue links.
  • •Supports creating branches and merge requests in GitLab repositories.

BEST FOR

  • •AI assistants that need to manage GitLab projects, issues, and merge requests programmatically.
  • •Teams tracking time estimates and spent time on GitLab issues through an AI assistant.
  • •Workflows that need to create or update repository files and commit multiple files in GitLab via MCP tools.

ABOUT GITLAB-MCP-SERVER-PIATRA-AUTOMATION

GitLab MCP Server is cataloged as an MCP server attributed to piatra-automation. An MCP server that lets AI assistants manage GitLab projects, issues, merge requests, files, labels, milestones, and time tracking through a set of exposed tools. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for GitLab MCP Server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can it connect to a self-hosted GitLab instance?

Yes. A custom GitLab API URL can be set through GITLAB_API_URL; otherwise it defaults to gitlab.com's API.

What does this implementation add compared with the original GitLab MCP server?

It adds comprehensive API endpoints such as project deletion and updates, time tracking, notes, label and milestone management, user assignment, and issue relationships.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 0d742783c386 · 采集于 2026-11-13 10:48:16 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

GitLab MCP Server

A Model Context Protocol (MCP) server for interacting with GitLab repositories with enhanced functionality.

Overview

This MCP server allows AI assistants (like Claude) to interact with GitLab repositories, manage projects, issues, merge requests, and more. It extends the original implementation with additional endpoints and improved error handling.

Features

  • Project Management

    • Create new repositories (with improved group namespace support)
    • Update project settings (including visibility)
    • Delete projects
    • Fork projects
    • Search for repositories
  • File Operations

    • Fetch file contents
    • Create or update files
    • Commit multiple files at once
  • Repository Management

    • Create branches
    • Create issues
    • Create merge requests
  • Issues and Time Tracking

    • Get issues with filtering options
    • Get detailed issue information
    • Manage time tracking (estimates and spent time)
    • View time tracking statistics
    • Update issue attributes
    • Close and reopen issues
  • Notes (Comments)

    • Retrieve issue comments
    • Create new comments
    • Update existing comments
    • Delete comments
  • Label Management

    • Get project labels
    • Create, update, and delete labels
    • Add labels to issues
    • Remove labels from issues
  • Milestone Management

    • Get project milestones
    • Create new milestones
  • User Assignment

    • Assign users to issues
    • Remove assignees from issues
  • Issue Relationships

    • Create links between issues
    • Delete issue links

Installation

Global Installation

npm install -g @piatra-open-source/gitlab-mcp-server

Project Installation

npm install @piatra-open-source/gitlab-mcp-server

Usage

Environment Variables

You need to set the following environment variables:

  • GITLAB_PERSONAL_ACCESS_TOKEN: Your GitLab personal access token with appropriate permissions
  • GITLAB_API_URL (optional): Custom GitLab API URL if not using gitlab.com (defaults to 'https://gitlab.com/api/v4')

Running the Server

export GITLAB_PERSONAL_ACCESS_TOKEN='your_token_here'
gitlab-mcp-server

Or in your application:

import { execFileSync } from 'child_process';
import { join } from 'path';

// Path to the GitLab MCP Server binary
const serverPath = join(require.resolve('@piatra-open-source/gitlab-mcp-server'), '..', '..', 'bin', 'gitlab-mcp-server');

// Start the server
const childProcess = execFileSync(serverPath, {
  env: {
    ...process.env,
    GITLAB_PERSONAL_ACCESS_TOKEN: 'your_token_here'
  }
});

API Reference

Functions

Function NameDescription
create_repositoryCreate a new GitLab project
update_projectUpdate project settings including visibility
delete_projectDelete a GitLab project
search_repositoriesSearch for GitLab projects
get_file_contentsGet file or directory contents
create_or_update_fileCreate or update a single file
push_filesCommit multiple files at once
create_branchCreate a new branch
fork_repositoryFork a project
create_issueCreate a new issue
create_merge_requestCreate a new merge request
get_issuesGet issues from a project with filtering options
get_issueGet a single issue with details
get_issue_time_statsGet time tracking statistics for an issue
set_time_estimateSet time estimate for an issue
reset_time_estimateReset time estimate for an issue
add_spent_timeAdd spent time to an issue
reset_spent_timeReset spent time for an issue
get_notesGet comments/notes for an issue
create_noteCreate a comment on an issue
update_noteUpdate an existing comment
delete_noteDelete a comment from an issue
update_issueUpdate various issue attributes
close_issueClose an issue
reopen_issueReopen a closed issue
get_project_labelsRetrieve all labels for a project
create_project_labelCreate a new label for a project
update_project_labelUpdate an existing label
delete_project_labelDelete a label from a project
add_labels_to_issueAdd specific labels to an issue
remove_labels_from_issueRemove specific labels from an issue
get_project_milestonesRetrieve all milestones for a project
create_project_milestoneCreate a new milestone for a project
assign_issueAssign users to an issue
unassign_issueRemove all assignees from an issue
create_issue_linkCreate a link between two issues
delete_issue_linkRemove a link between issues

Example Usage

// Example: Create a repository in a specific group
const repo = await claude.callMcp("gitlab", "create_repository", {
  name: "my-new-project",
  description: "A new project created via MCP",
  visibility: "private",
  initialize_with_readme: true,
  namespace_id: "12345678"  // Group ID where the project should be created
});

// Example: Change project visibility
const updatedRepo = await claude.callMcp("gitlab", "update_project", {
  project_id: "12345678",
  visibility: "private"
});

// Example: Delete a project
const deleteResult = await claude.callMcp("gitlab", "delete_project", {
  project_id: "12345678"
});

// Example: Get all issues with time tracking stats
const issues = await claude.callMcp("gitlab", "get_issues", {
  project_id: "12345678",
  state: "opened",
  with_time_stats: true
});

// Example: Add spent time to an issue
const timeStats = await claude.callMcp("gitlab", "add_spent_time", {
  project_id: "12345678", 
  issue_iid: 42,
  duration: "1h 30m" // Format: Xh Ym
});

// Example: Get all comments on an issue
const notes = await claude.callMcp("gitlab", "get_notes", {
  project_id: "12345678",
  issue_iid: 42,
  sort: "desc",
  order_by: "created_at"
});

// Example: Update an issue
const updatedIssue = await claude.callMcp("gitlab", "update_issue", {
  project_id: "12345678",
  issue_iid: 42,
  title: "Updated issue title",
  description: "This is the updated description"
});

// Example: Create a label
const newLabel = await claude.callMcp("gitlab", "create_project_label", {
  project_id: "12345678",
  name: "enhancement",
  color: "#428BCA",
  description: "Enhancement requests"
});

// Example: Add labels to an issue
const issueWithLabels = await claude.callMcp("gitlab", "add_labels_to_issue", {
  project_id: "12345678",
  issue_iid: 42,
  labels: ["bug", "enhancement"]
});

// Example: Create a milestone
const milestone = await claude.callMcp("gitlab", "create_project_milestone", {
  project_id: "12345678",
  title: "v1.0 Release",
  description: "First stable release",
  due_date: "2025-06-30"
});

// Example: Assign users to an issue
const assignedIssue = await claude.callMcp("gitlab", "assign_issue", {
  project_id: "12345678",
  issue_iid: 42,
  assignee_ids: [123, 456]
});

// Example: Create a link between issues
const issueLink = await claude.callMcp("gitlab", "create_issue_link", {
  project_id: "12345678",
  issue_iid: 42,
  target_project_id: "12345678",
  target_issue_iid: 43,
  link_type: "relates_to"
});

Improvements Over Original Implementation

This implementation includes several enhancements over the original MCP GitLab server:

  1. Comprehensive API endpoints:

    • delete_project: Properly delete GitLab projects
    • update_project: Update project settings including visibility
    • get_issues & get_issue: Retrieve issues with filtering options
    • Time tracking endpoints: Set/reset estimates and spent time
    • Notes endpoints: Create, read, update, delete comments
    • Label management: Create, retrieve, update, and delete labels
    • Milestone management: Get milestones and create new ones
    • User assignment: Assign and unassign users to/from issues
    • Issue relationships: Create and delete links between issues
  2. Fixed namespace_id handling:

    • Properly supports creating projects in group namespaces
    • Validates and passes namespace_id to the GitLab API
  3. Enhanced error handling:

    • Detailed error messages including API response data
    • Improved validation of input parameters
    • Better feedback on authentication and permission issues
  4. Updated documentation:

    • Clear documentation of all supported parameters
    • More complete type definitions

Troubleshooting

"file_path should be a valid file path" Error

If you encounter the error GitLab API error (400): Bad Request - file_path should be a valid file path, there are several possible causes:

  1. File Path Format: GitLab expects file paths to be valid and properly formatted. Make sure your file path:

    • Does not contain invalid characters like *, ?, [, ] etc.
    • Uses forward slashes (/) not backslashes (\)
    • Is properly URL-encoded (handled by this library)
  2. Case Sensitivity: GitLab file paths are case-sensitive. Ensure your paths match the exact case of existing files.

  3. Repository Structure: The file path must exist in the repository structure for updates, or be valid for new files.

  4. Special Characters: Avoid using special characters in file names when possible. If you need to use characters like #, ?, [, ], be aware that they might require special handling.

Other Common Issues

  • Authentication Failures: Make sure your GITLAB_PERSONAL_ACCESS_TOKEN has the necessary permissions.
  • Permission Denied: Ensure you have proper access rights to the repository and group.
  • Rate Limiting: GitLab API has rate limits that may temporarily block your access if exceeded.

License

MIT

Attribution

This project is an enhanced version of the original Model Context Protocol GitLab server by Anthropic, modified and extended under the MIT license.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for GitLab MCP Server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/gitlab-mcp-server-piatra-automation)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools