mcp-git
# mcp-git - Git MCP Server
[](https://www.npmjs.com/package/mcp-git)
[](https://bun.sh)
[](LICENSE)
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.
## MCP Server Usage
This package is designed to be used as an MCP server with clients like Claude Desktop. Here's how to configure it:
### Basic Configuration
Add this to your MCP client configuration:
```json
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "mcp-git"]
}
}
}
```
### Advanced Configuration
For custom settings:
```json
{
"mcpServers": {
"git": {
"command": "npx",
"args": ["-y", "mcp-git"]
}
}
}
```
## Installation Options
### From Source
1. Clone this repository
2. Install dependencies:
```bash
bun install
```
3. Build:
```bash
bun run build
```
4. Run:
```bash
bun run start
```
## Available Git Tools
The server provides these MCP-accessible Git operations:
### Repository Operations
- `git_status` - Show working tree status
- `git_init` - Initialize new repository
- `git_log` - View commit history (with `max_count` parameter)
### Change Management
- `git_diff_unstaged` - View unstaged changes
- `git_diff_staged` - View staged changes
- `git_diff` - Compare with branch/commit
- `git_add` - Stage files
- `git_reset` - Unstage changes
- `git_commit` - Create commit
### Branch Operations
- `git_create_branch` - Create new branch
- `git_checkout` - Switch branches
### Content Inspection
- `git_show` - View commit contents
## Development
### Prerequisites
- [Bun](https://bun.sh) v1.2.8 or later
- Git installed system-wide
### Building
```bash
bun run build
```
### Testing
```bash
bun test
```
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss proposed changes.
## License
[MIT](LICENSE)
TDQS
Scored across 15 tools
Every tool has a clearly distinct purpose and targets a different Git operation. There is no ambiguity between tools like git_diff, git_diff_staged, and git_diff_unstaged, or between git_stash, git_stash_apply, and git_stash_pop.
All tools follow the consistent 'git_<verb>' pattern with snake_case. The naming is uniform and predictable, making it easy for an agent to infer tool behavior from its name.
With 15 tools, the server is well-scoped for a Git client. It covers essential operations without being overwhelming or too sparse. Each tool serves a clear purpose in the standard Git workflow.
The tool set covers core local Git operations such as staging, committing, branching, diffing, stashing, and log viewing. However, it lacks tools for remote operations like push, pull, fetch, and merge, which are important for typical Git usage and might require agents to work around.