Skip to main content
Glama
pratik73

git-mcp

by pratik73

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: Git Workflow Automation MCP Server

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:

  1. get_repo_info — The LLM checks your repo context

  2. prepare_merge_request — Gathers diff, log, and templates

  3. The LLM composes a PR/MR title and body (using your template if available)

  4. 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.md

  • docs/pull_request_template.md

  • PULL_REQUEST_TEMPLATE.md

GitLab:

  • .gitlab/merge_request_templates/Default.md

  • .gitlab/merge_request_templates/default.md

License

MIT

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • 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.

  • AI code review for GitHub PRs with an MCP autofix loop for Claude Code and Cursor

View all MCP Connectors

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/pratik73/git-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server