Integrating Kiro with the GitLab MCP Server: A Complete Guide
Access your GitLab projects, issues, merge requests, and CI/CD pipelines directly from your IDE — for both GitLab.com and self-hosted instances.
Authors:
Mark Kriaf, WW Observability Sr. PSA, AWS
Shashiraj Jeripotula , WW Principal Observability PSA, AWS
Introduction
Modern development teams live in GitLab — managing code, reviewing merge requests, tracking issues, and running CI/CD pipelines. But switching between your IDE and the GitLab UI to check pipeline status, review MR comments, or look up issue details breaks your flow.
By integrating Kiro with the GitLab MCP server , you can access your GitLab projects, issues, merge requests, and more — all through AI-assisted conversations directly in your development workflow. This works with both GitLab.com and self-hosted GitLab instances (e.g., MyGitlabInstance.MyCompany.com).
The GitLab MCP server provides a standardized way for AI tools to:
- Access GitLab project information and repository data
- Retrieve and manage issues and merge requests
- Interact with GitLab APIs securely via OAuth 2.0
- Perform GitLab-specific operations through natural language
In this blog, we will walk through configuring the GitLab MCP server in Kiro for both GitLab.com and self-hosted instances.
GitLab.com vs. Self-Hosted GitLab
Before diving into setup, it's important to understand the two deployment models, as the configuration differs slightly:
| GitLab.com (SaaS) | Self-Hosted GitLab |
|---|---|
| Hosted by GitLab at gitlab.com | Hosted on your own infrastructure |
| MCP endpoint: https://gitlab.com/api/v4/mcp | MCP endpoint: https://MyGitlabInstance.MyCompany.com/api/v4/mcp |
Key takeaway: The only difference in Kiro configuration is the URL. For GitLab.com, use gitlab.com. For self-hosted, use your instance hostname (e.g., MyGitlabInstance.MyCompany.com). Everything else is identical.
Prerequisites
- A GitLab account (GitLab.com) or a self-hosted GitLab instance (Premium or Ultimate tier)
- GitLab Duo with beta and experimental features enabled
- Kiro installed on your system
- Basic familiarity with GitLab and MCP concepts
Walking through the Kiro MCP Installation Process
MCP configuration in Kiro is managed through JSON files. The interface supports two levels of MCP configuration:
- User configuration: ~/.kiro/settings/mcp.json — Applies to all workspaces
- Workspace configuration: .kiro/settings/mcp.json — Specific to the current workspace
Step-by-Step Integration Guide
1. Open Kiro MCP Settings
Method 1: Command Palette
Open the command palette:
- Mac: Cmd + Shift + P
- Windows/Linux: Ctrl + Shift + P
Search "MCP" and select:
- Kiro: Open workspace MCP config (JSON) — For workspace-level
- Kiro: Open user MCP config (JSON) — For user-level
Method 2: Kiro Panel
- Open Kiro
- Click on the Kiro ghost icon to open the left side panel
- Locate the MCP SERVERS section
- Click the "Open MCP Config" button
2. Add the GitLab MCP Server Configuration
The GitLab MCP server uses HTTP transport (recommended) — a direct connection with no additional dependencies like Node.js. GitLab handles authentication via OAuth 2.0 Dynamic Client Registration, so you don't need to manage tokens manually.
Configuration for GitLab.com:
1
2
3
4
5
6
7
8
{
"mcpServers": {
"GitLab": {
"type": "http",
"url": "https://gitlab.com/api/v4/mcp"
}
}
} Configuration for Self-Hosted GitLab:
Replace <your-gitlab-host> with your GitLab instance URL (e.g., MyGitlabInstance.MyCompany.com):
1
2
3
4
5
6
7
8
9
{
"mcpServers": {
"GitLab": {
"type": "http",
"url": "https://<your-gitlab-host>/api/v4/mcp"
}
}
} Connecting to multiple GitLab instances:
If you need to connect to both GitLab.com and a self-hosted instance simultaneously, use the X-Gitlab-Mcp-Server-Tool-Name-Prefix header to avoid tool name conflicts:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"mcpServers": {
"GitLab-SaaS": {
"type": "http",
"url": "https://gitlab.com/api/v4/mcp",
"headers": {
"X-Gitlab-Mcp-Server-Tool-Name-Prefix": "saas_"
}
},
"GitLab-Self-Hosted": {
"type": "http",
"url": "https://MyGitlabInstance.MyCompany.com/api/v4/mcp",
"headers": {
"X-Gitlab-Mcp-Server-Tool-Name-Prefix": "selfhosted_"
}
}
}
} 3. Authorize the Connection
- Save the configuration file
- Your browser will automatically open the GitLab OAuth authorization page
- Review and approve the authorization request
- Return to Kiro — the GitLab server should now appear as connected in the MCP SERVERS section
Note: If the browser does not open automatically, open Kiro CLI and run the /mcp command to trigger authentication.
Natural Language Queries
Kiro offers a chat panel where you can interact with your code through natural language conversations. With the GitLab MCP server connected, you can now use natural language to:
| Task | Example Prompt |
|---|---|
| Browse projects | "Show me all my GitLab projects" |
| Review merge requests | "List open merge requests in the backend-api project" |
| Track issues | "What are the high-priority issues assigned to me?" |
| Check CI/CD pipelines | "Show the status of the latest pipeline for main branch" |
| Create issues | "Create an issue in project frontend-app titled Fix login redirect bug" |
| Code context | "Summarize the changes in merge request !245" |
Best Practices
- Use workspace-level config for project-specific instances — If different projects use different GitLab instances, keep the MCP config in .kiro/settings/mcp.json per workspace
- Use tool name prefixes for multi-instance setups — The X-Gitlab-Mcp-Server-Tool-Name-Prefix header prevents tool name collisions when connecting to multiple GitLab instances
- Prefer HTTP transport — Kiro supports direct HTTP connections to the GitLab MCP server with no additional dependencies. Only use stdio transport with mcp-remote if HTTP is unavailable
- Review OAuth permissions — On first connect, carefully review what scopes the OAuth authorization requests. Only approve access you're comfortable granting
- Guard against prompt injection — Exercise caution when using MCP tools on GitLab objects from untrusted sources. Be mindful of content in issues and merge request descriptions that could influence AI behavior
Conclusion
Integrating Kiro with the GitLab MCP server brings your entire GitLab workflow — projects, issues, merge requests, CI/CD pipelines — directly into your IDE. Whether you're using GitLab.com or a self-hosted instance at MyGitlabInstance.MyCompany.com, the setup is identical: a single JSON entry pointing to your instance's /api/v4/mcp endpoint.
The benefits are substantial — instant access to project data, AI-assisted code reviews, natural language issue management, and seamless CI/CD monitoring — all without leaving your coding environment. Combined with Kiro's AI-assisted conversations, you can move faster, stay in context, and let the IDE handle the context switching for you.
Resources
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article