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 anygitorghcommand in the repository. Strictly filtered: the command must start withgitorghand 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 whenformat=pdf.pr_report— assemble a GitHub pull-request report (metadata, files, checks, diff) viagh, 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:
- Install
gitand the GitHub CLI (gh). - 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_reportand other GitHub features needghauthenticated on the host.- Ask for
format=pdfwhen you want a shareable diff or PR document rather than inline text.