Skills · Data & AI · Agent

mcp-server-git: A git MCP server

Unverified29/40

Originally by modelcontextprotocol · MIT

Claude Code·UnknownFrontmatter could not be read
Cursor·UnknownWe have not crawled the repo tree, so we will not guess
Codex·UnknownWe have not crawled the repo tree, so we will not guess
Gemini CLI·UnknownThe spec defines no detection rule for Gemini
Copilot·UnknownWe have not crawled the repo tree, so we will not guess
npx agentalley add git

This command does not work yet — the CLI is still being built. Until then, use Raw in the reader below to take the file.

Who is stuck, and on what

The whole source

No sign-in, no blur, nothing truncated
git/SKILL.md349 lines10.8 KBRawView on GitHub
Frontmatter: no frontmatter — costs points on criterion B3.
1# mcp-server-git: A git MCP serverA5No allowed-tools declared — no way to tell what this skill may touchB3Frontmatter: no frontmatter
2 
3<!-- mcp-name: io.github.modelcontextprotocol/server-git -->
4 
5## Overview
6 
7A 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.
8 
9Source: https://github.com/modelcontextprotocol/servers/tree/main/src/git
10 
11Requires MCP Python SDK 1.x (`mcp>=1.29.0,<2`). SDK 2.0 renamed APIs this server uses. The port to v2 is in progress.
12 
13Please 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.
14 
15### Tools
16 
171. `git_status`
18 - Shows the working tree status
19 - Input:
20 - `repo_path` (string): Path to Git repository
21 - Returns: Current status of working directory as text output
22 
232. `git_diff_unstaged`
24 - Shows changes in working directory not yet staged
25 - Inputs:
26 - `repo_path` (string): Path to Git repository
27 - `context_lines` (number, optional): Number of context lines to show (default: 3)
28 - Returns: Diff output of unstaged changes
29 
303. `git_diff_staged`
31 - Shows changes that are staged for commit
32 - Inputs:
33 - `repo_path` (string): Path to Git repository
34 - `context_lines` (number, optional): Number of context lines to show (default: 3)
35 - Returns: Diff output of staged changes
36 
374. `git_diff`
38 - Shows differences between branches or commits
39 - Inputs:
40 - `repo_path` (string): Path to Git repository
41 - `target` (string): Target branch or commit to compare with
42 - `context_lines` (number, optional): Number of context lines to show (default: 3)
43 - Returns: Diff output comparing current state with target
44 
455. `git_commit`
46 - Records changes to the repository
47 - Inputs:
48 - `repo_path` (string): Path to Git repository
49 - `message` (string): Commit message
50 - Returns: Confirmation with new commit hash
51 
526. `git_add`
53 - Adds file contents to the staging area
54 - Inputs:
55 - `repo_path` (string): Path to Git repository
56 - `files` (string[]): Array of file paths to stage
57 - Returns: Confirmation of staged files
58 
597. `git_reset`
60 - Unstages all staged changes
61 - Input:
62 - `repo_path` (string): Path to Git repository
63 - Returns: Confirmation of reset operation
64 
658. `git_log`
66 - Shows the commit logs with optional date filtering
67 - Inputs:
68 - `repo_path` (string): Path to Git repository
69 - `max_count` (number, optional): Maximum number of commits to show (default: 10)
70 - `start_timestamp` (string, optional): Start timestamp for filtering commits. Accepts ISO 8601 format (e.g., '2024-01-15T14:30:25'), relative dates (e.g., '2 weeks ago', 'yesterday'), or absolute dates (e.g., '2024-01-15', 'Jan 15 2024')
71 - `end_timestamp` (string, optional): End timestamp for filtering commits. Accepts ISO 8601 format (e.g., '2024-01-15T14:30:25'), relative dates (e.g., '2 weeks ago', 'yesterday'), or absolute dates (e.g., '2024-01-15', 'Jan 15 2024')
72 - Returns: Array of commit entries with hash, author, date, and message
73 
749. `git_create_branch`
75 - Creates a new branch
76 - Inputs:
77 - `repo_path` (string): Path to Git repository
78 - `branch_name` (string): Name of the new branch
79 - `base_branch` (string, optional): Base branch to create from (defaults to current branch)
80 - Returns: Confirmation of branch creation
8110. `git_checkout`
82 - Switches branches
83 - Inputs:
84 - `repo_path` (string): Path to Git repository
85 - `branch_name` (string): Name of branch to checkout
86 - Returns: Confirmation of branch switch
8711. `git_show`
88 - Shows the contents of a commit
89 - Inputs:
90 - `repo_path` (string): Path to Git repository
91 - `revision` (string): The revision (commit hash, branch name, tag) to show
92 - Returns: Contents of the specified commit
93 
9412. `git_branch`
95 - List Git branches
96 - Inputs:
97 - `repo_path` (string): Path to the Git repository.
98 - `branch_type` (string): Whether to list local branches ('local'), remote branches ('remote') or all branches('all').
99 - `contains` (string, optional): The commit sha that branch should contain. Do not pass anything to this param if no commit sha is specified
100 - `not_contains` (string, optional): The commit sha that branch should NOT contain. Do not pass anything to this param if no commit sha is specified
101 - Returns: List of branches
102 
103## Installation
104 
105### Using uv (recommended)
106 
107When using [`uv`](https://docs.astral.sh/uv/) no specific installation is needed. We will
108use [`uvx`](https://docs.astral.sh/uv/guides/tools/) to directly run *mcp-server-git*.
109 
110### Using PIP
111 
112Alternatively you can install `mcp-server-git` via pip:
113 
114```
115pip install mcp-server-git
116```
117 
118After installation, you can run it as a script using:
119 
120```
121python -m mcp_server_git
122```
123 
124## Configuration
125 
126### Usage with Claude Desktop
127 
128Add this to your `claude_desktop_config.json`:
129 
130<details>
131<summary>Using uvx</summary>
132 
133```json
134"mcpServers": {
135 "git": {
136 "command": "uvx",
137 "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
138 }
139}
140```
141</details>
142 
143<details>
144<summary>Using docker</summary>
145 
146* Note: replace '/Users/username' with a path that you want to be accessible by this tool
147 
148```json
149"mcpServers": {
150 "git": {
151 "command": "docker",
152 "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"]
153 }
154}
155```
156</details>
157 
158<details>
159<summary>Using pip installation</summary>
160 
161```json
162"mcpServers": {
163 "git": {
164 "command": "python",
165 "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
166 }
167}
168```
169</details>
170 
171### Usage with VS Code
172 
173For quick installation, use one of the one-click install buttons below...
174 
175[![Install with UV in VS Code](https://img.shields.io/badge/VS_Code-UV-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-git%22%5D%7D) [![Install with UV in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-UV-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22mcp-server-git%22%5D%7D&quality=insiders)B1Line is 586 characters — unreadable by eye
176 
177[![Install with Docker in VS Code](https://img.shields.io/badge/VS_Code-Docker-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fworkspace%22%2C%22mcp%2Fgit%22%5D%7D) [![Install with Docker in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Docker-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=git&config=%7B%22command%22%3A%22docker%22%2C%22args%22%3A%5B%22run%22%2C%22--rm%22%2C%22-i%22%2C%22--mount%22%2C%22type%3Dbind%2Csrc%3D%24%7BworkspaceFolder%7D%2Cdst%3D%2Fworkspace%22%2C%22mcp%2Fgit%22%5D%7D&quality=insiders)B1Line is 850 characters — unreadable by eye
178 
179For manual installation, you can configure the MCP server using one of these methods:
180 
181**Method 1: User Configuration (Recommended)**
182Add the configuration to your user-level MCP configuration file. Open the Command Palette (`Ctrl + Shift + P`) and run `MCP: Open User Configuration`. This will open your user `mcp.json` file where you can add the server configuration.
183 
184**Method 2: Workspace Configuration**
185Alternatively, you can add the configuration to a file called `.vscode/mcp.json` in your workspace. This will allow you to share the configuration with others.
186 
187> For more details about MCP configuration in VS Code, see the [official VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers).
188 
189```json
190{
191 "servers": {
192 "git": {
193 "command": "uvx",
194 "args": ["mcp-server-git"]
195 }
196 }
197}
198```
199 
200For Docker installation:
201 
202```json
203{
204 "mcp": {
205 "servers": {
206 "git": {
207 "command": "docker",
208 "args": [
209 "run",
210 "--rm",
211 "-i",
212 "--mount", "type=bind,src=${workspaceFolder},dst=/workspace",
213 "mcp/git"
214 ]
215 }
216 }
217 }
218}
219```
220 
221### Usage with [Zed](https://github.com/zed-industries/zed)
222 
223Add to your Zed settings.json:
224 
225<details>
226<summary>Using uvx</summary>
227 
228```json
229"context_servers": [
230 "mcp-server-git": {
231 "command": {
232 "path": "uvx",
233 "args": ["mcp-server-git"]
234 }
235 }
236],
237```
238</details>
239 
240<details>
241<summary>Using pip installation</summary>
242 
243```json
244"context_servers": {
245 "mcp-server-git": {
246 "command": {
247 "path": "python",
248 "args": ["-m", "mcp_server_git"]
249 }
250 }
251},
252```
253</details>
254 
255### Usage with [Zencoder](https://zencoder.ai)
256 
2571. Go to the Zencoder menu (...)
2582. From the dropdown menu, select `Agent Tools`
2593. Click on the `Add Custom MCP`
2604. Add the name (i.e. git) and server configuration from below, and make sure to hit the `Install` button
261 
262<details>
263<summary>Using uvx</summary>
264 
265```json
266{
267 "command": "uvx",
268 "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
269}
270```
271</details>
272 
273## Debugging
274 
275You can use the MCP inspector to debug the server. For uvx installations:
276 
277```
278npx @modelcontextprotocol/inspector uvx mcp-server-git
279```
280 
281Or if you've installed the package in a specific directory or are developing on it:
282 
283```
284cd path/to/servers/src/git
285npx @modelcontextprotocol/inspector uv run mcp-server-git
286```
287 
288Running `tail -n 20 -f ~/Library/Logs/Claude/mcp*.log` will show the logs from the server and may
289help you debug any issues.
290 
291## Development
292 
293If you are doing local development, there are two ways to test your changes:
294 
2951. Run the MCP inspector to test your changes. See [Debugging](#debugging) for run instructions.
296 
2972. Test using the Claude desktop app. Add the following to your `claude_desktop_config.json`:
298 
299### Docker
300 
301```json
302{
303 "mcpServers": {
304 "git": {
305 "command": "docker",
306 "args": [
307 "run",
308 "--rm",
309 "-i",
310 "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
311 "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
312 "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
313 "mcp/git"
314 ]
315 }
316 }
317}
318```
319 
320### UVX
321```json
322{
323"mcpServers": {
324 "git": {
325 "command": "uv",
326 "args": [
327 "--directory",
328 "/<path to mcp-servers>/mcp-servers/src/git",
329 "run",
330 "mcp-server-git"
331 ]
332 }
333 }
334}
335```
336 
337## Build
338 
339Docker build:
340 
341```bash
342cd src/git
343docker build -t mcp/git .
344```
345 
346## License
347 
348This 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.
349 

Reviews

Installed this one?Write the first review and take the Trailblazer badge.

Reviews only open after a real install, so this is empty — and we leave it empty rather than invent one.

Alternatives

Also in Data & AI