@jkumonpm/git-assistant-mcp
v1.1.1
Published
Git assistant MCP server — structured git operations for AI clients
Maintainers
Readme
git-assistant-mcp
Git assistant MCP server. Structured git operations for AI clients.
No shell. No cross-platform escaping hell. Pure structured JSON.
Install
npm install -g git-assistant-mcpUsage
Claude Desktop / Cursor / OpenCode
Add to your MCP config:
{
"mcpServers": {
"git-assistant": {
"command": "npx",
"args": ["-y", "git-assistant-mcp"]
}
}
}Tools
git_status — Working Tree Status
Get the working tree status. Returns staged, unstaged, and untracked files.
Input:
{
"repo_path": "/path/to/repo"
}Output:
{
"branch": "main",
"staged": ["M src/index.ts"],
"unstaged": [" M src/index.ts"],
"untracked": ["new-file.txt"]
}git_diff — Show Changes
Show changes between commits, working tree, or staged files.
Input:
{
"repo_path": "/path/to/repo",
"file": "src/index.ts",
"staged": false
}Output:
diff --git a/src/index.ts b/src/index.ts
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,3 +1,4 @@
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'
+import { z } from 'zod'git_log — Commit History
Show commit history.
Input:
{
"repo_path": "/path/to/repo",
"max_count": 5,
"file": "src/index.ts"
}Output:
{
"commits": [
{
"hash": "abc123...",
"shortHash": "abc1234",
"subject": "feat: add new feature",
"authorName": "John Doe",
"authorEmail": "[email protected]",
"authorDate": "2024-01-15 10:30:00 +0800"
}
]
}git_branch_list — List Branches
List all branches. Shows current branch and remote branches.
Input:
{
"repo_path": "/path/to/repo",
"remote": false
}Output:
{
"branches": [
{ "name": "main", "current": true },
{ "name": "develop", "current": false }
]
}git_commit — Create Commit
Stage files and create a commit.
Input:
{
"repo_path": "/path/to/repo",
"message": "feat: add new feature",
"files": ["src/index.ts"],
"amend": false
}Output:
{
"success": true,
"hash": "abc123...",
"message": "[main abc1234] feat: add new feature"
}git_stash — Stash Changes
Stash changes. Actions: push, pop, list, clear, apply.
Input:
{
"repo_path": "/path/to/repo",
"action": "push",
"message": "WIP: working on feature",
"stash_index": 0
}Output:
{
"success": true,
"action": "push",
"output": "Saved working directory and index state On main: WIP: working on feature"
}Design
| Feature | Why |
|---------|-----|
| Zero runtime deps | Only @modelcontextprotocol/sdk and zod |
| Uses spawn not exec | Proper argument handling, no shell injection |
| Structured output | AI reads status/diff/log precisely |
| Cross-platform | Works on Windows, macOS, Linux |
| Safe commit | Stage specific files before commit |
License
MIT
