GitLab MCP server
Project description
mcp-gitlab-server
⚠️ Development Stage Notice
This project is currently in development stage. Features and APIs may change without notice. Use with caution in production environments.
GitLab MCP server based on python-gitlab.
Install
Using Personal Access Token (Most Common)
{
"mcpServers": {
"GitLab": {
"command": "uvx",
"args": [
"gitlab-mcp-server"
],
"env": {
"GITLAB_TOKEN": "<your GitLab personal access token>",
"GITLAB_URL": "https://gitlab.com"
}
}
}
}
Using OAuth2 Token
{
"mcpServers": {
"GitLab": {
"command": "uvx",
"args": [
"gitlab-mcp-server"
],
"env": {
"GITLAB_OAUTH_TOKEN": "<your GitLab OAuth2 token>",
"GITLAB_URL": "https://gitlab.com"
}
}
}
}
For self-hosted GitLab instances, set GITLAB_URL to your GitLab instance URL (e.g., https://gitlab.example.com). If not set, it defaults to https://gitlab.com.
Authentication
This MCP server supports two authentication methods:
Method 1: Personal Access Token (Recommended for most users)
-
Create a GitLab Personal Access Token:
- Go to GitLab → User Settings → Access Tokens
- Create a token with
read_apiscope (minimum required)
-
Set the
GITLAB_TOKENenvironment variable to your token value
Method 2: OAuth2 Token (For OAuth2 applications)
- If you have an OAuth2 token from a GitLab OAuth2 application flow
- Set the
GITLAB_OAUTH_TOKENenvironment variable to your OAuth2 token value
To create an OAuth2 application:
- Go to GitLab → User Settings → Applications
- Create a new application with appropriate scopes (
read_apiminimum) - Use the OAuth2 flow to obtain an access token
- Use that token as
GITLAB_OAUTH_TOKEN
Environment Variables
GITLAB_TOKEN- Your GitLab Personal Access Token (if using personal token auth)GITLAB_OAUTH_TOKEN- Your GitLab OAuth2 Token (if using OAuth2 auth)GITLAB_URL- GitLab instance URL (defaults tohttps://gitlab.com)
Note: The server will first check for GITLAB_OAUTH_TOKEN, and if not found, will use GITLAB_TOKEN. You only need to set one of these.
Tools
- list_projects - List GitLab projects accessible to the authenticated user (supports filtering by owned/starred and pagination)
- list_groups - List GitLab groups accessible to the authenticated user
- list_group_projects - List all projects within a specific GitLab group
- get_user_info - Get information about the authenticated user
- search_repositories - Search for GitLab repositories by name, description, or keywords
- get_repository_details - Get detailed information about a specific repository
Development
# Clone the repository
git clone <repo-url>
cd gitlab-mcp-server
# Install dependencies
uv sync
# Run in development mode
uv run python -m mcp_gitlab_server
Testing Configuration
For development and testing purposes, you can use a local wheel file installation:
MCP Configuration for Testing:
{
"mcpServers": {
"GitLab": {
"command": "uvx",
"args": [
"--from", "/path/to/your/gitlab-mcp-server/dist/mcp_gitlab_server-0.1.0-py3-none-any.whl",
"gitlab-mcp-server"
],
"env": {
"GITLAB_TOKEN": "your-gitlab-token-here",
"GITLAB_URL": "https://gitlab.com"
}
}
}
}
Build and Test Steps:
# Build the wheel file
uv build
# Test with MCP client (like Claude Desktop)
# Update your MCP configuration with the local wheel path
# The wheel file will be in ./dist/ directory
# For quick testing, verify the server starts:
uv run python -m mcp_gitlab_server
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_gitlab_server-0.0.2.tar.gz.
File metadata
- Download URL: mcp_gitlab_server-0.0.2.tar.gz
- Upload date:
- Size: 35.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0836781be9dc16be923f991495c31afdb1c7cdb31577c646c27707b74922eb1
|
|
| MD5 |
cf0725be25a14b777ff3dde6be4c403c
|
|
| BLAKE2b-256 |
454f96012ebcde91def5aeccb717b0b3feffe33f122b6204a7ccc841bc2df3e9
|
Provenance
The following attestation bundles were made for mcp_gitlab_server-0.0.2.tar.gz:
Publisher:
publish.yml on kopiloto/mcp-gitlab-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_gitlab_server-0.0.2.tar.gz -
Subject digest:
e0836781be9dc16be923f991495c31afdb1c7cdb31577c646c27707b74922eb1 - Sigstore transparency entry: 231356037
- Sigstore integration time:
-
Permalink:
kopiloto/mcp-gitlab-server@afb69f6685837edacd7ee657ffe4f5bc2882886f -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/kopiloto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@afb69f6685837edacd7ee657ffe4f5bc2882886f -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_gitlab_server-0.0.2-py3-none-any.whl.
File metadata
- Download URL: mcp_gitlab_server-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84c10218ebbdb330a1405537934a801edddb6ad71dc92ef683956d57e98505b9
|
|
| MD5 |
de11107501bbcf4b84be748982722bd4
|
|
| BLAKE2b-256 |
3a03654697ba3cbae2bf1d48dfbf9b7e45862f323268822de89eb9436d128dd0
|
Provenance
The following attestation bundles were made for mcp_gitlab_server-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on kopiloto/mcp-gitlab-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_gitlab_server-0.0.2-py3-none-any.whl -
Subject digest:
84c10218ebbdb330a1405537934a801edddb6ad71dc92ef683956d57e98505b9 - Sigstore transparency entry: 231356043
- Sigstore integration time:
-
Permalink:
kopiloto/mcp-gitlab-server@afb69f6685837edacd7ee657ffe4f5bc2882886f -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/kopiloto
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@afb69f6685837edacd7ee657ffe4f5bc2882886f -
Trigger Event:
release
-
Statement type: