# Git Mcp Server

> A Model Context Protocol (MCP) server providing comprehensive Git operations for Claude Code and other MCP clients

- **Type:** MCP server
- **Install:** `agentstack add mcp-danyelkirsch-git-mcp-server`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [DanyelKirsch](https://agentstack.voostack.com/s/danyelkirsch)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [DanyelKirsch](https://github.com/DanyelKirsch)
- **Source:** https://github.com/DanyelKirsch/git-mcp-server

## Install

```sh
agentstack add mcp-danyelkirsch-git-mcp-server
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Git MCP Server

A Model Context Protocol (MCP) server for Git operations that provides comprehensive Git functionality to MCP clients like Claude Desktop.

## Features

- **Context-aware**: Automatically detects the current project based on working directory
- **Comprehensive Git operations**: status, branches, diffs, logs, file contents, commits, and more
- **Multi-project support**: Works seamlessly across different project directories
- **Error handling**: Proper MCP error responses
- **Branch management**: Create, switch, and manage branches
- **Remote operations**: Push, pull, and fetch from remote repositories

## Installation

### Option 1: Global Installation (Recommended)

```bash
npm install -g git-mcp-server
```

### Option 2: Local Development Setup

1. **Clone and install:**
   ```bash
   git clone https://github.com/yourusername/git-mcp-server.git
   cd git-mcp-server
   npm install
   ```

2. **Build the project:**
   ```bash
   npm run build
   ```

## Configuration

### Claude Desktop

Add this server to your Claude Desktop configuration file:

**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "git": {
      "command": "git-mcp-server",
      "args": []
    }
  }
}
```

### Other MCP Clients

For other MCP clients, use the server binary directly:

```bash
git-mcp-server
```

The server will automatically use the current working directory as the Git repository context.

## Usage

Once configured, you can use Git operations through your MCP client. The server automatically detects the Git repository in your current working directory.

### Example Commands

Ask your MCP client (like Claude) to perform Git operations:

- "What's the current git status?"
- "Show me the diff with the main branch"
- "Create a new branch called feature/new-feature"
- "Commit these changes with message 'Fix bug in parser'"
- "Push the current branch to origin"

### Testing the Server

You can test the server manually from any Git repository:

```bash
cd /path/to/your/git/repo
git-mcp-server
```

### Available Tools

#### Repository Information
- `git_status` - Get current git status
- `git_current_branch` - Get current branch name
- `git_staged_changes` - Get staged changes
- `git_working_directory` - Get current working directory info

#### File and History Operations
- `git_diff` - Show diff between branches/commits
- `git_log` - Get commit history
- `git_show_file` - Show file contents at specific commit

#### Branch Operations
- `git_branches` - List all branches
- `git_checkout` - Switch to different branch or create new branch

#### Staging and Commit Operations
- `git_add` - Add files to staging area
- `git_commit` - Create commits with message and files

#### Remote Operations
- `git_pull` - Pull changes from remote repository
- `git_fetch` - Fetch changes from remote without merging

#### Repository Management
- `git_init` - Initialize a new git repository

## Prerequisites

- Node.js 18+ 
- npm or yarn
- Git installed on your system

## Contributing

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests if applicable
5. Submit a pull request

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Project Structure

```
git-mcp-server/
├── package.json          # Project dependencies and scripts
├── tsconfig.json         # TypeScript configuration
├── src/
│   └── index.ts         # Main server implementation
├── build/
│   └── index.js         # Compiled JavaScript (generated)
└── README.md            # This file
```

## Development

- `npm run build` - Build the TypeScript code
- `npm run dev` - Watch mode for development
- `npm start` - Run the built server

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [DanyelKirsch](https://github.com/DanyelKirsch)
- **Source:** [DanyelKirsch/git-mcp-server](https://github.com/DanyelKirsch/git-mcp-server)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-danyelkirsch-git-mcp-server
- Seller: https://agentstack.voostack.com/s/danyelkirsch
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
