Git MCP
The Git MCP server is a tool for managing Git operations on local repositories. With this server, you can:
List all Git repositories in the configured path
Retrieve the latest Git tag (version and date) for a repository
List commit details (hash, author, date, message) since the last tag, with an option to limit the count
Create new Git tags (lightweight or annotated) in a repository
Push existing Git tags to the default remote
Refresh a repository by checking out the main branch and pulling from all remotes
Supports configuration through environment variables that can be set directly or through a .env file, particularly for specifying the path to Git repositories.
Provides tools for managing local Git repositories, including listing repositories, retrieving and creating tags, listing commits, pushing tags to remote repositories, and refreshing repositories by pulling from remotes.
Click on "Deploy 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 list commits since the last tag in my-api-repo"
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
MCP server for managing Git operations on local repositories.
Installation
Installing via Smithery
To install Git MCP for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @kjozsa/git-mcp --client claudeInstalling Manually
uvx install git-mcpRelated MCP server: Git MCP Server
Configuration
Add the MCP server using the following JSON configuration snippet:
{
"mcpServers": {
"git-mcp": {
"command": "uvx",
"args": ["git-mcp"],
"env": {
"GIT_REPOS_PATH": "/path/to/your/git/repositories"
}
}
}
}Features and Usage
Environment Variables
GIT_REPOS_PATH: Path to the directory containing your Git repositories (required)
You can set this in your environment or create a .env file in the directory where you run the server.
Available Methods
list_repositories
Lists all Git repositories in the configured path.
Parameters: None
Returns: List of repository names
get_last_git_tag
Finds the last Git tag in the specified repository.
Parameters:
repo_name(Name of the Git repository)Returns: Dictionary with
version(tag name) anddate(tag creation date)
list_commits_since_last_tag
Lists commit messages between the last Git tag and HEAD.
Parameters:
repo_name: Name of the Git repositorymax_count(optional): Maximum number of commits to return
Returns: List of dictionaries with
hash,author,date, andmessage
create_git_tag
Creates a new git tag in the specified repository.
Parameters:
repo_name: Name of the git repositorytag_name: Name of the tag to createmessage(optional): Message for annotated tag (if not provided, creates a lightweight tag)
Returns: Dictionary with
status,version(tag name),date(tag creation date), andtype(annotated or lightweight)
push_git_tag
Pushes an existing git tag to the default remote repository.
Parameters:
repo_name: Name of the git repositorytag_name: Name of the tag to push
Returns: Dictionary with
status,remote(name of the remote),tag(name of the tag), andmessage(success message)
refresh_repository
Refreshes a repository by checking out the main branch (or master as fallback) and pulling from all remotes.
Parameters:
repo_name: Name of the git repository
Returns: Dictionary with
status,repository,branch, andpull_results(results for each remote)
Troubleshooting
Repository Not Found: Ensure
GIT_REPOS_PATHis set correctly and the repository existsNo Tags Found: The repository doesn't have any tags yet
Development
# Install dependencies
uv pip install -r requirements.txt
# Run in dev mode with Inspector
mcp dev git_mcp/server.pyTesting
The project includes two test scripts:
test_git_mcp.py- Tests the underlying Git command functionality directly, without using the MCP server.test_mcp_server.py- Tests the MCP server functionality by starting a server instance and making calls to it.
To run the tests:
# Test the Git command functionality
python test_git_mcp.py
# Test the MCP server (requires the git-mcp package to be installed)
python test_mcp_server.pyAvailable Tools
6 toolscreate_git_tagB
Create a new git tag in the repository
Args:
repo_name: Name of the git repository
tag_name: Name of the tag to create
message: Optional message for annotated tag
Returns:
Dictionary containing status and tag information
Inputs: repo_name (required), tag_name (required), message. Returns: result
get_last_git_tagA
Find the last git tag in the repository
Args:
repo_name: Name of the git repository
Returns:
Dictionary containing tag version and date
Inputs: repo_name (required). Returns: result
list_commits_since_last_tagB
List commit messages since main HEAD and the last git tag
Args:
repo_name: Name of the git repository
max_count: Maximum number of commits to return
Returns:
List of dictionaries containing commit hash, author, date, and message
Inputs: repo_name (required), max_count. Returns: result
list_repositoriesB
List all git repositories in the configured path
Returns:
List of repository names
Inputs: no named parameters. Returns: result
push_git_tagB
Push a git tag to the default remote
Args:
repo_name: Name of the git repository
tag_name: Name of the tag to push
Returns:
Dictionary containing status and information about the operation
Inputs: repo_name (required), tag_name (required). Returns: result
refresh_repositoryB
Refresh repository by checking out main branch and pulling all remotes
Args:
repo_name: Name of the git repository
Returns:
Dictionary containing status and information about the operation
Inputs: repo_name (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose with no overlap: creating tags, getting the last tag, listing commits since the last tag, listing repositories, pushing tags, and refreshing repositories. The descriptions reinforce these distinct functions, making misselection unlikely.
The naming follows a consistent verb_noun pattern (e.g., create_git_tag, list_commits_since_last_tag) with clear, descriptive names. The only minor deviation is 'refresh_repository' which uses 'refresh' instead of a more common verb like 'update', but it still fits the pattern and is understandable.
With 6 tools, this server is well-scoped for managing git repositories, focusing on tag operations and repository maintenance. Each tool serves a specific, useful function without bloat, making the count appropriate for the domain.
The toolset covers tag management and basic repository operations well, but there are notable gaps in the git domain, such as creating commits, branching, merging, or handling remotes beyond pushing tags. This limits agents from performing full git workflows, though the provided tools are coherent for their specific scope.
Maintenance
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
MCP server for siGit (sigit.si): browse repos, search code, manage PRs/issues, web search.
One MCP server for all your MCP servers: code mode, per-tool permissions, approvals and audit.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides Git version control operations for Claude, enabling comprehensive repository management. It allows users to perform tasks such as staging files, committing changes, managing branches, and handling remote operations like pushing and pulling.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides tools for interacting with Git repositories, enabling AI assistants to manage repositories, branches, commits, and files through a standardized interface.1Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA secure, git-aware MCP server for working with local repositories, enabling file management, shell commands, and full git operations within allowed directories.1GPL 3.0
- AlicenseAqualityDmaintenanceA local MCP server that provides a safe, explicit set of Git operations for version control tasks like status, diff, branching, staging, committing, fetching, merging, and pushing.1315 npmMIT