MCP server for local git repositories
Configuration
View docs{
"mcpServers": {
"kjozsa-git-mcp": {
"url": "https://example-mcp-server.local/mcp",
"headers": {
"GIT_REPOS_PATH": "/path/to/your/git/repositories"
}
}
}
}You can manage local Git repositories through a dedicated MCP server that exposes a set of operations for listing repositories, inspecting tags, and manipulating commits and tags. This server runs locally and can be connected to via an MCP client to perform common Git actions in a structured, scriptable way.
Connect your MCP client to the Git MCP server to access a focused set of Git operations. You can list repositories, inspect the latest tags, view commits since the last tag, create or push tags, and refresh a repository by checking out the main branch and pulling from remotes. Use these endpoints to automate Git workflows in your applications or scripts without invoking Git directly.
Prerequisites: ensure Node.js and npm or a compatible runtime are installed on your machine. You will also need tooling to run the MCP server (see steps below).
# Option 1: Install via Smithery (automatic client integration)
npx -y @smithery/cli install @kjozsa/git-mcp --client claude# Option 2: Install manually (manual server setup)
uvx install git-mcpConfiguration is provided as a JSON snippet that defines how to run the Git MCP server and where to locate your repositories.
{
"mcpServers": {
"git-mcp": {
"command": "uvx",
"args": ["git-mcp"],
"env": {
"GIT_REPOS_PATH": "/path/to/your/git/repositories"
}
}
}
}If you encounter issues, verify that the GIT_REPOS_PATH points to an existing directory containing Git repositories. If no tags are found, the repository simply hasn’t created any tags yet.
Lists all Git repositories in the configured path.
Finds the last Git tag in the specified repository, returning the tag and its date.
Lists commit messages between the last Git tag and HEAD for a given repository, with an optional maximum count.
Creates a new Git tag in the specified repository, supporting annotated or lightweight tags.
Pushes an existing tag to the default remote for the repository.
Refreshes a repository by checking out the main branch and pulling from all remotes.