-
Couldn't load subscription status.
- Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Description
The current mcp__git__git_add tool has significant limitations that make it difficult to handle common git workflows:
Current Issues:
- ❌ Cannot add deleted files - Returns "Files not found" error
- ❌ No batch operation support - No equivalent to
git add -Aorgit add -u - ❌ Requires explicit file paths - No wildcard or pattern support
- ❌ Cannot stage directory deletions - Manual workarounds required
Observed Error Example:
❌ Files not found: reports/health_score.txt, reports/maintenance_needed.txt, reports/project_health.json
Proposed Solution
Extend existing tool with new parameters:
mcp__git__git_add({
repo_path: string,
files?: string[], // existing
add_all?: boolean, // equivalent to git add -A
update_only?: boolean, // equivalent to git add -u
include_deletions?: boolean, // handle deleted files
patterns?: string[] // glob patterns like "*.py"
})Use Cases
1. CI Fix Workflows
// Stage all changes including deletions (common in CI cleanup)
mcp__git__git_add({repo_path: ".", add_all: true})
// Stage only tracked file updates and deletions
mcp__git__git_add({repo_path: ".", update_only: true})2. Cleanup Operations
// Stage deletion of temporary files
mcp__git__git_add({
repo_path: ".",
files: ["reports/temp.txt", "cache/old.json"],
include_deletions: true
})Impact
This was the primary blocker during a recent CI fix session, forcing workarounds like:
- Manual file deletion instead of proper git staging
- Using bash commands, defeating MCP integration benefits
- Complex multi-step operations for simple batch adds
Implementation Notes
- Maintain backward compatibility with existing
filesparameter - Add validation for conflicting parameters (e.g.,
add_all+files) - Provide clear error messages for invalid combinations
Related
- Complements git clean support (Add git clean support for __pycache__ directories #24)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request