- Home
- MCP servers
- GitLab MR
GitLab MR
- javascript
82
GitHub Stars
javascript
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"kopfrechner-gitlab-mr-mcp": {
"command": "node",
"args": [
"/path/to/gitlab-mr-mcp/index.js"
],
"env": {
"MR_MCP_GITLAB_HOST": "your_gitlab_host",
"MR_MCP_GITLAB_TOKEN": "your_gitlab_token",
"MR_MCP_MIN_ACCESS_LEVEL": "min_access_level",
"MR_MCP_PROJECT_SEARCH_TERM": "term"
}
}
}
}You can run a GitLab MR MCP server to let AI agents interact with GitLab merge requests and issues. It exposes tools to list projects, fetch MR details and comments, fetch diffs, add comments (including line-specific comments), manage issues, and update MR titles and descriptions. This enables automated workflows, review automation, and context-aware AI assistance around your GitLab projects.
How to use
Start by configuring your MCP client to connect to the GitLab MR MCP server. You will interact with the server through a standard MCP client, performing actions such as listing projects, retrieving merge request details and comments, and adding comments or diffs.
How to install
Prerequisites you need on your machine before installing this MCP server are Node.js, a GitLab access token with API access, and one or more GitLab project IDs.
Option 1 — Install via Smithery (recommended for Claude Desktop):
npx -y @smithery/cli@latest install @kopfrechner/gitlab-mr-mcp --client claude --config '"{\"gitlabMrMcpToken\":\"YOUR_GITLAB_TOKEN\", \"gitlabMrMcpHost\": \"YOUR_GITLAB_HOST\"}"'
Option 2 — Manual installation (local server):
Prerequisites: Node.js, a GitLab API access token, and access to your GitLab projects.
Steps to set up the MCP server locally:
# 1) Clone the repository
# (use your preferred method to obtain the source code)
# 2) Install dependencies
npm install
# 3) Run the MCP server via the MCP client configuration below
Note: Use the following MCP client configuration snippet to connect to this server. It defines how to start the server and which environment variables to provide.
Config snippet you can place in your MCP client configuration (environment variables can be adjusted to your setup):
{ "mcpServers": { "gitlab-mr-mcp": { "command": "node", "args": ["/path/to/gitlab-mr-mcp/index.js"], "env": { "MR_MCP_GITLAB_TOKEN": "your_gitlab_token", "MR_MCP_GITLAB_HOST": "your_gitlab_host" } } } }
## Additional content
Security notes: Ensure your GitLab token has only the scopes required for your use case (api, read\_api as needed) and restrict token access to trusted systems. When embedding tokens in configuration, prefer environment variables and avoid committing secrets to version control.
Troubleshooting: If you encounter permissions issues (403 Forbidden), verify that your GitLab token has the proper scopes, that the token user has access to the relevant projects, and that the project IDs you intend to access are correct.
Development tips: You can run an inspector for development and testing with the following command to start MCP client integration tooling.
export MR_MCP_GITLAB_TOKEN=your_gitlab_token export MR_MCP_GITLAB_HOST=your_gitlab_host
Optional filters for development
export MR_MCP_MIN_ACCESS_LEVEL=min_access_level export MR_MCP_PROJECT_SEARCH_TERM=term
npx -y @modelcontextprotocol/inspector npm start
## Available tools
### get\_projects
Retrieves a list of GitLab projects accessible with your token.
### list\_open\_merge\_requests
Lists all open merge requests for a specified GitLab project.
### get\_merge\_request\_details
Fetches detailed information about a specific merge request.
### get\_merge\_request\_comments
Fetches comments from a specific merge request, including discussion and diff notes.
### add\_merge\_request\_comment
Adds a general comment to a merge request.
### add\_merge\_request\_diff\_comment
Adds a comment to a specific line in a file within a merge request diff.
### get\_merge\_request\_diff
Retrieves the diff for a merge request.
### get\_issue\_details
Fetches detailed information about a specific issue.
### set\_merge\_request\_title
Updates the title of a merge request.
### set\_merge\_request\_description
Updates the description of a merge request.