---
description: 'APPLY when working with mcp-git package TO understand package structure, architecture, available tools, and development guidelines'
globs:
alwaysApply: true
---
# @ver0/mcp-git – Overview Rule
## Context
- This rule is injected whenever files under `packages/mcp-git` are referenced.
- It gives the AI a quick mental model of the package so it can navigate and edit confidently.
- Use it for orientation; it is not exhaustive documentation.
## Core Idea
`@ver0/mcp-git` is an **MCP (Model Context Protocol)** server exposing common Git operations as tools over **stdio**. It is *read-only to remotes* (no push/pull) and focuses on **type-safety** using **Zod** with a clean wrapper around **simple-git**.
## Key Directories
```text
src/
index.ts // Server bootstrap + tool registration
types.ts // Shared type definitions
tools/ // One file per Git tool (status.ts, commit.ts, ...)
```
## Implemented Tools
status · add · commit · log · create-branch · checkout · reset · diff · show · init
Each tool follows the same pattern:
1. Declare an `inputSchema` with Zod.
2. Execute Git logic via `simple-git`.
3. Return structured JSON ready for AI consumption.
4. Include a dedicated unit test.
## Development Guidelines
- Keep changes minimal & *pure-function* oriented.
- Validate **all** inputs.
- Throw clear, actionable errors (`ToolError`).
- Extend unit tests when behaviour changes.
- Respect project-wide code quality & comment standards.
## Gotchas
- No remote altering commands.
- All `repoPath` values must be **absolute**.