Skip to main content
Glama

git-mcp

License: MIT Node CI

Domain-neutral git utility service packaged for Model Context Protocol (MCP) agents. It exposes REST endpoints for repository status, diffs, and commits while enforcing a configurable root allowlist.

Features

  • /health endpoint reporting configured root directories.

  • /v1/git/status returning branch, upstream, ahead/behind counts, and per-file codes.

  • /v1/git/diff streaming raw git diff output for a ref.

  • Additional helpers for commit operations (extendable by downstream projects).

Installation

pnpm install git-mcp
# or
npm install git-mcp

Usage

import { createApp } from "git-mcp";

const app = createApp();
app.listen({ host: "127.0.0.1", port: 8787 });

Set MCP_GIT_ROOTS to a colon-separated list of allowed directories (defaults to process.cwd()).

Development

pnpm install
pnpm run lint
pnpm run test
pnpm run build

License

MIT — see LICENSE.

Related MCP Connectors