Skip to main content
Glama

MCP GitLab Server

by Vijay-Duke

gitlab_create_commit

Create atomic commits in GitLab with multiple file operations (create, update, delete, move) via API. Ideal for batch changes, ensuring all updates succeed or none apply. Supports up to 100 operations per commit, with optional author overrides for automated workflows.

Instructions

Create commit with file changes Returns: New commit details Use when: Making changes via API Supports: Multiple file operations in one commit

Key features:

  • Atomic: All changes or none

  • Multiple files: Up to 100 operations

  • All operations: create, update, delete, move

Example: Add feature with test { "branch": "feature/new-feature", "commit_message": "Add new feature with tests", "actions": [ {"action": "create", "file_path": "src/feature.py", "content": "..."}, {"action": "create", "file_path": "tests/test_feature.py", "content": "..."} ] }

Related tools:

  • gitlab_safe_preview_commit: Preview first

  • gitlab_list_repository_tree: Check existing files

Input Schema

NameRequiredDescriptionDefault
actionsYesFile operations for commit Type: array of objects Required: Yes Max items: 100 per commit Structure: { "action": "create" | "update" | "delete" | "move", "file_path": "string (required)", "content": "string (required for create/update)", "encoding": "text" | "base64" (optional, default: text)", "previous_path": "string (required for move)" } Examples: [ { "action": "create", "file_path": "src/config.json", "content": "{"debug": true}" }, { "action": "update", "file_path": "README.md", "content": "# Updated README\n\nNew content here" }, { "action": "delete", "file_path": "old-file.txt" }, { "action": "move", "file_path": "new-location/file.txt", "previous_path": "old-location/file.txt" } ] Use cases: - create: Add new files - update: Modify existing files - delete: Remove files - move: Rename or relocate files
author_emailNoCommit author email Type: string Format: Valid email address Optional: Yes (uses authenticated user's email) Examples: - 'john.doe@example.com' - 'bot@automated-system.com' Use case: Override for automated commits
author_nameNoCommit author name Type: string Format: Any string Optional: Yes (uses authenticated user's name) Examples: - 'John Doe' - 'Automated Bot' - 'CI System' Use case: Override for automated commits
branchYesTarget branch for commits Type: string Required: Yes Format: Existing branch name Examples: - 'main' (commit to main) - 'feature/add-login' (feature branch) - 'hotfix/security-patch' (hotfix branch) Note: Branch must exist before committing
commit_messageYesCommit message Type: string Required: Yes Format: Conventional commits recommended Structure: - First line: Summary (50-72 chars) - Blank line - Body: Detailed description - Footer: References, breaking changes Examples: 'feat: Add user authentication Implement JWT-based authentication with refresh tokens. Store tokens securely in httpOnly cookies. Closes #123'
project_idNoProject identifier (auto-detected if not provided) Type: integer OR string Format: numeric ID or 'namespace/project' Optional: Yes - auto-detects from current git repository Examples: - 12345 (numeric ID) - 'gitlab-org/gitlab' (namespace/project path) - 'my-group/my-subgroup/my-project' (nested groups) Note: If in a git repo with GitLab remote, this can be omitted

Input Schema (JSON Schema)

{ "properties": { "actions": { "description": "File operations for commit\nType: array of objects\nRequired: Yes\nMax items: 100 per commit\nStructure:\n{\n \"action\": \"create\" | \"update\" | \"delete\" | \"move\",\n \"file_path\": \"string (required)\",\n \"content\": \"string (required for create/update)\",\n \"encoding\": \"text\" | \"base64\" (optional, default: text)\",\n \"previous_path\": \"string (required for move)\"\n}\n\nExamples:\n[\n {\n \"action\": \"create\",\n \"file_path\": \"src/config.json\",\n \"content\": \"{\"debug\": true}\"\n },\n {\n \"action\": \"update\",\n \"file_path\": \"README.md\",\n \"content\": \"# Updated README\\n\\nNew content here\"\n },\n {\n \"action\": \"delete\",\n \"file_path\": \"old-file.txt\"\n },\n {\n \"action\": \"move\",\n \"file_path\": \"new-location/file.txt\",\n \"previous_path\": \"old-location/file.txt\"\n }\n]\n\nUse cases:\n- create: Add new files\n- update: Modify existing files\n- delete: Remove files\n- move: Rename or relocate files", "items": { "properties": { "action": { "enum": [ "create", "update", "delete", "move" ], "type": "string" }, "content": { "type": "string" }, "encoding": { "default": "text", "enum": [ "text", "base64" ], "type": "string" }, "file_path": { "type": "string" }, "previous_path": { "type": "string" } }, "required": [ "action", "file_path" ], "type": "object" }, "type": "array" }, "author_email": { "description": "Commit author email\nType: string\nFormat: Valid email address\nOptional: Yes (uses authenticated user's email)\nExamples:\n - 'john.doe@example.com'\n - 'bot@automated-system.com'\nUse case: Override for automated commits", "type": "string" }, "author_name": { "description": "Commit author name\nType: string\nFormat: Any string\nOptional: Yes (uses authenticated user's name)\nExamples:\n - 'John Doe'\n - 'Automated Bot'\n - 'CI System'\nUse case: Override for automated commits", "type": "string" }, "branch": { "description": "Target branch for commits\nType: string\nRequired: Yes\nFormat: Existing branch name\nExamples:\n - 'main' (commit to main)\n - 'feature/add-login' (feature branch)\n - 'hotfix/security-patch' (hotfix branch)\nNote: Branch must exist before committing", "type": "string" }, "commit_message": { "description": "Commit message\nType: string\nRequired: Yes\nFormat: Conventional commits recommended\nStructure:\n - First line: Summary (50-72 chars)\n - Blank line\n - Body: Detailed description\n - Footer: References, breaking changes\nExamples:\n 'feat: Add user authentication\n\n Implement JWT-based authentication with refresh tokens.\n Store tokens securely in httpOnly cookies.\n\n Closes #123'", "type": "string" }, "project_id": { "description": "Project identifier (auto-detected if not provided)\nType: integer OR string\nFormat: numeric ID or 'namespace/project'\nOptional: Yes - auto-detects from current git repository\nExamples:\n - 12345 (numeric ID)\n - 'gitlab-org/gitlab' (namespace/project path)\n - 'my-group/my-subgroup/my-project' (nested groups)\nNote: If in a git repo with GitLab remote, this can be omitted", "type": "string" } }, "required": [ "branch", "commit_message", "actions" ], "type": "object" }

Other Tools from MCP GitLab Server

Related Tools

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/Vijay-Duke/mcp-gitlab'

If you have feedback or need assistance with the MCP directory API, please join our Discord server