Run the GitLab MCP server and tools in a Meshagent Room (Cloud/No Local Docker Needed)

1. Install prerequisites

pip install "meshagent[all]"

2. Sign up and authenticate

3. Set required environment variables

  • GITLAB_API_URL: The GitLab API endpoint (default: https://gitlab.com/api/v4)
  • GITLAB_PERSONAL_ACCESS_TOKEN: Your GitLab Personal Access Token

4. Start Meshagent service in a room

meshagent service test \
  --room=test \
  --role=agent \
  --image=meshagent/mcp-gitlab:latest \
  --env MESHAGENT_PORT=8001 \
  --env GITLAB_API_URL=https://gitlab.com/api/v4 \
  --env GITLAB_PERSONAL_ACCESS_TOKEN=<YOUR_TOKEN> \
  --port="num=8001 path=/webhook liveness=/ type=meshagent.callable" \
  --name=mcp-gitlab-service
  • This command starts a Meshagent room with the GitLab MCP server available as a callable service.
  • Meshagent rooms close if they go inactive, maximizing security and resource usage.

5. Start a chatbot in your Meshagent room with the GitLab Toolkit

meshagent chatbot join \
  --room=test \
  --agent-name=sample \
  --name=sample \
  --toolkit=mcp-gitlab
  • Multiple toolkits can be enabled for the same agent in a room.
  • A link to the room is provided in the command output—open it in your browser to chat and use tools.

Environment Variables

  • GITLAB_API_URL: The GitLab API endpoint to use (default: https://gitlab.com/api/v4)
  • GITLAB_PERSONAL_ACCESS_TOKEN: Your GitLab Personal Access Token

Tools Available

MCP Server for the GitLab API, enabling project management, file operations, and more.

Tools Provided (9)

ToolShort Description
create_branchCreate a new branch in a GitLab project
create_issueCreate a new issue in a GitLab project
create_merge_requestCreate a new merge request in a GitLab project
create_or_update_fileCreate or update a single file in a GitLab project
create_repositoryCreate a new GitLab project
fork_repositoryFork a GitLab project to your account or specified ns
get_file_contentsGet contents of a file or directory in a project
push_filesPush multiple files to a project in a single commit
search_repositoriesSearch for GitLab projects

Tool Details

create_branch

Create a new branch in a GitLab project

ParameterTypeDescription
branchstringName for the new branch
project_idstringProject ID or URL-encoded path
refstring?Source branch/commit (optional)

create_issue

Create a new issue in a GitLab project

ParameterTypeDescription
project_idstringProject ID or URL-encoded path
titlestringIssue title
assignee_idsarray?Array of user IDs (optional)
descriptionstring?Issue description (optional)
labelsarray?Array of label names (optional)
milestone_idnumber?Milestone ID (optional)

create_merge_request

Create a new merge request

ParameterTypeDescription
project_idstringProject ID or URL-encoded path
source_branchstringBranch containing changes
target_branchstringBranch to merge into
titlestringMerge request title
allow_collaborationboolean?Allow commits from upstream (optional)
descriptionstring?Description (optional)
draftboolean?Create as draft MR (optional)

create_or_update_file

Create or update a file in a GitLab project

ParameterTypeDescription
branchstringBranch to create/update file in
commit_messagestringCommit message
contentstringFile content
file_pathstringPath for new/updated file
project_idstringProject ID or URL-encoded path
previous_pathstring?Path to move or rename (optional)

create_repository

Create a new repository/project

ParameterTypeDescription
namestringRepository name
descriptionstring?Description (optional)
initialize_with_readmeboolean?Init with README.md (optional)
visibilitystring?Visibility (“public/private/internal”)

fork_repository

Fork a project

ParameterTypeDescription
project_idstringProject ID or URL-encoded path
namespacestring?Namespace (full path, optional)

get_file_contents

Get file or directory contents

ParameterTypeDescription
file_pathstringPath to file or directory
project_idstringProject ID or URL-encoded path
refstring?Branch/tag/commit (optional)

push_files

Push multiple files in one commit

ParameterTypeDescription
branchstringBranch to push to
commit_messagestringCommit message
filesarrayArray of files to push
project_idstringProject ID or URL-encoded path

search_repositories

Search for projects

ParameterTypeDescription
searchstringSearch query
pagenumber?Page for pagination (default: 1)
per_pagenumber?Results per page (default: 20)


Safer with Docker:
For more on why running MCP Servers in containers is secure and recommended, see:
The Model Context Protocol and Docker