Skip to content

GitLab MCP Server Usage Guide

Overview

This guide shows how to use the GitLab MCP Server with different MCP clients and integration methods.

Tool Discovery

# Start interactive mode
mcp_platform interactive

# List available tools
mcpp> tools gitlab
# Discover tools using CLI
mcp_platform tools gitlab
from mcp_platform.client import MCPClient

async def discover_tools():
    client = MCPClient()
    tools = client.list_tools("gitlab")
    for tool in tools:
        print(f"Tool: {tool['name']} - {tool['description']}")

Available Tools

merge_merge_request

Description: Merge a merge request in a GitLab project

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - auto_merge (boolean) (optional): If true, the merge request merges when the pipeline succeeds. - merge_commit_message (string) (optional): Custom merge commit message - merge_when_pipeline_succeeds (string) (optional): If true, the merge request merges when the pipeline succeeds.in GitLab 17.11. Use - should_remove_source_branch (string) (optional): Remove source branch after merge - squash_commit_message (string) (optional): Custom squash commit message - squash (string) (optional): Squash commits into a single commit when merging

create_or_update_file

Description: Create or update a single file in a GitLab project

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - file_path (string) (required): Path where to create/update the file - content (string) (required): Content of the file - commit_message (string) (required): Commit message - branch (string) (required): Branch to create/update the file in - previous_path (string) (optional): Path of the file to move/rename - last_commit_id (string) (optional): Last known file commit ID - commit_id (string) (optional): Current file commit ID (for update operations)

search_repositories

Description: Search for GitLab projects

Parameters: - search (string) (required): Search query - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

create_repository

Description: Create a new GitLab project

Parameters: - name (string) (required): Repository name - description (string) (optional): Repository description - visibility (string) (optional): Repository visibility level - initialize_with_readme (boolean) (optional): Initialize with README.md

get_file_contents

Description: Get the contents of a file or directory from a GitLab project

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - file_path (string) (required): Path to the file or directory - ref (string) (optional): Branch/tag/commit to get contents from

push_files

Description: Push multiple files to a GitLab project in a single commit

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - branch (string) (required): Branch to push to - files (array) (required): Array of files to push - commit_message (string) (required): Commit message

create_issue

Description: Create a new issue in a GitLab project

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - title (string) (required): Issue title - description (string) (optional): Issue description - assignee_ids (array) (optional): Array of user IDs to assign - labels (array) (optional): Array of label names - milestone_id (string) (optional): Milestone ID to assign - issue_type (string) (optional): the type of issue. One of issue, incident, test_case or task.

create_merge_request

Description: Create a new merge request in a GitLab project

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - title (string) (required): Merge request title - description (string) (optional): Merge request description - source_branch (string) (required): Branch containing changes - target_branch (string) (required): Branch to merge into - target_project_id (string) (optional): Numeric ID of the target project. - assignee_ids (array) (optional): The ID of the users to assign the MR to - reviewer_ids (array) (optional): The ID of the users to assign as reviewers of the MR - labels (array) (optional): Labels for the MR - draft (boolean) (optional): Create as draft merge request - allow_collaboration (boolean) (optional): Allow commits from upstream members - remove_source_branch (string) (optional): Flag indicating if a merge request should remove the source branch when merging. - squash (string) (optional): If true, squash all commits into a single commit on merge.

fork_repository

Description: Fork a GitLab project to your account or specified namespace

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - namespace (string) (optional): Namespace to fork to (full path)

create_branch

Description: Create a new branch in a GitLab project

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - branch (string) (required): Name for the new branch - ref (string) (optional): Source branch/commit for new branch

get_merge_request

Description: Get details of a merge request (Either mergeRequestIid or branchName must be provided)

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - source_branch (string) (optional): Source branch name

get_merge_request_diffs

Description: Get the changes/diffs of a merge request (Either mergeRequestIid or branchName must be provided)

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - source_branch (string) (optional): Source branch name - view (string) (optional): Diff view type

list_merge_request_diffs

Description: List merge request diffs with pagination support (Either mergeRequestIid or branchName must be provided)

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - source_branch (string) (optional): Source branch name - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20) - unidiff (boolean) (optional): Present diffs in the unified diff format. Default is false. Introduced in GitLab 16.5.

get_branch_diffs

Description: Get the changes/diffs between two branches or commits in a GitLab project

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - from (string) (required): The base branch or commit SHA to compare from - to (string) (required): The target branch or commit SHA to compare to - straight (boolean) (optional): Comparison method: false for '...' (default), true for '--' - excluded_file_patterns (array) (optional): Array of regex patterns to exclude files from the diff results. Each pattern is a JavaScript-compatible regular expression that matches file paths to ignore. Examples: ["^test/mocks/", ".spec.ts$", "package-lock.json"]

update_merge_request

Description: Update a merge request (Either mergeRequestIid or branchName must be provided)

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - source_branch (string) (optional): Source branch name - title (string) (optional): The title of the merge request - description (string) (optional): The description of the merge request - target_branch (string) (optional): The target branch - assignee_ids (array) (optional): The ID of the users to assign the MR to - reviewer_ids (array) (optional): The ID of the users to assign as reviewers of the MR - labels (array) (optional): Labels for the MR - state_event (string) (optional): New state (close/reopen) for the MR - remove_source_branch (boolean) (optional): Flag indicating if the source branch should be removed - squash (boolean) (optional): Squash commits into a single commit when merging - draft (string) (optional): Work in progress merge request

create_note

Description: Create a new note (comment) to an issue or merge request

Parameters: - project_id (string) (optional): Project ID or namespace/project_path - noteable_type (string) (required): Type of noteable (issue or merge_request) - noteable_iid (string) (optional): IID of the issue or merge request - body (string) (required): Note content

create_merge_request_thread

Description: Create a new thread on a merge request

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - body (string) (required): The content of the thread - position (object) (optional): Position when creating a diff note - created_at (string) (optional): Date the thread was created at (ISO 8601 format)

mr_discussions

Description: List discussion items for a merge request

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

update_merge_request_note

Description: Modify an existing merge request thread note

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - discussion_id (string) (optional): The ID of a thread - note_id (string) (optional): The ID of a thread note - body (string) (optional): The content of the note or reply - resolved (boolean) (optional): Resolve or unresolve the note

create_merge_request_note

Description: Add a new note to an existing merge request thread

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - discussion_id (string) (optional): The ID of a thread - body (string) (required): The content of the note or reply - created_at (string) (optional): Date the note was created at (ISO 8601 format)

get_draft_note

Description: Get a single draft note from a merge request

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - draft_note_id (string) (optional): The ID of the draft note

list_draft_notes

Description: List draft notes for a merge request

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request

create_draft_note

Description: Create a draft note for a merge request

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - body (string) (required): The content of the draft note - position (object) (optional): Position when creating a diff note - resolve_discussion (boolean) (optional): Whether to resolve the discussion when publishing

update_draft_note

Description: Update an existing draft note

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - draft_note_id (string) (optional): The ID of the draft note - body (string) (optional): The content of the draft note - position (object) (optional): Position when creating a diff note - resolve_discussion (boolean) (optional): Whether to resolve the discussion when publishing

delete_draft_note

Description: Delete a draft note

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - draft_note_id (string) (optional): The ID of the draft note

publish_draft_note

Description: Publish a single draft note

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request - draft_note_id (string) (optional): The ID of the draft note

bulk_publish_draft_notes

Description: Publish all draft notes for a merge request

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - merge_request_iid (string) (optional): The IID of a merge request

update_issue_note

Description: Modify an existing issue thread note

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - issue_iid (string) (optional): The IID of an issue - discussion_id (string) (optional): The ID of a thread - note_id (string) (optional): The ID of a thread note - body (string) (required): The content of the note or reply

create_issue_note

Description: Add a new note to an existing issue thread

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - issue_iid (string) (optional): The IID of an issue - discussion_id (string) (optional): The ID of a thread - body (string) (required): The content of the note or reply - created_at (string) (optional): Date the note was created at (ISO 8601 format)

list_issues

Description: List issues (default: created by current user only; use scope='all' for all accessible issues)

Parameters: - project_id (string) (optional): Project ID or URL-encoded path (optional - if not provided, lists issues across all accessible projects) - assignee_id (string) (optional): Return issues assigned to the given user ID. user id or none or any - assignee_username (array) (optional): Return issues assigned to the given username - author_id (string) (optional): Return issues created by the given user ID - author_username (string) (optional): Return issues created by the given username - confidential (boolean) (optional): Filter confidential or public issues - created_after (string) (optional): Return issues created after the given time - created_before (string) (optional): Return issues created before the given time - due_date (string) (optional): Return issues that have the due date - labels (array) (optional): Array of label names - milestone (string) (optional): Milestone title - issue_type (string) (optional): Filter to a given type of issue. One of issue, incident, test_case or task - iteration_id (string) (optional): Return issues assigned to the given iteration ID. None returns issues that do not belong to an iteration. Any returns issues that belong to an iteration. - scope (string) (optional): Return issues from a specific scope - search (string) (optional): Search for specific terms - state (string) (optional): Return issues with a specific state - updated_after (string) (optional): Return issues updated after the given time - updated_before (string) (optional): Return issues updated before the given time - with_labels_details (string) (optional): Return more details for each label - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

my_issues

Description: List issues assigned to the authenticated user (defaults to open issues)

Parameters: - project_id (string) (optional): Project ID or URL-encoded path (optional when GITLAB_PROJECT_ID is set) - state (string) (optional): Return issues with a specific state (default: opened) - labels (array) (optional): Array of label names to filter by - milestone (string) (optional): Milestone title to filter by - search (string) (optional): Search for specific terms in title and description - created_after (string) (optional): Return issues created after the given time (ISO 8601) - created_before (string) (optional): Return issues created before the given time (ISO 8601) - updated_after (string) (optional): Return issues updated after the given time (ISO 8601) - updated_before (string) (optional): Return issues updated before the given time (ISO 8601) - per_page (number) (optional): Number of items per page (default: 20, max: 100) - page (number) (optional): Page number for pagination (default: 1)

get_issue

Description: Get details of a specific issue in a GitLab project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - issue_iid (string) (optional): The internal ID of the project issue

update_issue

Description: Update an issue in a GitLab project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - issue_iid (string) (optional): The internal ID of the project issue - title (string) (optional): The title of the issue - description (string) (optional): The description of the issue - assignee_ids (array) (optional): Array of user IDs to assign issue to - confidential (boolean) (optional): Set the issue to be confidential - discussion_locked (string) (optional): Flag to lock discussions - due_date (string) (optional): Date the issue is due (YYYY-MM-DD) - labels (array) (optional): Array of label names - milestone_id (string) (optional): Milestone ID to assign - state_event (string) (optional): Update issue state (close/reopen) - weight (number) (optional): Weight of the issue (0-9) - issue_type (string) (required): the type of issue. One of issue, incident, test_case or task.

delete_issue

Description: Delete an issue from a GitLab project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - issue_iid (string) (optional): The internal ID of the project issue

Description: List all issue links for a specific issue

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - issue_iid (string) (optional): The internal ID of a project's issue

list_issue_discussions

Description: List discussions for an issue in a GitLab project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - issue_iid (string) (optional): The internal ID of the project issue - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

Description: Get a specific issue link

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - issue_iid (string) (optional): The internal ID of a project's issue - issue_link_id (string) (optional): ID of an issue relationship

Description: Create an issue link between two issues

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - issue_iid (string) (optional): The internal ID of a project's issue - target_project_id (string) (optional): The ID or URL-encoded path of a target project - target_issue_iid (string) (optional): The internal ID of a target project's issue - link_type (string) (optional): The type of the relation, defaults to relates_to

Description: Delete an issue link

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - issue_iid (string) (optional): The internal ID of a project's issue - issue_link_id (string) (optional): The ID of an issue relationship

list_namespaces

Description: List all namespaces available to the current user

Parameters: - search (string) (optional): Search term for namespaces - owned (boolean) (optional): Filter for namespaces owned by current user - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

get_namespace

Description: Get details of a namespace by ID or path

Parameters: - namespace_id (string) (optional): Namespace ID or full path

verify_namespace

Description: Verify if a namespace path exists

Parameters: - path (string) (required): Namespace path to verify

get_project

Description: Get details of a specific project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path

list_projects

Description: List projects accessible by the current user

Parameters: - search (string) (optional): Search term for projects - search_namespaces (boolean) (optional): Needs to be true if search is full path - owned (string) (optional): Filter for projects owned by current user - membership (string) (optional): Filter for projects where current user is a member - simple (string) (optional): Return only limited fields - archived (string) (optional): Filter for archived projects - visibility (string) (optional): Filter by project visibility - order_by (string) (optional): Return projects ordered by field - sort (string) (optional): Return projects sorted in ascending or descending order - with_issues_enabled (boolean) (optional): Filter projects with issues feature enabled - with_merge_requests_enabled (boolean) (optional): Filter projects with merge requests feature enabled - min_access_level (number) (optional): Filter by minimum access level - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

list_project_members

Description: List members of a GitLab project

Parameters: - project_id (string) (required): Project ID or URL-encoded path - query (string) (optional): Search for members by name or username - user_ids (array) (optional): Filter by user IDs - skip_users (array) (optional): User IDs to exclude - per_page (number) (optional): Number of items per page (default: 20, max: 100) - page (number) (optional): Page number for pagination (default: 1)

list_labels

Description: List labels for a project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - with_counts (boolean) (optional): Whether or not to include issue and merge request counts - include_ancestor_groups (boolean) (optional): Include ancestor groups - search (string) (optional): Keyword to filter labels by

get_label

Description: Get a single label from a project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - label_id (string) (optional): The ID or title of a project's label - include_ancestor_groups (boolean) (optional): Include ancestor groups

create_label

Description: Create a new label in a project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - name (string) (required): The name of the label - color (string) (required): The color of the label given in 6-digit hex notation with leading '#' sign - description (string) (optional): The description of the label - priority (['number', 'null']) (optional): The priority of the label

update_label

Description: Update an existing label in a project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - label_id (string) (optional): The ID or title of a project's label - new_name (string) (optional): The new name of the label - color (string) (optional): The color of the label given in 6-digit hex notation with leading '#' sign - description (string) (optional): The new description of the label - priority (['number', 'null']) (optional): The new priority of the label

delete_label

Description: Delete a label from a project

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - label_id (string) (optional): The ID or title of a project's label

list_group_projects

Description: List projects in a GitLab group with filtering options

Parameters: - group_id (string) (optional): Group ID or path - include_subgroups (boolean) (optional): Include projects from subgroups - search (string) (optional): Search term to filter projects - order_by (string) (optional): Field to sort by - sort (string) (optional): Sort direction - archived (string) (optional): Filter for archived projects - visibility (string) (optional): Filter by project visibility - with_issues_enabled (boolean) (optional): Filter projects with issues feature enabled - with_merge_requests_enabled (boolean) (optional): Filter projects with merge requests feature enabled - min_access_level (number) (optional): Filter by minimum access level - with_programming_language (string) (optional): Filter by programming language - starred (string) (optional): Filter by starred projects - statistics (string) (optional): Include project statistics - with_custom_attributes (string) (optional): Include custom attributes - with_security_reports (string) (optional): Include security reports - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

get_repository_tree

Description: Get the repository tree for a GitLab project (list files and directories)

Parameters: - project_id (string) (optional): The ID or URL-encoded path of the project - path (string) (optional): The path inside the repository - ref (string) (optional): The name of a repository branch or tag. Defaults to the default branch. - recursive (boolean) (optional): Boolean value to get a recursive tree - per_page (number) (optional): Number of results to show per page - page_token (string) (optional): The tree record ID for pagination - pagination (string) (optional): Pagination method (keyset)

list_merge_requests

Description: List merge requests in a GitLab project with filtering options

Parameters: - project_id (string) (optional): Project ID or URL-encoded path - assignee_id (string) (optional): Return issues assigned to the given user ID. user id or none or any - assignee_username (string) (optional): Returns merge requests assigned to the given username - author_id (string) (optional): Returns merge requests created by the given user ID - author_username (string) (optional): Returns merge requests created by the given username - reviewer_id (string) (optional): Returns merge requests which have the user as a reviewer. user id or none or any - reviewer_username (string) (optional): Returns merge requests which have the user as a reviewer - created_after (string) (optional): Return merge requests created after the given time - created_before (string) (optional): Return merge requests created before the given time - updated_after (string) (optional): Return merge requests updated after the given time - updated_before (string) (optional): Return merge requests updated before the given time - labels (array) (optional): Array of label names - milestone (string) (optional): Milestone title - scope (string) (optional): Return merge requests from a specific scope - search (string) (optional): Search for specific terms - state (string) (optional): Return merge requests with a specific state - order_by (string) (optional): Return merge requests ordered by the given field - sort (string) (optional): Return merge requests sorted in ascending or descending order - target_branch (string) (optional): Return merge requests targeting a specific branch - source_branch (string) (optional): Return merge requests from a specific source branch - wip (string) (optional): Filter merge requests against their wip status - with_labels_details (boolean) (optional): Return more details for each label - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

get_users

Description: Get GitLab user details by usernames

Parameters: - usernames (array) (required): Array of usernames to search for

list_commits

Description: List repository commits with filtering options

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - ref_name (string) (optional): The name of a repository branch, tag or revision range, or if not given the default branch - since (string) (optional): Only commits after or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ - until (string) (optional): Only commits before or on this date are returned in ISO 8601 format YYYY-MM-DDTHH:MM:SSZ - path (string) (optional): The file path - author (string) (optional): Search commits by commit author - all (boolean) (optional): Retrieve every commit from the repository - with_stats (string) (optional): Stats about each commit are added to the response - first_parent (string) (optional): Follow only the first parent commit upon seeing a merge commit - order (string) (optional): List commits in order - trailers (string) (optional): Parse and include Git trailers for every commit - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

get_commit

Description: Get details of a specific commit

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - sha (string) (required): The commit hash or name of a repository branch or tag - stats (boolean) (optional): Include commit stats

get_commit_diff

Description: Get changes/diffs of a specific commit

Parameters: - project_id (string) (optional): Project ID or complete URL-encoded path to project - sha (string) (required): The commit hash or name of a repository branch or tag

list_group_iterations

Description: List group iterations with filtering options

Parameters: - group_id (string) (optional): Group ID or URL-encoded path - state (string) (optional): Return opened, upcoming, current, closed, or all iterations. - search (string) (optional): Return only iterations with a title matching the provided string. - in (array) (optional): Fields in which fuzzy search should be performed with the query given in the argument search. The available options are title and cadence_title. Default is [title]. - include_ancestors (boolean) (optional): Include iterations for group and its ancestors. Defaults to true. - include_descendants (string) (optional): Include iterations for group and its descendants. Defaults to false. - updated_before (string) (optional): Return only iterations updated before the given datetime. Expected in ISO 8601 format (2019-03-15T08:00:00Z). - updated_after (string) (optional): Return only iterations updated after the given datetime. Expected in ISO 8601 format (2019-03-15T08:00:00Z). - page (number) (optional): Page number for pagination (default: 1) - per_page (number) (optional): Number of items per page (max: 100, default: 20)

upload_markdown

Description: Upload a file to a GitLab project for use in markdown content

Parameters: - project_id (string) (required): Project ID or URL-encoded path of the project - file_path (string) (required): Path to the file to upload

download_attachment

Description: Download an uploaded file from a GitLab project by secret and filename

Parameters: - project_id (string) (required): Project ID or URL-encoded path of the project - secret (string) (required): The 32-character secret of the upload - filename (string) (required): The filename of the upload - local_path (string) (optional): Local path to save the file (optional, defaults to current directory)

Usage Examples

# Start interactive mode
mcp_platform interactive

# Deploy the template (if not already deployed)
mcpp> deploy gitlab

# List available tools after deployment
mcpp> tools gitlab

Then call tools:

mcpp> call gitlab merge_merge_request '{"project_id": "example_value", "merge_request_iid": "example_value", "auto_merge": true, "merge_commit_message": "example_value", "merge_when_pipeline_succeeds": "example_value", "should_remove_source_branch": "example_value", "squash_commit_message": "example_value", "squash": "example_value"}'
mcpp> call gitlab create_or_update_file '{"project_id": "example_value", "file_path": "example_value", "content": "example_value", "commit_message": "example_value", "branch": "example_value", "previous_path": "example_value", "last_commit_id": "example_value", "commit_id": "example_value"}'
mcpp> call gitlab search_repositories '{"search": "example_value", "page": 123, "per_page": 123}'
# Deploy the template
mcp_platform deploy gitlab

# Check deployment status
mcp_platform status

# View logs
mcp_platform logs gitlab

# Stop the template
mcp_platform stop gitlab
import asyncio
from mcp_platform.client import MCPClient

async def use_gitlab():
    client = MCPClient()

    # Start the server
    deployment = client.start_server("gitlab", {})

    if deployment["success"]:
        deployment_id = deployment["deployment_id"]

        try:
            # Discover available tools
            tools = client.list_tools("gitlab")
            print(f"Available tools: {[t['name'] for t in tools]}")

            # Call merge_merge_request
            result = client.call_tool("gitlab", "merge_merge_request", {'project_id': 'example_value', 'merge_request_iid': 'example_value', 'auto_merge': True, 'merge_commit_message': 'example_value', 'merge_when_pipeline_succeeds': 'example_value', 'should_remove_source_branch': 'example_value', 'squash_commit_message': 'example_value', 'squash': 'example_value'})
            print(f"merge_merge_request result: {result}")

            # Call create_or_update_file
            result = client.call_tool("gitlab", "create_or_update_file", {'project_id': 'example_value', 'file_path': 'example_value', 'content': 'example_value', 'commit_message': 'example_value', 'branch': 'example_value', 'previous_path': 'example_value', 'last_commit_id': 'example_value', 'commit_id': 'example_value'})
            print(f"create_or_update_file result: {result}")

        finally:
            # Clean up
            client.stop_server(deployment_id)
    else:
        print("Failed to start server")

# Run the example
asyncio.run(use_gitlab())

Integration Examples

Add this configuration to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "gitlab": {
      "command": "python",
      "args": ["-m", "mcp_platform", "connect", "gitlab", "--stdio"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}

Install the MCP extension and add this to your VS Code settings (.vscode/settings.json):

{
  "mcp.servers": {
    "gitlab": {
      "command": "python",
      "args": ["-m", "mcp_platform", "connect", "gitlab", "--stdio"],
      "env": {
        "LOG_LEVEL": "info"
      }
    }
  }
}
# Get connection details for other integrations
mcp_platform connect gitlab --llm claude
mcp_platform connect gitlab --llm vscode

Configuration

For template-specific configuration options, see the main template documentation. Common configuration methods:

# Deploy with environment variables
mcp_platform deploy gitlab --env KEY=VALUE
# Deploy with configuration
mcp_platform deploy gitlab --config key=value

# Deploy with nested configuration
mcp_platform deploy gitlab --config category__property=value
# Deploy with config file
mcp_platform deploy gitlab --config-file config.json

Troubleshooting

Common Issues

  1. Template not found: Ensure the template name is correct

    mcp_platform list  # List available templates
    

  2. Connection issues: Check if the server is running

    mcp_platform status
    

  3. Tool discovery fails: Try refreshing the tool cache

    mcpp> tools gitlab --refresh
    

Debug Mode

Enable debug logging for troubleshooting:

# Interactive CLI with debug
LOG_LEVEL=debug mcp_platform interactive
# Deploy with debug logging
mcp_platform deploy gitlab --config log_level=debug

For more help, see the main documentation or open an issue in the repository.