GitLab
β¨ Features
- Comprehensive GitLab API Integration - Access repositories, issues, merge requests, wikis, and more
- Both Transports Supported - Use with stdio or Server-Sent Events (SSE)
- Consistent Response Formatting - Standardized pagination and response structures
- Strong TypeScript Typing - Built with the MCP SDK for type safety
- Complete Documentation - Examples for all available tools
π Supported Operations
- Repository Management - Search, create, fork repositories
- File Handling - Read, create, update files
- Branch Operations - Create and manage branches
- Issue Tracking - Create, list, filter issues
- Merge Requests - Create, list, review merge requests
- Group Management - List group projects and members
- Project Activity - Track events and commit history
- Wiki Management - Full support for project and group wikis with attachments
- Member Management - List and manage project/group members
π Getting Started
Installation
From npm (Recommended)
npm install @yoda.digital/gitlab-mcp-server
From Source
# Clone the repository
git clone https://github.com/yoda-digital/mcp-gitlab-server.git
cd mcp-gitlab-server
# Install dependencies
npm install
# Build the project
npm run build
Configuration
Environment Variables
The server requires the following environment variables:
Variable | Required | Default | Description |
---|---|---|---|
GITLAB_PERSONAL_ACCESS_TOKEN | Yes | - | Your GitLab personal access token |
GITLAB_API_URL | No | https://gitlab.com/api/v4 | GitLab API URL |
PORT | No | 3000 | Port for SSE transport |
USE_SSE | No | false | Set to 'true' to use SSE transport |
GITLAB_READ_ONLY_MODE | No | false | Set to 'true' to enable read-only mode (see below) |
Read-Only Mode
When GITLAB_READ_ONLY_MODE
is set to true
, the server will only expose read operations. This is useful for client applications that shouldn't have write access to your GitLab resources. In read-only mode, the following tools will be available:
search_repositories
get_file_contents
list_group_projects
get_project_events
list_commits
list_issues
list_merge_requests
list_project_wiki_pages
get_project_wiki_page
list_group_wiki_pages
get_group_wiki_page
list_project_members
list_group_members
Any attempt to use write operations (create, update, delete) will result in an error when in read-only mode.
MCP Settings Configuration
Add the GitLab MCP server to your MCP settings file:
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "@yoda.digital/gitlab-mcp-server"],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_token_here",
"GITLAB_API_URL": "https://gitlab.com/api/v4"
},
"alwaysAllow": [],
"disabled": false
}
}
}
For read-only mode, add the GITLAB_READ_ONLY_MODE
environment variable:
{
"mcpServers": {
"gitlab-readonly": {
"command": "npx",
"args": ["-y", "@yoda.digital/gitlab-mcp-server"],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_token_here",
"GITLAB_API_URL": "https://gitlab.com/api/v4",
"GITLAB_READ_ONLY_MODE": "true"
},
"alwaysAllow": [],
"disabled": false
}
}
}
Usage
With stdio transport (default)
# Set your GitLab personal access token
export GITLAB_PERSONAL_ACCESS_TOKEN=your_token_here
# Run the server
npm start
With SSE transport
# Set your GitLab personal access token and enable SSE
export GITLAB_PERSONAL_ACCESS_TOKEN=your_token_here
export GITLAB_READ_ONLY_MODE=false
export USE_SSE=true
export PORT=3000 # Optional, defaults to 3000
# Run the server
npm start
With npx
# Run directly with npx
GITLAB_PERSONAL_ACCESS_TOKEN=your_token_here npx @yoda.digital/gitlab-mcp-server
π οΈ Available Tools
Repository Operations
File Operations
Branch Operations
Issue Operations
Merge Request Operations
Project Activity
Member Operations
Project Wiki Operations
Group Wiki Operations
π§ Development
Requirements
- Node.js 16+
- npm 7+
- A GitLab account with a personal access token
Building the Project
npm run build
Running Tests
npm test
Code Style and Linting
npm run lint
Release Process
- Update version in
package.json
- Update CHANGELOG.md
- Create a new release on GitHub
- Publish to npm with
npm publish
π Documentation
For more detailed documentation, please visit our documentation site or check the TypeScript definitions in the source code.
πΌ Use Cases
- AI-powered Development Workflows - Enable AI assistants to interact with your GitLab repositories
- Automated Issue and PR Management - Streamline development processes with AI support
- Wiki Management - Automate documentation updates and knowledge base management
- Team Collaboration - Integrate AI assistants into your team's GitLab workflow
π Roadmap
- GitLab CI/CD Integration
- Advanced Project Analytics
- Comprehensive Test Suite
- Support for GitLab GraphQL API
- Extended Webhook Support
π€ Contributing
Contributions are welcome and appreciated! Here's how you can contribute:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Please make sure to update tests as appropriate and follow the code style of the project.
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π₯ Contributors
Thanks to all the contributors who have helped improve this project:
Special thanks to:
- thomasleveil - Implemented GitLab member listing functionality for projects and groups with consistent response formatting
π¦ NPM Package
This package is available on npm:
https://www.npmjs.com/package/@yoda.digital/gitlab-mcp-server