git-mcp
Automates creating Pull Requests (GitHub) and Merge Requests (GitLab) using git CLI, repository templates, and LLM-assisted content generation from your diff and commit logs.
README
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
Tools
| Tool | Description |
|---|---|
get_repo_info |
Returns current branch, default branch, remote URL, and detected platform |
list_templates |
Lists all PR/MR templates found in the repository |
prepare_merge_request |
Gathers diff, commit log, changed files, and template data for the LLM to compose PR/MR content |
publish_merge_request |
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 build
Environment Variables
| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN |
For GitHub repos | GitHub Personal Access Token with repo scope |
GITLAB_TOKEN |
For GitLab repos | GitLab Personal Access Token with api scope |
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 templates- The 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 server
Template 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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.