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.
npx -y @Mubashwer/git-mob-mcp-serverOverview
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
# build (example for Node.js)
# run
NODE_ENV=production PORT=8080 GIT_MOB_PATH=/usr/local/bin/git-mob
Docker (recommended for isolation):
# build the image
# run the container
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:
| Name | Default | Description |
|---|---|---|
| PORT | 8080 | HTTP port to listen on |
| GIT_MOB_PATH | git-mob (on PATH) | Path to git-mob executable |
| AUTH_TOKEN | (none) | Bearer token required for API calls (if set) |
| DATA_DIR | ./data | Directory used to persist shared co-author lists |
| READ_ONLY | false | If 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
- 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:
- 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.
- 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.
- 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,