GI

Git Mob MCP Server Integrating git-mob CLI

Streamline co-author management with an MCP server integrating the git-mob CLI for seamless pair and mob programming commit workflows.

Quick Install
npx -y @Mubashwer/git-mob-mcp-server

Overview

The Git Mob MCP Server exposes git-mob functionality over a small HTTP API so editors, automation, and language-model integrations can manage commit co-authors in a consistent, machine-friendly way. It implements an MCP (Model Context Protocol) style server that wraps the git-mob CLI: the server accepts JSON requests to list, add, remove, or apply co-authors and delegates to git-mob to produce the standard “Co-Authored-By” commit trailers.

This pattern is useful for teams doing pair or mob programming who want programmatic control of co-author metadata. Instead of scripting git-mob calls in every tool, the MCP server centralizes co-author state and exposes easy endpoints for IDE extensions, CI jobs, pre-commit hooks, or AI agents to query and modify co-authors reliably.

Features

  • HTTP JSON API for git-mob operations (list/add/remove co-authors, apply co-authors to a commit)
  • Thin wrapper around the git-mob CLI — leverages the same configuration and semantics
  • Lightweight server suitable to run locally, in CI, or inside a developer’s network
  • Authentication token support and optional read-only mode
  • Simple persistence for shared co-author lists (file-backed by default)
  • Docker-friendly and easy to integrate with editor / automation workflows

Installation / Configuration

Prerequisites:

  • git and git-mob CLI installed and available on PATH (server invokes git-mob)
  • Docker (optional) or a runtime appropriate for the server code (see repository for language-specific steps)

From source (generic steps):

# clone the repository
git clone https://github.com/Mubashwer/git-mob-mcp-server.git
cd git-mob-mcp-server

# build (example for Node.js)
npm install
npm run build

# run
NODE_ENV=production PORT=8080 GIT_MOB_PATH=/usr/local/bin/git-mob npm start

Docker (recommended for isolation):

# build the image
docker build -t git-mob-mcp-server .

# run the container
docker run -d \
  -p 8080:8080 \
  -e PORT=8080 \
  -e AUTH_TOKEN="supersecret" \
  -v /path/to/data:/data \
  --name git-mob-mcp git-mob-mcp-server:latest

Example docker-compose service:

version: "3.8"
services:
  git-mob-mcp:
    image: git-mob-mcp-server:latest
    ports:
      - "8080:8080"
    environment:
      PORT: 8080
      AUTH_TOKEN: "changeme"
      DATA_DIR: /data
    volumes:
      - ./data:/data

Common environment variables:

NameDefaultDescription
PORT8080HTTP port to listen on
GIT_MOB_PATHgit-mob (on PATH)Path to git-mob executable
AUTH_TOKEN(none)Bearer token required for API calls (if set)
DATA_DIR./dataDirectory used to persist shared co-author lists
READ_ONLYfalseIf true, disables mutating endpoints

Available Resources

  • GitHub repository: https://github.com/Mubashwer/git-mob-mcp-server
  • git-mob CLI (required) — the server invokes this binary to apply commit trailers
  • Example integrations (in-repo): editor snippets, pre-commit hook examples, and a small CLI client for interacting with the MCP endpoints

API (example endpoints)

  • GET /health — basic health check
  • GET /coauthors — list configured co-authors
  • POST /coauthors — add a co-author (JSON body: { “name”: “…”, “email”: “…” })
  • DELETE /coauthors/:id — remove a co-author
  • POST /apply — apply one or more co-authors to the current repo/commit (JSON: { “coauthors”: [“id1”,“id2”], “message”: “…” })

Authentication:

  • If AUTH_TOKEN is set, include header: Authorization: Bearer <AUTH_TOKEN>

Use Cases

  1. Editor integration for pair programming
  • Scenario: Two developers pair on a feature. The editor extension queries the MCP server for a shared co-author list, presents a UI to pick co-authors, and calls /apply to append Co-Authored-By trailers before creating the commit.
  • Example:
    curl -X POST http://localhost:8080/apply \
      -H "Authorization: Bearer supersecret" \
      -H "Content-Type: application/json" \
      -d '{"coauthors":["[email protected]","[email protected]"], "message":"Add new feature"}'
    
  1. CI / automation
  • Scenario: A code generation job or bot produces a commit and needs to attribute multiple contributors automatically. CI calls the MCP server with selected co-authors and delegates the formatting to git-mob.
  • This centralizes logic and avoids copying git-mob commands into CI scripts.
  1. AI assistant / LLM workflows
  • Scenario: An LLM-based assistant that proposes commits can query available co-authors (GET /coauthors) and request that the selected authors be attached during commit creation (POST /apply). The MCP server provides a predictable, authenticated endpoint the assistant can use.
  1. Shared team co-author directory
  • The server persists a team-level list of co-authors which can be maintained through POST /coauthors and served to all developer machines. This reduces per-repo configuration drift.

Notes and Best Practices

  • The server delegates actual commit modification to the git-mob CLI. Ensure the server process has appropriate filesystem permissions to run git commands in target repositories if you plan to apply commits from the server.
  • For local developer installs, run the MCP server on localhost and protect it with a token or local firewall rules.
  • Use Docker for consistent environments and to avoid requiring developers to install server runtime dependencies.
  • Treat the server as a helper to standardize co-author management; keep business rules (who can be a co-author) in your team policy,