
Security News
Static vs. Runtime Reachability: Insights from Latio’s On the Record Podcast
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
@anupsahu/gitlab-mcp
Advanced tools
Production-ready MCP server for GitLab API with OAuth 2.0 PKCE authentication
MCP (Model Context Protocol) server for GitLab API with OAuth 2.0 PKCE authentication.
npm install -g @anupsahu/gitlab-mcp
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "@anupsahu/gitlab-mcp"],
"env": {
"USE_OAUTH": "true",
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "@anupsahu/gitlab-mcp"],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_gitlab_token",
"GITLAB_API_URL": "https://gitlab.com/api/v4"
}
}
}
}
The server supports OAuth 2.0 PKCE authentication for secure access to GitLab:
Start the server with USE_OAUTH=true
Authenticate using the oauth_login_pkce
tool
Tokens are automatically saved and persist across restarts
Port requirement: OAuth callback always uses http://localhost:7171 for compatibility with GitLab's official OAuth app. Ensure port 7171 is free during authentication.
Automatic token refresh handles expiration seamlessly
oauth_login_pkce
- Initiate OAuth authenticationoauth_status
- Check authentication statusoauth_logout
- Logout and clear tokensVariable | Description | Default |
---|---|---|
USE_OAUTH | Enable OAuth 2.0 authentication | false |
GITLAB_API_URL | GitLab API URL | https://gitlab.com/api/v4 |
GITLAB_PERSONAL_ACCESS_TOKEN | Personal access token (if not using OAuth) | - |
GITLAB_PROJECT_ID | Default project ID | - |
GITLAB_ALLOWED_PROJECT_IDS | Comma-separated list of allowed project IDs | - |
GITLAB_READ_ONLY_MODE | Enable read-only mode | false |
OAUTH_REDIRECT_PORT_PREFERRED | Preferred localhost callback port | 7171 |
OAUTH_REDIRECT_PORT_RANGE | Fallback range for callback port (inclusive) | 7171-7199 |
search_repositories
- Search for repositoriesget_repository_tree
- Get repository file treeget_file_contents
- Read file contentscreate_or_update_file
- Create or update filespush_files
- Push multiple filesget_merge_request
- Get merge request detailsget_merge_request_diffs
- Get merge request changescreate_merge_request
- Create new merge requestupdate_merge_request
- Update merge requestmerge_merge_request
- Merge a merge requestcreate_issue
- Create new issueget_issue
- Get issue detailsupdate_issue
- Update issuelist_issues
- List issueslist_commits
- List repository commitsget_commit
- Get commit detailsget_commit_diff
- Get commit changescreate_branch
- Create new branchfork_repository
- Fork repositoryOAuth tokens are automatically saved to:
~/.config/gitlab-mcp/oauth-config.json
// Use the oauth_login_pkce tool
{
"sessionId": "my-session" // optional
}
{
"project_id": "12345",
"merge_request_iid": "123",
"sessionId": "my-session"
}
{
"project_id": "12345",
"title": "Bug Report",
"description": "Description of the issue",
"sessionId": "my-session"
}
# Clone repository
git clone https://gitlab.com/anupsahu/gitlab-mcp.git
cd gitlab-mcp
# Install dependencies
npm install
# Build
npm run build
# Run with OAuth
USE_OAUTH=true GITLAB_API_URL=https://gitlab.com/api/v4 node build/index.js
MIT License - see LICENSE file for details.
For issues and questions:
Built with ❤️ for the MCP ecosystem
FAQs
Production-ready MCP server for GitLab API with OAuth 2.0 PKCE authentication
We found that @anupsahu/gitlab-mcp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.