Provides comprehensive Git repository management, enabling AI models to perform cloning, branching, staging, committing, and pushing changes, as well as inspecting commit history and working tree status.
Supports interaction with GitHub repositories for cloning via HTTPS and managing changes using personal access tokens for authentication.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Git MCP Assistant Toolclone https://github.com/example/app.git and show me the file list"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Git MCP Assistant Tool
A production-ready Git MCP tool for Kamiwaza that exposes Git operations through FastMCP/HTTP transport. Enables AI models to perform comprehensive Git repository management including cloning, file operations, branching, committing, and pushing changes.
Features
File Operations (4 tools)
clone_repository - Clone repositories into isolated workspace
read_file - Read file contents from repository
write_file - Write content to files with automatic directory creation
list_files - List files and directories (with recursive option)
Git Status & Inspection (4 tools)
git_status - Get working tree status (branch, modified, staged, untracked)
git_diff_unstaged - View unstaged changes with context
git_diff_staged - View staged changes with context
git_log - Get commit history with configurable depth
Git Write Operations (5 tools)
git_add - Stage specific files for commit
create_branch - Create new branches from base branch
commit_changes - Stage and commit changes with message
git_checkout - Switch between branches
push_changes - Push commits to remote repositories
Security Model
Workspace Isolation
All operations scoped to
/app/workspacecontainer directoryPath traversal prevention with multiple validation layers
No access to files outside workspace boundaries
Input Validation
URLs: Only
https://andgit://protocols allowedGit References: Alphanumeric, dots, underscores, slashes, hyphens only
Branch Names: Additional validation (no leading hyphen, no
.locksuffix)File Paths: Relative paths within repository, no
../allowedShell Safety: Blocks all shell metacharacters (
;&|`$(){}[]<>`)
Container Security
Runs as non-root user (
appuser)Named volume (no host bind mounts)
Resource limits: 2 CPU, 2G memory
Health checks every 30 seconds
Installation
Prerequisites
Docker and Docker Compose
Git (installed in container)
Python 3.11+ (for development)
Build and Run
Using Kamiwaza Build System
Configuration
Environment Variables
Variable | Default | Required | Description |
|
| No | Workspace directory for repositories |
|
| No | Default author name for commits |
|
| No | Default author email for commits |
|
| No | Default committer name |
|
| No | Default committer email |
|
| No | HTTP server port |
|
| No | MCP endpoint port |
|
| No | MCP endpoint path |
Custom Configuration
Create a .env file:
Usage Examples
Clone Repository
Response:
Read File
Response:
Write File
Response:
Check Status
Response:
Create Branch
Commit Changes
Response:
Push Changes
MCP Protocol
Endpoint
Base URL:
http://localhost:8000MCP Path:
/mcpHealth Check:
/health
Request Format
Response Format
Testing
Run Tests
Test Categories
Security Tests (
tests/test_security.py) - Path traversal, injection preventionGit Operations Tests (
tests/test_git_operations.py) - All 13 Git operationsServer Tests (
tests/test_server.py) - Health check, tool registration
Known Limitations
No SSH Authentication - Only HTTPS cloning supported (SSH planned for future)
Single Workspace - One workspace per container instance
No Concurrent Operations - No locking for parallel Git operations
ASCII/UTF-8 Files Only - Binary files not supported for read/write operations
No Interactive Operations - No merge conflict resolution or interactive rebases
No Git Hooks - Hooks are not executed (security feature)
Architecture
Security Guarantees
✅ Workspace Isolation - All operations within
/app/workspace✅ Path Traversal Prevention - Multiple validation layers
✅ Command Injection Prevention - Regex validation + GitPython parameterization
✅ Protocol Whitelist - Only HTTPS and git:// allowed
✅ Non-Root Container - Runs as
appuser✅ Structured Errors - No sensitive path leakage
Troubleshooting
Container Won't Start
Tool Registration Issues
Permission Errors
Ensure the workspace volume has correct permissions:
Git Authentication
For private repositories, use HTTPS URLs with tokens:
Contributing
Follow the security model strictly
Add tests for all new operations
Validate against the security test suite
Update documentation for new features
License
MIT License - See LICENSE file for details
Support
For issues and questions:
GitHub Issues: kamiwaza-extensions
Documentation: Kamiwaza Docs