Sign inSign up

hackerdogs/gitlab-mcp

By hackerdogs

•Updated 4 months ago

GitLab MCP Server

Image
0

222

hackerdogs/gitlab-mcp repository overview

Hackerdogs
hackerdogs ⁠

⁠GitLab MCP Server

MCP server wrapper for GitLab⁠ — manage repositories, issues, merge requests, and CI/CD pipelines via the GitLab API using the @zereight/mcp-gitlab npm package. See zereight/mcp-gitlab⁠ for full documentation.

⁠What is GitLab MCP?

@zereight/mcp-gitlab is an MCP server that wraps the GitLab REST API, giving AI assistants the ability to list and create issues, review and merge MRs, inspect pipeline status, browse repository file trees, and read file contents — all authenticated with a GitLab personal access token. It supports both gitlab.com and self-hosted GitLab instances via the GITLAB_URL environment variable.

Personal access token required — create one at GitLab Settings → Access Tokens with api scope and set GITLAB_PERSONAL_ACCESS_TOKEN.

⁠Tools Reference

ToolDescription
merge_merge_requestMerge Merge Request
approve_merge_requestApprove Merge Request
unapprove_merge_requestUnapprove Merge Request
get_merge_request_approval_stateGet Merge Request Approval State
get_merge_request_conflictsGet Merge Request Conflicts
list_merge_request_pipelinesList Merge Request Pipelines
create_or_update_fileCreate Or Update File
search_repositoriesSearch Repositories
create_repositoryCreate Repository
create_groupCreate Group
get_file_contentsGet File Contents
push_filesPush Files
create_issueCreate Issue
create_merge_requestCreate Merge Request
fork_repositoryFork Repository
create_branchCreate Branch
get_branchGet Branch
list_branchesList Branches
delete_branchDelete Branch
list_protected_branchesList Protected Branches
get_protected_branchGet Protected Branch
protect_branchProtect Branch
unprotect_branchUnprotect Branch
update_default_branchUpdate Default Branch
get_merge_requestGet Merge Request
get_merge_request_diffsGet Merge Request Diffs
list_merge_request_changed_filesList Merge Request Changed Files
list_merge_request_diffsList Merge Request Diffs
get_merge_request_file_diffGet Merge Request File Diff
list_merge_request_versionsList Merge Request Versions
get_merge_request_versionGet Merge Request Version
get_branch_diffsGet Branch Diffs
update_merge_requestUpdate Merge Request
create_noteCreate Note
create_merge_request_threadCreate Merge Request Thread
resolve_merge_request_threadResolve Merge Request Thread
mr_discussionsMr Discussions
delete_merge_request_discussion_noteDelete Merge Request Discussion Note
update_merge_request_discussion_noteUpdate Merge Request Discussion Note
create_merge_request_discussion_noteCreate Merge Request Discussion Note
create_merge_request_noteCreate Merge Request Note
delete_merge_request_noteDelete Merge Request Note
get_merge_request_noteGet Merge Request Note
get_merge_request_notesGet Merge Request Notes
update_merge_request_noteUpdate Merge Request Note
get_draft_noteGet Draft Note
list_draft_notesList Draft Notes
create_draft_noteCreate Draft Note
update_draft_noteUpdate Draft Note
delete_draft_noteDelete Draft Note
publish_draft_notePublish Draft Note
bulk_publish_draft_notesBulk Publish Draft Notes
list_merge_request_emoji_reactionsList Merge Request Emoji Reactions
list_merge_request_note_emoji_reactionsList Merge Request Note Emoji Reactions
create_merge_request_emoji_reactionCreate Merge Request Emoji Reaction
delete_merge_request_emoji_reactionDelete Merge Request Emoji Reaction
create_merge_request_note_emoji_reactionCreate Merge Request Note Emoji Reaction
delete_merge_request_note_emoji_reactionDelete Merge Request Note Emoji Reaction
update_issue_noteUpdate Issue Note
create_issue_noteCreate Issue Note
list_issue_emoji_reactionsList Issue Emoji Reactions
list_issue_note_emoji_reactionsList Issue Note Emoji Reactions
create_issue_emoji_reactionCreate Issue Emoji Reaction
delete_issue_emoji_reactionDelete Issue Emoji Reaction
create_issue_note_emoji_reactionCreate Issue Note Emoji Reaction
delete_issue_note_emoji_reactionDelete Issue Note Emoji Reaction
list_issuesList Issues
my_issuesMy Issues
get_issueGet Issue
update_issueUpdate Issue
update_issue_description_patchUpdate Issue Description Patch
delete_issueDelete Issue
list_todosList Todos
mark_todo_doneMark Todo Done
mark_all_todos_doneMark All Todos Done
list_issue_linksList Issue Links
list_issue_discussionsList Issue Discussions
get_issue_linkGet Issue Link
create_issue_linkCreate Issue Link
delete_issue_linkDelete Issue Link
list_namespacesList Namespaces
get_namespaceGet Namespace
verify_namespaceVerify Namespace
get_projectGet Project
list_projectsList Projects
update_projectUpdate Project
list_project_membersList Project Members
list_labelsList Labels
get_labelGet Label
create_labelCreate Label
update_labelUpdate Label
delete_labelDelete Label
list_group_projectsList Group Projects
get_repository_treeGet Repository Tree
validate_ci_lintValidate Ci Lint
validate_project_ci_lintValidate Project Ci Lint
list_ci_catalog_resourcesList Ci Catalog Resources
get_ci_catalog_resourceGet Ci Catalog Resource
list_merge_requestsList Merge Requests
get_usersGet Users
get_userGet User
whoamiWhoami
list_commitsList Commits
get_commitGet Commit
get_commit_diffGet Commit Diff
get_file_blameGet File Blame
list_commit_statusesList Commit Statuses
create_commit_statusCreate Commit Status
list_group_iterationsList Group Iterations
upload_markdownUpload Markdown
download_attachmentDownload Attachment
health_checkHealth Check
list_eventsList Events
get_project_eventsGet Project Events
discover_toolsDiscover Tools

⁠Example Prompts

Here are example prompts you can use with Claude (or any MCP client) when this tool is connected:

  • "List all open merge requests in my-group/my-project and summarize the changes."
  • "Show the status of the latest CI/CD pipeline for my-group/my-project on the main branch."
  • "Create a new issue in my-group/my-project titled 'Fix authentication timeout' with a description of the problem."
  • "Read the contents of src/main.py from the main branch of my-group/my-project."
  • "List all open issues labeled 'critical' in my-group/my-project."
  • "Show me the failed jobs in pipeline #12345 for my-group/my-project and explain the errors."

⁠Deploy

docker-compose up -d
⁠Docker Run (stdio mode)
docker run -i --rm \
  -e GITLAB_PERSONAL_ACCESS_TOKEN \
  hackerdogs/gitlab-mcp:latest
⁠Docker Run (HTTP streamable mode)
docker run -d -p 8642:8642 \
  -e MCP_TRANSPORT=streamable-http \
  -e MCP_PORT=8642 \
  -e GITLAB_PERSONAL_ACCESS_TOKEN \
  hackerdogs/gitlab-mcp:latest

⁠MCP Client Configuration

⁠Stdio mode (default)

Add to your Claude Desktop or Cursor MCP config:

{
  "mcpServers": {
    "gitlab-mcp": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "MCP_TRANSPORT",
        "-e",
        "GITLAB_PERSONAL_ACCESS_TOKEN",
        "hackerdogs/gitlab-mcp:latest"
      ],
      "env": {
        "MCP_TRANSPORT": "stdio",
        "GITLAB_PERSONAL_ACCESS_TOKEN": ""
      }
    }
  }
}
⁠HTTP mode (streamable-http)

First, start the server using Docker Compose or docker run with HTTP mode (see Deploy⁠ above), then point your MCP client at the running server:

{
  "mcpServers": {
    "gitlab-mcp": {
      "url": "http://localhost:8642/mcp"
    }
  }
}

When to use HTTP mode: HTTP mode is ideal for shared/remote deployments, multi-user setups, and Hackerdogs⁠ scheduled prompts. The server runs as a long-lived process and accepts connections from multiple MCP clients concurrently.

⁠Environment Variables

VariableDefaultDescription
MCP_TRANSPORTstdioTransport mode: stdio or streamable-http
MCP_PORT8642HTTP port (only used with streamable-http)
GITLAB_PERSONAL_ACCESS_TOKEN—GitLab personal access token with api scope

⁠Installing in Hackerdogs

The fastest way to get started is through Hackerdogs⁠:

  1. Log in to your Hackerdogs account.
  2. Go to the Tools Catalog.
  3. Search for the tool by name.
  4. Expand the tool card and click Install — you're ready to go.

Give it a couple of minutes to go live. Then start querying by asking Hackerdogs to use the tool explicitly. If you don't specify, Hackerdogs will automatically choose the best tool for the job.

  1. Vendor API key required? Add your key in the config environment variable field before clicking Install. Your key will be encrypted at rest.
  2. Enable / Disable the tool anytime from the Enabled Tools page.
  3. Need to update a key or parameter? Go to My Tools → toggle Show Decrypted Values → edit → Save.

Want to contribute or chat with the team? Join our Discord⁠.

⁠Build

docker build -t hackerdogs/gitlab-mcp:latest .

⁠Testing

⁠Automated tests
./test.sh
⁠Test directly with Docker

1. Start the server in HTTP mode:

docker run -d --rm --name gitlab-mcp-test -p 8642:8642 \
  -e MCP_TRANSPORT=streamable-http \
  -e GITLAB_PERSONAL_ACCESS_TOKEN \
  hackerdogs/gitlab-mcp:latest

2. Initialize the MCP session:

SESSION_ID=$(curl -s -D - -X POST http://localhost:8642/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1"}}}' \
  2>&1 | grep -i mcp-session-id | awk '{print $2}' | tr -d '\r\n')

curl -s -X POST http://localhost:8642/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "mcp-session-id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'

3. List available tools:

curl -s -X POST http://localhost:8642/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "mcp-session-id: $SESSION_ID" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

4. Clean up:

docker stop gitlab-mcp-test

Tag summary

Content type

Image

Digest

sha256:91227439d…

Size

108.9 MB

Last updated

4 months ago

docker pull hackerdogs/gitlab-mcp