A Model Context Protocol server providing tools to read, search, and manipulate Git repositories programmatically via LLMs
Project description
mcp-server-git: A git MCP server
Overview
A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.
Please note that mcp-server-git is currently in early development. The functionality and available tools are subject to change and expansion as we continue to develop and improve the server.
Tools
-
git_status- Shows the working tree status
- Input:
repo_path(string): Path to Git repository
- Returns: Current status of working directory as text output
-
git_diff_unstaged- Shows changes in working directory not yet staged
- Input:
repo_path(string): Path to Git repository
- Returns: Diff output of unstaged changes
-
git_diff_staged- Shows changes that are staged for commit
- Input:
repo_path(string): Path to Git repository
- Returns: Diff output of staged changes
-
git_commit- Records changes to the repository
- Inputs:
repo_path(string): Path to Git repositorymessage(string): Commit message
- Returns: Confirmation with new commit hash
-
git_add- Adds file contents to the staging area
- Inputs:
repo_path(string): Path to Git repositoryfiles(string[]): Array of file paths to stage
- Returns: Confirmation of staged files
-
git_reset- Unstages all staged changes
- Input:
repo_path(string): Path to Git repository
- Returns: Confirmation of reset operation
-
git_log- Shows the commit logs
- Inputs:
repo_path(string): Path to Git repositorymax_count(number, optional): Maximum number of commits to show (default: 10)
- Returns: Array of commit entries with hash, author, date, and message
Installation
Using uv (recommended)
When using uv no specific installation is needed. We will
use uvx to directly run mcp-server-git.
Using PIP
Alternatively you can install mcp-server-git via pip:
pip install mcp-server-git
After installation, you can run it as a script using:
python -m mcp_server_git
Configuration
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
Using uvx
"mcpServers": {
"git": {
"command": "uvx",
"args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}
}
Using pip installation
"mcpServers": {
"git": {
"command": "python",
"args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
}
}
Usage with Zed
Add to your Zed settings.json:
Using uvx
"context_servers": [
"mcp-server-git": {
"command": "uvx",
"args": ["mcp-server-git"]
}
],
Using pip installation
"context_servers": {
"mcp-server-git": {
"command": "python",
"args": ["-m", "mcp_server_git"]
}
},
Debugging
You can use the MCP inspector to debug the server. For uvx installations:
npx @modelcontextprotocol/inspector uvx mcp-server-git
Or if you've installed the package in a specific directory or are developing on it:
cd path/to/servers/src/git
npx @modelcontextprotocol/inspector uv run mcp-server-git
License
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_server_git-0.5.1.tar.gz.
File metadata
- Download URL: mcp_server_git-0.5.1.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7445dffcb185b6209ca09a52b1f2dd9b6942d59f458123e1db605073ea797fd8
|
|
| MD5 |
ea34e015a1970b2e2fc655e446d6ce10
|
|
| BLAKE2b-256 |
8c702ba8bb4ca2a67fc82137ed74835ef60484a96256d1798eae64ac57713073
|
Provenance
The following attestation bundles were made for mcp_server_git-0.5.1.tar.gz:
Publisher:
python.yml on modelcontextprotocol/servers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_server_git-0.5.1.tar.gz -
Subject digest:
7445dffcb185b6209ca09a52b1f2dd9b6942d59f458123e1db605073ea797fd8 - Sigstore transparency entry: 151463441
- Sigstore integration time:
-
Permalink:
modelcontextprotocol/servers@e7596abf43d424c94c06dcaa1a5049f99292f4df -
Branch / Tag:
refs/tags/0.5.1 - Owner: https://github.com/modelcontextprotocol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@e7596abf43d424c94c06dcaa1a5049f99292f4df -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcp_server_git-0.5.1-py3-none-any.whl.
File metadata
- Download URL: mcp_server_git-0.5.1-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
291aa9b8e76a61b58eee2394c98b51254c19d5aa4a03ed9500f5650e965caa44
|
|
| MD5 |
11d5284906b23dc685c5fa9ada995a45
|
|
| BLAKE2b-256 |
5089d5508fadfe15bcb1756e69b916b8274c89938fc9695d9dac7d2a51bb48c3
|
Provenance
The following attestation bundles were made for mcp_server_git-0.5.1-py3-none-any.whl:
Publisher:
python.yml on modelcontextprotocol/servers
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcp_server_git-0.5.1-py3-none-any.whl -
Subject digest:
291aa9b8e76a61b58eee2394c98b51254c19d5aa4a03ed9500f5650e965caa44 - Sigstore transparency entry: 151463443
- Sigstore integration time:
-
Permalink:
modelcontextprotocol/servers@e7596abf43d424c94c06dcaa1a5049f99292f4df -
Branch / Tag:
refs/tags/0.5.1 - Owner: https://github.com/modelcontextprotocol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python.yml@e7596abf43d424c94c06dcaa1a5049f99292f4df -
Trigger Event:
release
-
Statement type: