Skip to main content
Glama
Arcia125

Git Workflow Automation MCP Server

by Arcia125

complete_git_workflow

Automate Git workflows by committing files, pushing changes, creating pull requests, and merging with GitHub authentication handling.

Instructions

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

Input Schema

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

Implementation Reference

  • The primary handler function that implements the complete_git_workflow tool logic, orchestrating commit/push, PR creation, and optional auto-merge.
    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}` }; } }
  • Input schema for the complete_git_workflow tool, defining parameters and validation rules.
    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, including name, description, and schema.
    { 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 of the complete_git_workflow handler in the CallToolRequestSchema switch statement.
    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;

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