home / mcp / gitlab mcp server
Provides GitLab integration for AI agents to monitor docs, read code, and manage issues/MRs across repositories.
Configuration
View docs{
"mcpServers": {
"oregpt-agenticledger_mcp_gitlab": {
"command": "node",
"args": [
"path/to/GitlabMCP/dist/index.js"
],
"env": {
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}You can run a GitLab MCP Server that lets AI agents read GitLab repositories, monitor documentation changes, and manage issues, merge requests, and wikis. This enables automated content tracking, repository exploration, and collaborative workflows driven by AI.
Use the GitLab MCP Server with an MCP client to perform project searches, read repository contents, monitor commits and project events, and manipulate issues, merge requests, and wiki pages. The server exposes a range of tools that you can call from your MCP client to perform these tasks and feed updated content into your data pipelines.
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": ["path/to/GitlabMCP/dist/index.js"],
"env": {
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}Configure your MCP client to use the GitLab MCP Server by providing the server configuration shown above. The server expects a GitLab Personal Access Token (PAT) with appropriate scopes for read and write operations as described in the token guidance. The API URL can be overridden with GITLAB_API_URL if you operate a self-hosted GitLab instance.
Create a GitLab PAT with the required scopes (read_api, read_repository, and api as needed). Keep tokens secret and rotate them regularly. Use the token only in secure environments and never expose it in client code or logs.
Use the client to perform tasks such as searching for projects, listing and inspecting files, tracking commits in a docs folder, reading updated documents, and working with issues and merge requests. The server supports a broad set of operations to cover monitoring, content access, and collaboration workflows.
If you encounter authentication errors, verify that your GitLab PAT has the necessary scopes and that GITLAB_API_URL points to the correct API endpoint for your instance. For rate limit issues, respect pagination and apply since/until filters to limit response sizes. Ensure your MCP client sends the correct token and target project identifiers.
Search for GitLab projects by name or description using a provided access token and optional paging parameters.
Retrieve detailed information about a specific GitLab project by ID or URL-encoded path.
List all projects within a specified group, with optional filtering and sorting.
Read the contents of a file from a repository to access documentation and other assets.
List files and directories in a repository path to explore project structure.
Create or update a file in a repository with a commit message.
List recent commits for a project, with optional filters such as path, author, and date range.
Get file changes for a specific commit to identify what was modified.
Compare two references (branches, tags, or commits) to see differences.
Fetch recent project activity events such as pushes and comments.
List issues in a project with optional filtering by state, labels, and assignee.
Retrieve details for a specific issue.
Create a new issue in a project.
List comments on a specific issue.
List merge requests with optional filtering by state, labels, and assignee.
Get detailed information on a merge request.
Obtain the file changes included in a merge request.
Create a new merge request in a project.
List all wiki pages in a project.
Get content of a specific wiki page.
Create a new wiki page.
Update an existing wiki page.
Search across GitLab projects, issues, merge requests, blobs, commits, and more.