HUB
Sign inSign up

alissonstocheroarq/gitlab-mcp

By alissonstocheroarq

•Updated 9 months ago

GitLab MCP Server. Connects AI Agents to GitLab via HTTP for managing Projects, Issues, and MRs.

Image
API management
Machine learning & AI
Developer tools
0

587

alissonstocheroarq/gitlab-mcp repository overview

⁠GitLab MCP (.NET) Server

This is a Model Context Protocol (MCP) Server designed to connect AI Agents and clients (like Claude Desktop, Cursor, and VS Code) to your GitLab infrastructure safely. It acts as a bridge, allowing your AI to interact seamlessly with GitLab APIs using a standard interface.

Built with .NET 9.0, this container uses an HTTP (Server-Sent Events) transport mechanism on the /api/mcp endpoint, making it highly compatible with modern networking and container-based tooling like the Docker MCP Toolkit.

Note: This server handles operations for GitLab Projects, Merge Requests, and Issues robustly.

⁠🚀 Features

  • MCP HTTP streamable: Available at /api/mcp endpoint.
  • GitLab Actions: Tools for reading projects, managing Merge Requests and interacting with Issues.
  • Secure Authentication: Requires your custom MCP_SERVER_API_KEY for client connection, and a GITLAB_TOKEN (provided globally or per-request).
  • Lightweight Image: Runs as a non-root user via an optimized ASP.NET Core Linux container.

To run the server in the background and bind it to localhost port 8080, run the following command. You need to provide a custom Secret API Key to secure the connection and, optionally, a default GitLab Private Token.

docker run -d -p 8080:8080 \
  -e ASNETCORE_URLS="http://+:8080" \
  -e MCP_SERVER_API_KEY="your_secure_secret_password" \
  -e GITLAB_TOKEN="your_personal_gitlab_token" \
  -e GITLAB_URL="https://gitlab.com" \
  --name gitlab-mcp-server \
  alissonstocheroarq/gitlab-mcp:0.2.0

💡 TIP for Multi-Client/Multi-User environments: If this server is going to be used by multiple different users or AI clients simultaneously, it is highly recommended NOT to set a global GITLAB_TOKEN environment variable on the backend container. Instead, leave it out of the arguments and require each user/client to securely pass their own Private Token in the X-GitLab-Token header. This ensures proper access control and audit logging in GitLab.

If no GITLAB_TOKEN is exported globally, clients must send the token via the X-GitLab-Token header on every request.

⁠🔌 Configuring MCP Clients

When the container is running locally, point your AI tools to the HTTP endpoint using your MCP_SERVER_API_KEY and GITLAB_TOKEN. For detailed code examples on how to inject mcp.json into VS Code, Cursor, Codex CLI, or GitHub Copilot, please check the Official Client Documentation on GitHub⁠.

⁠Supported Tools
  • get_projects
  • list_open_merge_requests
  • get_merge_request_details
  • get_merge_request_comments
  • add_merge_request_comment
  • add_merge_request_diff_comment
  • get_merge_request_diff
  • set_merge_request_title
  • set_merge_request_description
  • approve_merge_request
  • get_issue_details

⁠🔗 Source Code

The full source code, architecture details, and contribution guidelines are available on the repository: AlissonStochero/gitlab_mcp⁠.

Tag summary

Content type

Image

Digest

sha256:c5a6a6f64…

Size

90 MB

Last updated

9 months ago

docker pull alissonstocheroarq/gitlab-mcp:0.2