GitLab MCP server
GitLab is a complete DevOps platform that unifies source code management, CI/CD pipelines, security scanning, and more. An AI agent with access to GitLab can manage repositories, create merge requests, orchestrate CI/CD pipelines, analyze security, and coordinate development workflows without manual GitLab operations.
Setting up an MCP server
This article covers the standard steps for creating an MCP server in AI Gateway and connecting it to an AI client. The steps are the same for every integration — application-specific details (API credentials, OAuth endpoints, and scopes) are covered in the Authentication section on this page.
Before you begin
You'll need:
- Access to AI Gateway with permission to create MCP servers.
- API credentials for the application you're connecting (see the Authentication section on this page for what to collect).
Create an MCP server
Find the app in the catalog
- Sign in to AI Gateway and select App Catalog from the left navigation.
- Search for the application you want to connect, then select it from the catalog.
- Select Create MCP Server to start the wizard.
App Configuration
Confirm the Base URL for the API, then, under Tools, select the endpoints you want to expose. Select Next.
MCP Server Setup
- Enter a Name for your server — something descriptive that identifies both the application and its purpose.
- Enter a Description so your team knows what the server is for.
- Set the log level: choose Production Mode for terser logs, or Non-Production Mode for more verbose logs that can help with debugging.
- Select Next.
Authentication
Enter the authentication details for the application. This varies by service — see the Authentication section on this page for the specific credentials, OAuth URLs, and scopes to use.
Review
Look over the summary of your MCP server configuration, then select Create & Deploy. AI Gateway provisions the server and provides a server URL you'll use when configuring your AI client.
Connect to an AI client
Once your server is deployed, you'll need to add it to the AI client your team uses. Select your client for setup instructions:
Tips
- You can create multiple MCP servers for the same application — for example, a read-only server for reporting agents and a read-write server for automation workflows.
- If you're unsure which OAuth scopes to request, start with the minimum read-only set and add write scopes only when needed. Most application pages include scope recommendations.
Authentication
GitLab uses OAuth 2.0 authentication. Create an OAuth application in your GitLab settings at Settings > Applications. For self-hosted GitLab, use your instance URL with the same paths.
| Value | Setting |
|---|---|
| Auth endpoint | https://gitlab.com/oauth/authorize |
| Token endpoint | https://gitlab.com/oauth/token |
| Base URL | https://gitlab.com/api/v4 |
| Scopes | api, read_api, read_repository, write_repository, read_registry, write_registry, read_user |
Available tools
This MCP server enables repository management, merge request workflows, CI/CD pipeline orchestration, issue tracking, security operations, and analytics for GitLab projects.
| Tool | Description |
|---|---|
| Create project | Create a new GitLab project with settings |
| Get project | Retrieve project details and configuration |
| Update project | Modify project settings and metadata |
| Delete project | Remove a project |
| List projects | Retrieve projects with filtering and sorting |
| Create branch | Create a new branch in a project |
| Delete branch | Delete a branch |
| List branches | Retrieve all branches in a project |
| Protect branch | Protect a branch from direct pushes |
| Create file | Create a file in a repository |
| Update file | Modify a file in a repository |
| Delete file | Delete a file from a repository |
| Get file | Retrieve file contents from a repository |
| Create merge request | Create a merge request between branches |
| Get merge request | Retrieve merge request details and status |
| Update merge request | Modify MR title, description, or state |
| Approve merge request | Mark an MR as approved |
| Merge merge request | Merge an approved merge request |
| Close merge request | Close an MR without merging |
| Add comment | Comment on a merge request or issue |
| Create issue | Create a new issue in a project |
| Get issue | Retrieve issue details |
| List issues | Retrieve issues with filtering options |
| Update issue | Modify issue status, labels, or assignee |
| Close issue | Close an issue |
| Create pipeline | Trigger a pipeline run |
| Get pipeline | Retrieve pipeline execution status |
| List pipelines | Retrieve recent pipeline runs |
| Get job | Retrieve job details and logs |
| Get artifacts | Retrieve job artifacts and download links |
| Create release | Create a release with tag and notes |
| Get release | Retrieve release details |
| Create tag | Create a git tag for versioning |
| Scan for vulnerabilities | Trigger SAST or dependency scanning |
| Get scan results | Retrieve security scan results |
| List merge requests | Retrieve open merge requests |
| Create milestone | Create a milestone for issues and epics |
| Get milestone | Retrieve milestone details |
Tips
Generate personal access tokens for automated operations that run without user interaction and don't need to act on behalf of a specific person.
Use OAuth for integrations that act on behalf of users and should reflect their identity in audit logs.
Store CI/CD configuration in .gitlab-ci.yml at the repository root to define your pipeline steps.
Commit the .gitlab-ci.yml file before attempting to trigger pipelines via the API, or the API calls will fail to find the pipeline definition.
Check merge conflict status before attempting to merge — the API cannot resolve merge conflicts automatically, and merge will fail if conflicts exist.
Ensure approval rules pass before attempting to merge, as branches with protection rules require approvals and status checks.
Monitor API usage and implement exponential backoff for retries to respect rate limits, as GitLab enforces 600 requests per minute.
Cequence AI Gateway