gitlab-mcp-server
Provides read-only tools for browsing GitLab projects and repositories, including listing projects, inspecting branches and commits, browsing the file tree, and reading file contents.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
gitlab-mcp-server
An MCP (Model Context Protocol) server for a self-hosted GitLab instance, focused on browsing projects and repositories. It exposes read-only tools so an MCP client (Claude desktop, Claude Code, etc.) can list projects, inspect branches and commits, browse the file tree, and read file contents.
Tools
Tool | Purpose |
| List / search projects, filter by owned or membership |
| Detailed info for one project (default branch, clone URLs, etc.) |
| List repository branches with their tip commit |
| List commits, filter by ref / path / date range |
| Full details and line-change stats for one commit |
| Browse files & directories at a path (optionally recursive) |
| Read decoded contents of a single file |
All tools are read-only and support pagination (page, per_page) and a response_format of markdown (default) or json.
Related MCP server: GitLab MCP Server
Requirements
Node.js 18+
A GitLab Personal Access Token (PAT)
Setup
npm install
npm run buildCreate a Personal Access Token
In GitLab: User Settings → Access Tokens. Create a token with these scopes:
read_api— required for listing projects, branches and commitsread_repository— required for the repository tree and file contents
Keep the token secret. It is read from an environment variable, never stored in code.
Configuration
Variable | Required | Description |
| yes | Base URL of your instance, e.g. |
| yes | Your Personal Access Token |
| no |
|
| no | Port for |
Running
# stdio (default — for local MCP clients)
GITLAB_BASE_URL=https://gitlab.example.com GITLAB_TOKEN=glpat-xxxx npm start
# HTTP transport (binds to 127.0.0.1)
TRANSPORT=http PORT=3000 GITLAB_BASE_URL=https://gitlab.example.com GITLAB_TOKEN=glpat-xxxx npm startConnecting to an MCP client
Most desktop clients use a JSON config block. Point it at the built entry point and supply the environment variables:
{
"mcpServers": {
"gitlab": {
"command": "node",
"args": ["/absolute/path/to/gitlab-mcp-server/dist/index.js"],
"env": {
"GITLAB_BASE_URL": "https://gitlab.example.com",
"GITLAB_TOKEN": "glpat-xxxxxxxxxxxxxxxxxxxx"
}
}
}
}Replace the path with the absolute path to dist/index.js on your machine, and fill in your instance URL and token. Restart the client to pick up the new server.
Project structure
gitlab-mcp-server/
├── package.json
├── tsconfig.json
├── README.md
└── src/
├── index.ts # Entry point, transport selection, env validation
├── constants.ts # Config readers and limits
├── types.ts # GitLab resource interfaces
├── schemas/common.ts # Shared Zod schema fragments
├── services/client.ts # Authenticated API client, pagination, errors
└── tools/projects.ts # Tool definitions and registrationIdentifying projects
Wherever a project_id is required, you can pass either:
the numeric project ID, e.g.
42, orthe namespace path, e.g.
mygroup/myrepo(the server URL-encodes it for you).
Notes
This server only performs read operations. It never creates, edits, or deletes anything in GitLab.
Large file or list responses are truncated at 25,000 characters; use pagination or narrower filters to retrieve more.
For development with auto-reload:
npm run dev.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
Go MCP server for GitLab: 2 dynamic tools reach 1000+ REST/GraphQL actions. Free/CE, no paid tier.
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- -licenseAqualityBmaintenanceMCP Server for the GitLab API, enabling project management, file operations, and more.95,950 npm91,952MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server for the GitLab API that enables comprehensive project management, file operations, and issue tracking. It supports automated branch creation, batch file pushes, and interaction with merge requests and CI/CD logs.MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for interacting with GitLab API, supporting both self-hosted instances and gitlab.com. Provides tools for managing issues, merge requests, code review, pipelines, milestones, releases, search, and file access.1,908 npmMIT
- AlicenseCqualityBmaintenanceA production-ready MCP server for GitLab enabling AI assistants to read and manage GitLab projects, merge requests, issues, pipelines, wikis, releases, and more through a unified interface.2681,908 npm10MIT