GitLab MCP Server
OfficialGitLab MCP サーバー
GitLab API 用の MCP サーバー。プロジェクト管理、ファイル操作などが可能になります。
特徴
自動ブランチ作成: ファイルを作成/更新したり変更をプッシュしたりするときに、ブランチが存在しない場合は自動的に作成されます。
包括的なエラー処理: 一般的な問題に対する明確なエラーメッセージ
Git 履歴の保存: 強制プッシュなしで適切な Git 履歴を維持する操作
バッチ操作: 単一ファイルと複数ファイルの操作の両方をサポート
ツール
create_or_update_fileプロジェクト内の単一のファイルを作成または更新する
入力:
project_id(文字列): プロジェクトIDまたはURLエンコードされたパスfile_path(文字列): ファイルを作成/更新するパスcontent(文字列): ファイルの内容commit_message(文字列): コミットメッセージbranch(文字列): ファイルを作成/更新するブランチprevious_path(オプションの文字列): 移動/名前変更するファイルのパス
戻り値: ファイルの内容とコミットの詳細
push_files1回のコミットで複数のファイルをプッシュする
入力:
project_id(文字列): プロジェクトIDまたはURLエンコードされたパスbranch(文字列): プッシュ先のブランチfiles(配列): プッシュするファイル。それぞれfile_pathとcontentを持つ。commit_message(文字列): コミットメッセージ
戻り値: 更新されたブランチ参照
search_repositoriesGitLabプロジェクトを検索
入力:
search(文字列): 検索クエリpage(オプションの数値):ページ番号per_page(オプションの数値):1ページあたりの結果数(デフォルトは20)
返されるもの: プロジェクト検索結果
create_repository新しいGitLabプロジェクトを作成する
入力:
name(文字列): プロジェクト名description(オプションの文字列): プロジェクトの説明visibility(オプションの文字列): 'private'、'internal'、または 'public'initialize_with_readme(オプションのブール値): README で初期化する
戻り値: 作成されたプロジェクトの詳細
get_file_contentsファイルまたはディレクトリの内容を取得する
入力:
project_id(文字列): プロジェクトIDまたはURLエンコードされたパスfile_path(文字列): ファイル/ディレクトリへのパスref(オプションの文字列): コンテンツを取得するブランチ/タグ/コミット
戻り値: ファイル/ディレクトリの内容
create_issue新しい問題を作成する
入力:
project_id(文字列): プロジェクトIDまたはURLエンコードされたパスtitle(文字列): 問題のタイトルdescription(オプションの文字列): 問題の説明assignee_ids(オプションの数値[]): 割り当てるユーザーIDlabels(オプションの文字列[]):追加するラベルmilestone_id(オプションの数値): マイルストーンID
返品: 作成された問題の詳細
create_merge_request新しいマージリクエストを作成する
入力:
project_id(文字列): プロジェクトIDまたはURLエンコードされたパスtitle(文字列): MRタイトルdescription(オプションの文字列):MRの説明source_branch(文字列): 変更を含むブランチtarget_branch(文字列): マージ先のブランチdraft(オプションのブール値):ドラフトMRとして作成allow_collaboration(オプションのブール値):上流メンバーからのコミットを許可する
戻り値: 作成されたマージリクエストの詳細
fork_repositoryプロジェクトをフォークする
入力:
project_id(文字列): プロジェクトIDまたはURLエンコードされたパスnamespace(オプションの文字列): フォークする名前空間
戻り値: フォークされたプロジェクトの詳細
create_branch新しいブランチを作成する
入力:
project_id(文字列): プロジェクトIDまたはURLエンコードされたパスbranch(文字列): 新しいブランチの名前ref(オプションの文字列): 新しいブランチのソースブランチ/コミット
戻り値: 作成されたブランチ参照
Related MCP server: GitHub MCP Server Plus
設定
個人アクセストークン
適切な権限を持つGitLab 個人アクセス トークンを作成します。
GitLabのユーザー設定 > アクセストークンに移動します
必要なスコープを選択します。
完全なAPIアクセスのための
api読み取り専用アクセス用の
read_apiリポジトリ操作用の
read_repositoryとwrite_repository
トークンを作成し、安全に保存する
Claude Desktopでの使用
claude_desktop_config.jsonに以下を追加します。
ドッカー
{
"mcpServers": {
"gitlab": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-e",
"GITLAB_PERSONAL_ACCESS_TOKEN",
"-e",
"GITLAB_API_URL",
"mcp/gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>",
"GITLAB_API_URL": "https://gitlab.com/api/v4" // Optional, for self-hosted instances
}
}
}
}NPX
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>",
"GITLAB_API_URL": "https://gitlab.com/api/v4" // Optional, for self-hosted instances
}
}
}
}VS Codeでの使用
素早くインストールするには、以下のワンクリック インストール ボタンのいずれかを使用します...
手動でインストールする場合は、VS Code のユーザー設定 (JSON) ファイルに次の JSON ブロックを追加します。Ctrl Ctrl + Shift + Pを押してPreferences: Open User Settings (JSON)と入力すると、このブロックを追加できます。
オプションとして、ワークスペース内の.vscode/mcp.jsonというファイルに追加することもできます。これにより、他のユーザーと設定を共有できるようになります。
.vscode/mcp.jsonファイルではmcpキーは必要ないことに注意してください。
ドッカー
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "gitlab_token",
"description": "GitLab Personal Access Token",
"password": true
},
{
"type": "promptString",
"id": "gitlab_url",
"description": "GitLab API URL (optional)",
"default": "https://gitlab.com/api/v4"
}
],
"servers": {
"gitlab": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"mcp/gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "${input:gitlab_token}",
"GITLAB_API_URL": "${input:gitlab_url}"
}
}
}
}
}NPX
{
"mcp": {
"inputs": [
{
"type": "promptString",
"id": "gitlab_token",
"description": "GitLab Personal Access Token",
"password": true
},
{
"type": "promptString",
"id": "gitlab_url",
"description": "GitLab API URL (optional)",
"default": "https://gitlab.com/api/v4"
}
],
"servers": {
"gitlab": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-gitlab"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "${input:gitlab_token}",
"GITLAB_API_URL": "${input:gitlab_url}"
}
}
}
}
}建てる
Dockerビルド:
docker build -t vonwig/gitlab:mcp -f src/gitlab/Dockerfile .環境変数
GITLAB_PERSONAL_ACCESS_TOKEN: GitLab個人アクセストークン(必須)GITLAB_API_URL: GitLab API のベース URL (オプション、デフォルトはhttps://gitlab.com/api/v4)
ライセンス
このMCPサーバーはMITライセンスに基づいてライセンスされています。つまり、MITライセンスの条件に従って、ソフトウェアを自由に使用、改変、配布することができます。詳細については、プロジェクトリポジトリのLICENSEファイルをご覧ください。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -licenseNot gradedqualityAmaintenanceMCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.99,70489,977MIT
- AlicenseBqualityDmaintenanceMCP Server for the GitHub API, providing features for file operations, repository management, and advanced search, with automatic branch creation and comprehensive error handling.18138MIT
- AlicenseCqualityAmaintenanceGitLab MCP Server (with activity tracking and group projects listing features) This server is based on the original GitLab MCP server with Group Projects Listing and Activity Tracking enhancements8640362MIT
- AlicenseCqualityDmaintenanceAn MCP server that enables communication with GitLab repositories, allowing interaction with GitLab's API to manage projects, issues, and repositories through natural language.45123,8991MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
GitLab MCP — wraps the GitLab REST API v4 (BYO API key)
An MCP server that let you interact with Cycloid.io Internal Development Portal and Platform
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/modelcontextprotocol/gitlab'
If you have feedback or need assistance with the MCP directory API, please join our Discord server