# Git Workflow Guardian MCP for AI Agents AI Agent Connect

> Git Workflow Guardian enforces strict repository hygiene and security rules. It acts as an automated gatekeeper for your git operations, checking branch naming conventions, validating commit message formats, and ensuring all actions comply with your organization's specific workflow policies to prevent messy or insecure codebases.

## Overview
- **Category:** security
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_4h0yqvDpCD4Y7sxVHlqSsgvZ8eZ78b2jis0qQ08r/ai-agent-connect
- **Tags:** git, workflow, enforcement, devops, repository

## Description

Managing a shared codebase often feels like a constant battle against messy commit messages and rogue branch names. You spend half your time in pull requests pointing out that a branch name doesn't follow the team standard or that a commit is missing a required ticket number. This MCP changes that by acting as an automated enforcement engine for your git workflow. Instead of manual policing, your AI client can now check every action against your specific organizational rules before anything is pushed or merged. It keeps your repository clean by verifying that branch names are consistent and that commit messages include the necessary issue references. You can also use it to block prohibited actions, like pushing directly to a protected branch, ensuring security isn't bypassed by accident. By connecting this to your development environment through the Vinkius catalog, you turn your agent into a vigilant guardian that maintains repository hygiene without you having to manually audit every single line of git metadata.

## Tools

### audit_commit_integrity
Checks if commit messages follow your required standards and include necessary issue references. It helps maintain a clean and searchable git history.

### check_branch_naming
Verifies that branch names comply with your organizational naming rules. This prevents messy or confusing branch lists in your repository.

### validate_git_action
Checks if a specific git operation follows your predefined workflow rules. It prevents accidental security breaches or policy violations.

## Prompt Examples

**Prompt:** 
```
Is this git action allowed: a push to the main branch?
```

**Response:** 
```
No, pushing to the main branch is prohibited by the protected branch rule.

**Status:** ❌ Denied
**Reason:** The `main` branch is configured as a protected branch. Direct pushes are not permitted.
```

**Prompt:** 
```
Check if the branch name 'feature/login-fix' is valid.
```

**Response:** 
```
Yes, the branch name `feature/login-fix` follows the required naming convention.

**Validation Result:** ✅ Valid
**Pattern Matched:** `feature/*`
```

**Prompt:** 
```
Validate this commit message: 'feat: add user auth [ISSUE-123]'
```

**Response:** 
```
The commit message is valid and includes the required issue reference.

| Component | Status |
| :--- | :--- |
| Format | ✅ Correct |
| Issue Reference | ✅ Found (ISSUE-123) |
```

## Capabilities

### Enforce branch naming standards
Your agent checks that every new branch follows your team's specific naming conventions.

### Validate commit message formats
It ensures all commit messages meet your standards and include the necessary issue references.

### Block prohibited git actions
Your agent prevents unauthorized operations like pushing to protected branches.

### Audit repository hygiene
It scans your git history and current state to ensure everything stays compliant with your rules.

### Verify workflow compliance
It checks if any specific git operation violates the rules set by your organization.

## Use Cases

### Preventing accidental pushes to main
A developer tries to push a quick fix directly to a protected branch, but the agent blocks it using validate_git_action.

### Standardizing commit messages
An engineer writes a vague commit message, and the agent flags it using audit_commit_integrity because it lacks a Jira ticket ID.

### Cleaning up branch sprawl
A team member creates a branch named 'test-123', and the agent rejects it via check_branch_naming for not following the feature/ prefix rule.

### Automating compliance checks
A DevOps lead uses the agent to run a sweep of the entire repository to ensure all recent activity matches company policy.

## Benefits

- Stop manual audits by using audit_commit_integrity to automatically check commit messages for required issue links.
- Prevent messy repos by using check_branch_naming to ensure every branch follows your team's naming patterns.
- Keep protected branches safe by using validate_git_action to block unauthorized pushes or merges.
- Reduce PR review time because your agent catches naming and formatting errors before you even submit code.
- Maintain a consistent git history that makes searching for specific changes much easier for the whole team.

## How It Works

The bottom line is your agent becomes an automated compliance officer for your git repository.

1. Connect the MCP to your preferred AI client via Vinkius.
2. Define your organization's branch, commit, and protection rules.
3. Ask your agent to check or validate any git action against those rules.

## Frequently Asked Questions

**How can Git Workflow Guardian help my git repository?**
It acts as an automated gatekeeper that checks your branch names, commit messages, and git actions against your specific team rules to keep everything organized and secure.

**Can I use Git Workflow Guardian with my existing git rules?**
Yes. You define your own organizational rules for branch naming and commit formats, and the MCP ensures your agent follows them strictly.

**Will Git Workflow Guardian prevent bad commits?**
It helps you catch bad commits by validating that they follow your required formats and include necessary issue references before they are finalized.

**Does Git Workflow Guardian work with my AI client?**
Yes, once connected through Vinkius, you can use it directly within any MCP-compatible client like Claude, Cursor, or VS Code.

**Can this MCP help with repository security?**
Absolutely. It can prevent unauthorized operations, such as pushing directly to protected branches, by validating every git action against your security policies.

**What does this tool validate?**
It validates git actions like commits and pushes, branch naming conventions, and commit message integrity using `validate_git_action` and `audit_commit_integrity`.

**How can I check if my branch name is valid?**
You can use the `check_branch_naming` tool to verify if your proposed branch name follows the required organizational regex patterns.

**Does it enforce conventional commits?**
Yes, the `audit_commit_integrity` tool ensures that commit messages adhere to conventional commit formats and include necessary issue references.