Git & GitHub MCP Server

Wiki / Tools

Git & GitHub MCP Server

The Git & GitHub server lets DMJBot work with one git repository using the git and gh (GitHub CLI) tools, and produce readable diff and pull-request reports. Only git/gh commands are allowed and they run without a shell, so the tool cannot be used to execute arbitrary commands.

git and gh must already be installed and authenticated on the host, so it runs on a device via the bridge.

What DMJBot can do

  • git_command — run any git or gh command in the repository. Strictly filtered: the command must start with git or gh and runs directly (no shell), so pipes, redirection, chaining and substitution are unavailable.
  • get_diff — produce a diff report (working tree, staged, or a ref range) as Markdown, or a base64-encoded PDF when format=pdf.
  • pr_report — assemble a GitHub pull-request report (metadata, files, checks, diff) via gh, as Markdown or PDF.
  • cancel_task — cancel a running background command by force-killing its process tree.

How runs work

Fast commands return output directly. Long commands (clone, fetch, push) are detached as cancellable background tasks: DMJBot gets a task id immediately and the final output arrives once the command finishes.

This server supports background tasks.

Before you start

On the host machine:

  1. Install git and the GitHub CLI (gh).
  2. Authenticate gh (gh auth login) if you want pull-request reports and GitHub operations.

Add the server

This server runs on the machine with the repository, through the DMJBot bridge:

dmjbot-bridge install git
dmjbot-bridge configure git
dmjbot-bridge start

You can run several instances (different repositories) — give each a distinct Title so DMJBot can tell them apart.

Configuration

Field Required Default Description
Repository Folder yes Absolute path to the git repository. git and gh run with this as their working directory.
Title no Git Short label prefixed into the server name and tool descriptions so DMJBot can pick the right instance when several are connected.

Tips

  • pr_report and other GitHub features need gh authenticated on the host.
  • Ask for format=pdf when you want a shareable diff or PR document rather than inline text.

See also