ai-git
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ai-gitaicommit with hint about fixing typo"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ai-git-mcp
An MCP server that reimplements the ai-git-fish
workflows — aicommit, aibranch, aipr — with Leantime integration, without fish shell and
without DeepSeek. Wire it up once and the same workflows work in Claude Code and Codex.
Why no AI inside the server?
ai-git-fish calls DeepSeek to generate commit messages and PR text. But Claude Code and Codex
are already the AI. So this server contains no LLM: every tool is deterministic. The agent
reads the diff/ticket through a tool, writes the prose itself, and passes it into the next tool.
No paying for AI twice, no losing context, and the agent understands your code better than DeepSeek.
Agent (Claude/Codex) ──calls tools──> ai-git-mcp ──> git / gh CLI
│ │
└── writes commit/PR/slug └──> Leantime JSON-RPC (/api/jsonrpc)Requirements
On the machine that runs the agent:
Node.js ≥ 18 (
node -v)git in
PATH(git --version)GitHub CLI
gh, authenticated (gh auth login) — needed only foraiprA Leantime instance + API key — needed only for the ticket tools
You do not need to clone this repo. npx fetches and builds it for you (see below).
Installation
1. Get your Leantime credentials
Value | Where to find it |
| Your Leantime URL, e.g. |
| Leantime → your profile → API Keys → generate one |
| Your numeric user id (in your profile URL, or ask an admin) |
2. Add the server to your client
Pick your client. The npx -y github:BenBen2109/ai-git-mcp command downloads this repo, builds
it once, caches it, and runs it — no manual clone or build.
Option A — one command:
claude mcp add ai-git \
-e LEANTIME_BASE_URL=https://leantime.example.com \
-e LEANTIME_API_KEY=your-key \
-e LEANTIME_USER_ID=123 \
-- npx -y github:BenBen2109/ai-git-mcpOption B — edit .mcp.json (project root) or ~/.claude.json (global):
{
"mcpServers": {
"ai-git": {
"command": "npx",
"args": ["-y", "github:BenBen2109/ai-git-mcp"],
"env": {
"LEANTIME_BASE_URL": "https://leantime.example.com",
"LEANTIME_API_KEY": "your-key",
"LEANTIME_USER_ID": "123"
}
}
}
}Edit ~/.codex/config.toml:
[mcp_servers.ai-git]
command = "npx"
args = ["-y", "github:BenBen2109/ai-git-mcp"]
env = { LEANTIME_BASE_URL = "https://leantime.example.com", LEANTIME_API_KEY = "your-key", LEANTIME_USER_ID = "123" }Pin a version by appending a tag/branch/commit:
github:BenBen2109/ai-git-mcp#v1.0.0. The first launch is slower (it builds once); later launches use the npx cache.
3. Restart and verify
Restart the client (or reload the MCP config). Then check the server is connected:
Claude Code: run
/mcp—ai-gitshould show 9 tools and 3 prompts.Codex: the
ai-gittools appear in the tool list at startup.
Configuration (env)
Variable | Required | Meaning |
| ticket tools | e.g. |
| ticket tools | sent as the |
| recommended | numeric id used to filter your tickets |
| optional | max tickets listed (default 30) |
The git-only tools (git_status, git_staged_diff, git_commit, git_log_for_pr,
git_create_branch, git_create_or_update_pr, git_undo_last_commit) work without any Leantime
config. See .env.example.
Usage — slash commands
Three workflows, exposed as MCP prompts. In Claude Code type the slash command; in Codex just say it in plain language (e.g. "run aicommit") — the agent calls the same tools either way.
/ai-git:aicommit [hint] — stage-aware commit
Reads your staged diff, writes a Conventional Commit message, shows it to you, then commits.
# stage what you want first
git add -p
# then, in the agent:
/ai-git:aicommit
/ai-git:aicommit drop the debug logging # optional hint to steer the message→ git_staged_diff → (agent writes message) → git_commit
/ai-git:aibranch [type] — branch from a Leantime ticket
Lists your tickets, you pick one, it creates/switches to type/<id>-<slug> (slug auto-derived
from the ticket headline, Vietnamese diacritics handled).
/ai-git:aibranch # type defaults to "feat" → feat/1234-add-login
/ai-git:aibranch fix # → fix/1234-add-login→ leantime_list_my_tickets → (you pick) → git_create_branch
/ai-git:aipr [hint] — open or update a GitHub PR
Pushes the branch and creates (or updates) its PR with an AI-written title and body. If the branch
is named type/<id>-<slug>, the Leantime ticket is auto-linked and embedded.
/ai-git:aipr
/ai-git:aipr focus on the migration # optional hint to steer the PR→ git_status + git_log_for_pr → (agent writes title/body) → git_create_or_update_pr
Tools reference
All tools return JSON. Each accepts an optional repo_path (defaults to the server's working
directory) unless noted.
Leantime
Tool | Params | Returns |
|
|
|
|
|
|
Git — read-only
Tool | Params | Returns |
|
|
|
|
|
|
|
|
|
Git — write
Tool | Params | Returns |
|
|
|
|
|
|
|
|
|
|
|
|
Notes:
git_commitfails with an actionable message if nothing is staged.git_create_branchauto-derives the slug from the ticket headline whenslugis omitted.git_create_or_update_prpushesHEAD, detects an existing PR for the branch (edits it) or creates a new one, and appends the ticket markdown block whenticket_idis given.git_undo_last_commitis a soft reset — your changes stay staged, nothing is lost.
Troubleshooting
Symptom | Fix |
| Set |
| Run the agent from inside a git repo, or pass |
|
|
| Run |
| Expected — it builds once, then caches. Pin a tag to stabilise. |
Slash commands missing in Codex | Codex prompt support varies; just say "run aicommit" instead. |
Local development
git clone https://github.com/BenBen2109/ai-git-mcp
cd ai-git-mcp
npm install
npm run build # → dist/index.js
npm test # vitest
npm run dev # tsx watch (live reload)Local-path config (instead of npx):
{ "mcpServers": { "ai-git": {
"command": "node",
"args": ["/absolute/path/to/ai-git-mcp/dist/index.js"],
"env": { "LEANTIME_BASE_URL": "...", "LEANTIME_API_KEY": "...", "LEANTIME_USER_ID": "..." }
}}}Credits
Leantime client and ticket formatting (HTML/entity decoding, status labels, PR markdown block)
are ported from ai-git-fish by DucTam2411.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/BenBen2109/ai-git-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server