git-mcp
Click on "Deploy 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., "@git-mcp Create a pull request for my current branch"
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.
git-mcp
An stdio-based MCP server that automates creating Pull Requests (GitHub) and Merge Requests (GitLab) using git CLI, repository templates, and LLM-assisted content generation.
Features
π Auto-detects platform (GitHub / GitLab) from your git remote URL
π Template-aware β uses your repo's PR/MR templates if available
π€ LLM-powered β when no template exists, the MCP client generates context-aware PR/MR content from your diff and commit log
π One-step publish β creates PRs/MRs directly via GitHub & GitLab APIs
Related MCP server: GitHub PR Review Server
Tools
Tool | Description |
| Returns current branch, default branch, remote URL, and detected platform |
| Lists all PR/MR templates found in the repository |
| Gathers diff, commit log, changed files, and template data for the LLM to compose PR/MR content |
| Creates a PR (GitHub) or MR (GitLab) with the given title and body |
Setup
Prerequisites
Node.js v18+
Git CLI installed and accessible in
PATH
Install
git clone https://github.com/your-username/git-mcp.git
cd git-mcp
npm install
npm run buildEnvironment Variables
Variable | Required | Description |
| For GitHub repos | GitHub Personal Access Token with |
| For GitLab repos | GitLab Personal Access Token with |
Configure MCP Client
Add to your MCP client configuration (e.g. Claude Desktop claude_desktop_config.json):
{
"mcpServers": {
"git-mcp": {
"command": "node",
"args": ["C:/path/to/git-mcp/dist/index.js"],
"env": {
"GITHUB_TOKEN": "ghp_your_token_here",
"GITLAB_TOKEN": "glpat-your_token_here"
}
}
}
}Usage
Once configured, ask your MCP client (e.g. Claude) something like:
"Create a pull request for my current branch"
The workflow:
get_repo_infoβ The LLM checks your repo contextprepare_merge_requestβ Gathers diff, log, and templatesThe LLM composes a PR/MR title and body (using your template if available)
publish_merge_requestβ Publishes to GitHub or GitLab
Development
npm run dev # Watch mode β recompiles on changes
npm run build # One-time build
npm start # Run the serverTemplate Discovery
The server searches for templates in these locations:
GitHub:
.github/pull_request_template.md.github/PULL_REQUEST_TEMPLATE.md.github/PULL_REQUEST_TEMPLATE/default.mddocs/pull_request_template.mdPULL_REQUEST_TEMPLATE.md
GitLab:
.gitlab/merge_request_templates/Default.md.gitlab/merge_request_templates/default.md
License
MIT
Available Tools
4 toolsget_repo_infoA
Get information about the current git repository: current branch, default branch, remote URL, and detected platform (github/gitlab).
Inputs: cwd (required).
list_templatesA
List all available Pull Request / Merge Request templates found in the repository.
Inputs: cwd (required).
prepare_merge_requestA
Gather all the data needed to create a Pull Request or Merge Request:
Git diff between the current branch and the default branch
Commit log
List of changed files
PR/MR template (if one exists in the repo)
Repository metadata (platform, owner, repo)
The returned data is intended for the LLM to use when composing the PR/MR title and body. If a template is found, the LLM should fill it in. Otherwise, the LLM should generate appropriate content based on the diff and commit log.
Inputs: cwd (required), base.
publish_merge_requestB
Publish a Pull Request (GitHub) or Merge Request (GitLab) with the given title and body. The platform is auto-detected from the git remote URL. Auth tokens are read from environment variables: GITHUB_TOKEN or GITLAB_TOKEN.
Inputs: cwd (required), body (required), title (required), base, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: repo info, templates, preparing data for an MR, and publishing. The prepare_merge_request and publish_merge_request pair is well-separated (gather vs. send), and list_templates is distinct from prepare's inclusion of template data. Only minor ambiguity exists between list_templates and prepare_merge_request, as both deal with templates, but their roles differ.
Names follow a consistent verb_noun pattern (get_repo_info, list_templates, prepare_merge_request, publish_merge_request). The pattern is slightly inconsistent in that get and list are different verbs used for the same semantic family (repo vs. templates), but overall verbs are descriptive and the style is uniform.
Four tools is a reasonable, focused scope for a git MR/PR workflow helper. It's slightly thin in the sense that there's no tool for fetching the default branch or updating an existing MR, but the count is appropriate for the stated purpose of composing and publishing merge requests.
The surface covers the core workflow of creating and publishing an MR/PR, which is good. However, there are notable gaps: no tool to update/edit an existing MR, no tool to list existing MRs, and no way to inspect or merge a published MR. The workflow is complete for creation but lacks management lifecycle operations.
Related MCP Connectors
AI-native git hosting β repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.β¦
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Generate changelogs, release emails, help-center articles, banners, and social posts from commits.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA lightweight tool that uses Mistral AI running locally to generate structured GitHub pull request descriptions from git diffs.-
- AlicenseNot gradedqualityDmaintenanceEnables automated GitHub Pull Request reviews using local Ollama, Cursor CLI, or Gemini CLI as AI providers. Supports customizable review prompts, comprehensive PR analysis, and optional auto-posting of reviews to GitHub.16 npm5MIT
- AlicenseBqualityDmaintenanceConnects LLMs to GitHub and GitLab to analyze pull and merge requests for logic, security, and architectural alignment. It provides tools for fetching diffs, file contents, and project metadata, alongside guided prompts for professional code reviews.1018 npmISC
- AlicenseAqualityDmaintenanceGenerates commit messages, PR titles and descriptions, and release notes from git changes, with automatic domain detection for appropriate PR templates.1013 npm1MIT