Skip to main content
Glama
Arcia125

Git Workflow Automation MCP Server

by Arcia125

complete_git_workflow

Automate Git workflows by committing changes, pushing code, creating pull requests, and optionally merging. Supports conventional commits, dry runs, and handles branch management for streamlined development processes.

Instructions

Execute complete Git workflow: commit, push, create PR, and optionally merge

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autoMergeNoAutomatically merge PR after creation
baseBranchNoBase branchmain
branchNoFeature branch name
commitMessageYesCommit message (conventional format)
dryRunNoPreview without executing
filesNoFiles to commit
prBodyYesPull request description
prTitleYesPull request title
workingDirNoWorking directory path

Implementation Reference

  • The primary handler function that implements the complete_git_workflow tool logic. It coordinates committing and pushing changes, creating a pull request, and optionally auto-merging.
    async function completeGitWorkflow( files: string[], commitMessage: string, prTitle: string, prBody: string, branch?: string, baseBranch: string = 'main', autoMerge: boolean = false, workingDir?: string, dryRun: boolean = false ): Promise<WorkflowResult> { try { if (dryRun) { return { success: true, message: "Dry run: Would execute complete Git workflow", details: { files, commitMessage, prTitle, prBody, branch, baseBranch, autoMerge } }; } // Step 1: Commit and push const commitResult = await commitAndPush(files, commitMessage, branch, workingDir); if (!commitResult.success) { return commitResult; } // Step 2: Create pull request const prResult = await createPullRequest(prTitle, prBody, baseBranch, branch, workingDir); if (!prResult.success) { return prResult; } let mergeResult = null; if (autoMerge && prResult.details?.url) { // Extract PR number from URL const prMatch = prResult.details.url.match(/\/pull\/(\d+)$/); if (prMatch) { const prNumber = prMatch[1]; mergeResult = await mergePullRequest(prNumber, 'merge', true, workingDir); } } return { success: true, message: "Successfully completed Git workflow", details: { commit: commitResult.details, pullRequest: prResult.details, merge: mergeResult?.details } }; } catch (error: any) { return { success: false, message: "Git workflow failed", error: `Git workflow failed: ${error.message}` }; } }
  • JSON schema defining the input parameters and validation for the complete_git_workflow tool.
    inputSchema: { type: "object", properties: { files: { type: "array", items: { type: "string" }, description: "Files to commit" }, commitMessage: { type: "string", description: "Commit message (conventional format)" }, prTitle: { type: "string", description: "Pull request title" }, prBody: { type: "string", description: "Pull request description" }, branch: { type: "string", description: "Feature branch name" }, baseBranch: { type: "string", description: "Base branch", default: "main" }, autoMerge: { type: "boolean", description: "Automatically merge PR after creation", default: false }, workingDir: { type: "string", description: "Working directory path" }, dryRun: { type: "boolean", description: "Preview without executing", default: false } }, required: ["commitMessage", "prTitle", "prBody"]
  • src/index.ts:521-570 (registration)
    Tool registration in the ListToolsRequestSchema handler, where the tool name, description, and schema are declared.
    { name: "complete_git_workflow", description: "Execute complete Git workflow: commit, push, create PR, and optionally merge", inputSchema: { type: "object", properties: { files: { type: "array", items: { type: "string" }, description: "Files to commit" }, commitMessage: { type: "string", description: "Commit message (conventional format)" }, prTitle: { type: "string", description: "Pull request title" }, prBody: { type: "string", description: "Pull request description" }, branch: { type: "string", description: "Feature branch name" }, baseBranch: { type: "string", description: "Base branch", default: "main" }, autoMerge: { type: "boolean", description: "Automatically merge PR after creation", default: false }, workingDir: { type: "string", description: "Working directory path" }, dryRun: { type: "boolean", description: "Preview without executing", default: false } }, required: ["commitMessage", "prTitle", "prBody"] } }
  • src/index.ts:616-628 (registration)
    Dispatch/registration in the CallToolRequestSchema switch statement that routes calls to the completeGitWorkflow handler.
    case "complete_git_workflow": result = await completeGitWorkflow( (args?.files as string[]) || [], args?.commitMessage as string, args?.prTitle as string, args?.prBody as string, args?.branch as string, (args?.baseBranch as string) || 'main', (args?.autoMerge as boolean) || false, args?.workingDir as string, (args?.dryRun as boolean) || false ); break;

Other Tools

Related Tools

Latest Blog Posts

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/Arcia125/git-workflow-mcp-server'

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