GitHub Agent
| You want | Do this |
|---|---|
Let mbm2 answer /mbm comments on a repository |
In a clone of it: mbm2 github install, then commit the workflow it writes and add the secrets it lists (Set Up) |
| Ask about an issue or a pull request | Comment /mbm <your request> (or /oc β¦) on it (Usage Examples) |
| Run the agent on a schedule or by hand | Add schedule: or workflow_dispatch: to the workflow and a PROMPT (Without A Comment) |
| Try a run from your own machine | mbm2 github run --event '<json>' --token github_pat_β¦ (Local Runs) |
What It Does
A comment that mentions /mbm or /oc starts the workflow on GitHub's runner. The workflow installs
mbm2, and mbm2 github run reads the comment, adds a π reaction, runs your request on the mBm engine in
the checked-out repository, and answers in a comment. When the agent changed files it commits them as
mbm-agent[bot] (with you as co-author) and pushes: to the pull request's branch for a pull request, or
to a new branch with a pull request that closes the issue for an issue.
comment "/mbm fix the crash" GitHub runner tui.mbm.mn
ββββββββββββββββββββββββββββββΆ mbm2 github run ββ OIDC token ββββββββββββββββββΆ /api/github
β βββ installation token ββββββββ (mbm-agent App)
β mBm engine: your request + the issue
βΌ
comment, branch, pull request (as mbm-agent[bot])
Only people with write access to the repository can start it; anyone else gets
User <login> does not have write permissions as the answer.
Set Up
- Install the mbm-agent GitHub App on the repository:
mbm2 github installopenshttps://github.com/apps/mbm-agentwhen it is not installed yet and waits until it is. - Pick the provider and the model the agent should use (
mBmis first). The runner has no mbm2 sign-in, so with mBm it uses the free models (m-free-1,m-free-2); for others pick a provider whose key you add as a secret, such as Anthropic'sANTHROPIC_API_KEY. - Commit
.github/workflows/mbm.ymland push it. - In the repository's Settings β Secrets and variables β Actions, add
MBM2_PASSWORD(your mbm2 install password) and the keys the provider needs, asinstalllists them.
$ mbm2 github install
β Install GitHub agent
β
β Installed GitHub app
β
β Select provider
β 1. mBm (recommended)
β 2. Anthropic
β¦
β Added workflow file: ".github/workflows/mbm.yml"
β
β Next steps:
1. Commit the `.github/workflows/mbm.yml` file and push
2. Add the following secrets in org or repo (acme/app) settings
- MBM2_PASSWORD
- ANTHROPIC_API_KEY
3. Go to a GitHub issue and comment `/oc summarize` to see the agent in action
The workflow it writes, with the provider and model you picked (here an Anthropic model):
name: mbm
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
mbm:
if: |
contains(github.event.comment.body, ' /oc') ||
startsWith(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, ' /mbm') ||
startsWith(github.event.comment.body, '/mbm')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: read
issues: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install mbm2
run: curl -fsSL https://tui.mbm.mn/install | bash -s -- --no-modify-path
env:
MBM2_PASSWORD: ${{ secrets.MBM2_PASSWORD }}
- name: Run mbm2
run: ~/.mbm2/bin/mbm2 github run
env:
MODEL: anthropic/<model>
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
id-token: write lets the run prove to tui.mbm.mn which repository it runs for; the backend then
hands it a short-lived token of the App for that repository only, which the run revokes when it ends.
Usage Examples
| Comment | What the agent does |
|---|---|
/mbm on an issue |
Summarizes the thread |
/oc summarize |
The same, with your words as the request |
/mbm fix this on an issue |
Works on a new branch mbm/issue<n>-β¦; when it changed files, opens a pull request Closes #<n> and comments Created PR #<m> |
/mbm add a test for this on a pull request |
Checks out the pull request's branch (a fork's too), pushes its commit there and comments |
/mbm as a review comment on a line |
Reviews that change and suggests improvements for the commented lines |
/mbm why is this slow? as a review comment |
Answers about that file and line, with the diff as context |
Every answer ends with a link to the workflow run; for a public repository (or with SHARE: true) also
a link to the shared mbm session.
Settings
Set these in the Run mbm2 step's env:.
| Variable | Meaning |
|---|---|
MODEL |
provider/model; required |
PROMPT |
Use this request instead of the comment; required for issues, schedule and workflow_dispatch events |
MENTIONS |
The words that count as a mention, comma-separated; default /mbm,/oc |
SHARE |
true shares the session, false never does; unset shares it for public repositories |
USE_GITHUB_TOKEN |
true uses the workflow's own GITHUB_TOKEN (set it in env: too) instead of the App |
OIDC_BASE_URL |
Another backend than https://tui.mbm.mn/api/github |
Without A Comment
The same command answers issues and pull_request events, and schedule and workflow_dispatch
runs, where it has no comment to read: give it a PROMPT. A scheduled or dispatched run works on a new
branch mbm/schedule-β¦ or mbm/dispatch-β¦ and opens a pull request when it changed files; otherwise the
answer is in the run's log.
on:
schedule:
- cron: "0 6 * * 1"
β¦
- name: Run mbm2
run: ~/.mbm2/bin/mbm2 github run
env:
MODEL: mbm/m-free-1
PROMPT: Update the changelog from last week's merged pull requests
Local Runs
mbm2 github run --event '<json>' --token github_pat_β¦ runs one event from your machine: the event is a
JSON object with eventName, repo (owner, repo), actor and payload, the token a fine-grained
personal access token that can push to the repository. Your git configuration is left alone.
MODEL=mbm/m-free-1 GITHUB_RUN_ID=0 mbm2 github run --token github_pat_β¦ --event '{
"eventName": "issue_comment", "actor": "you", "repo": {"owner": "acme", "repo": "app"},
"payload": {"issue": {"number": 12}, "comment": {"id": 1, "body": "/mbm summarize"}}}'
When It Fails
| You see | Why |
|---|---|
Failed to detect GitHub app installation⦠from install |
The App was not installed on this repository within two minutes |
Could not fetch an OIDC token. Make sure to add id-token: write to your workflow permissions. |
The workflow's permissions: lacks id-token: write |
App token exchange failed: 404 Not Found - GitHub App is not installed on β¦ |
Install the App on the repository |
App token exchange failed: 503 Service Unavailable - GitHub App is not configured |
The backend is not set up yet |
Comments must mention /mbmor/oc`` |
The comment has no mention, or MENTIONS names other words |
an install password is required in Install mbm2 |
The MBM2_PASSWORD secret is missing |
mbm2 github runs on Linux and macOS with the mBm engine; on Windows it is v1's command.
Published from revision f88fc66f 2026-11-30