Enables comprehensive GitLab repository integration including monitoring documentation changes, reading file contents, managing issues and merge requests, tracking commits, accessing wikis, and searching across projects. Supports both GitLab.com and self-hosted instances.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitLab MCP Serverlist recent commits in the docs folder for project 12345"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GitLab MCP Server for AgenticLedger
A Model Context Protocol (MCP) server that enables AI agents to interact with GitLab repositories, monitor documentation changes, and manage issues and merge requests.
Overview
This MCP server provides comprehensive GitLab integration for the AgenticLedger platform, enabling AI agents to:
Monitor Documentation Changes: Track commits, compare branches, and detect file modifications
Read Repository Contents: Access files, directory structures, and wiki pages
Manage Issues & MRs: Create and track issues, merge requests, and comments
Search Across GitLab: Find projects, code, commits, and more
Authentication Pattern
API Key (Direct Personal Access Token)
Token Format
GitLab Personal Access Token (PAT) with appropriate scopes:
read_api- For read-only operationsread_repository- For file accessapi- For full access (issues, MRs, wikis)
Creating a Token
Go to GitLab > Settings > Access Tokens
Create a new token with required scopes
Copy the token (starts with
glpat-)
Installation
Configuration
For Claude Code / MCP Clients
Add to your MCP configuration:
Environment Variables
Variable | Required | Default | Description |
| No |
| GitLab API base URL (for self-hosted instances) |
Available Tools
Project Operations
gitlab_search_projects
Description: Search for GitLab projects by name or description.
Parameters:
accessToken(string, required): GitLab Personal Access Tokensearch(string, required): Search querypage(number, optional): Page numberper_page(number, optional): Results per page (1-100)
Example:
gitlab_get_project
Description: Get detailed project information.
Parameters:
accessToken(string, required): GitLab PATproject_id(string, required): Project ID or URL-encoded path
gitlab_list_group_projects
Description: List all projects in a group.
Parameters:
accessToken(string, required): GitLab PATgroup_id(string, required): Group ID or pathinclude_subgroups(boolean, optional): Include subgroup projectssearch(string, optional): Filter by nameorder_by(string, optional): Sort fieldsort(string, optional): asc or desc
File Operations
gitlab_get_file_contents
Description: Read file contents from a repository. Essential for documentation monitoring.
Parameters:
accessToken(string, required): GitLab PATproject_id(string, required): Project IDfile_path(string, required): Path to file (e.g., "docs/README.md")ref(string, optional): Branch, tag, or commit SHA
Response:
gitlab_get_tree
Description: List files and directories in a repository path.
Parameters:
accessToken(string, required): GitLab PATproject_id(string, required): Project IDpath(string, optional): Directory pathref(string, optional): Branch/tag/SHArecursive(boolean, optional): List recursively
gitlab_create_or_update_file
Description: Create or update a file with a commit.
Parameters:
accessToken(string, required): GitLab PATproject_id(string, required): Project IDfile_path(string, required): Target file pathbranch(string, required): Target branchcontent(string, required): File contentcommit_message(string, required): Commit message
Commit Operations (Critical for Monitoring)
gitlab_list_commits
Description: List recent commits. Primary tool for detecting documentation changes.
Parameters:
accessToken(string, required): GitLab PATproject_id(string, required): Project IDref_name(string, optional): Branch or tagsince(string, optional): ISO 8601 dateuntil(string, optional): ISO 8601 datepath(string, optional): Filter by file pathauthor(string, optional): Filter by author emailwith_stats(boolean, optional): Include stats
Example - Monitor docs folder:
gitlab_get_commit_diff
Description: Get file changes for a specific commit.
Parameters:
accessToken(string, required): GitLab PATproject_id(string, required): Project IDsha(string, required): Commit SHA
gitlab_compare
Description: Compare two branches/tags/commits.
Parameters:
accessToken(string, required): GitLab PATproject_id(string, required): Project IDfrom(string, required): Source refto(string, required): Target ref
Activity Monitoring
gitlab_get_project_events
Description: Get recent project activity. Best tool for real-time monitoring.
Parameters:
accessToken(string, required): GitLab PATproject_id(string, required): Project IDaction(string, optional): Filter by action type (pushed, commented, etc.)target_type(string, optional): Filter by target (issue, merge_request, etc.)after(string, optional): Events after this date (ISO 8601)before(string, optional): Events before this date
Example - Monitor push events:
Issue Operations
gitlab_list_issues
List project issues with filtering.
gitlab_get_issue
Get specific issue details.
gitlab_create_issue
Create a new issue.
gitlab_list_issue_notes
List comments on an issue.
Merge Request Operations
gitlab_list_merge_requests
List MRs with filtering.
gitlab_get_merge_request
Get MR details.
gitlab_get_merge_request_changes
Get file changes in an MR.
gitlab_create_merge_request
Create a new MR.
Wiki Operations
gitlab_list_wiki_pages
List all wiki pages.
gitlab_get_wiki_page
Get wiki page content.
gitlab_create_wiki_page
Create a wiki page.
gitlab_update_wiki_page
Update a wiki page.
Search Operations
gitlab_search
Description: Search across GitLab.
Parameters:
accessToken(string, required): GitLab PATsearch(string, required): Search queryscope(string, optional): projects, issues, merge_requests, blobs, commits, etc.project_id(string, optional): Limit to projectgroup_id(string, optional): Limit to group
Response Format
All tools return a standardized response:
Success Example:
Error Example:
Testing
Use Case: Documentation Monitoring
This is the primary use case for this MCP server. Here's how to monitor a customer's documentation repo:
Workflow
Initial Scan: Use
gitlab_get_treeto discover documentation filesMonitor Changes: Periodically call
gitlab_get_project_eventsorgitlab_list_commitsFetch Updates: When changes detected, use
gitlab_get_file_contentsto read updated filesProcess: Feed updated content to your D7 data pipeline
Example Monitoring Script
Platform Integration Notes
Self-Hosted GitLab
Set GITLAB_API_URL to your instance:
Rate Limits
GitLab has rate limits:
Authenticated: 2000 requests/minute
Consider pagination for large datasets
Use
sincefilters to reduce response size
Token Scopes
Minimum required scopes:
Operation | Required Scope |
Read files |
|
Read issues/MRs |
|
Create issues/MRs |
|
Write files |
|
License
MIT
Contributing
Fork the repository
Create a feature branch
Make changes
Run tests
Submit a pull request
Support
For issues, please file a GitHub issue at: https://github.com/oregpt/Agenticledger_MCP_Gitlab/issues