# GitHub MCP server and CLI, read-only, offline issues (/en/docs/gthb)

Keep the issues of your GitHub repositories, with their comments and READMEs, on your computer, where your AI agent
finds them at once, even without the internet. A question to your agent costs no request to GitHub, and nothing in
GitHub ever changes, because the tool only reads.

Your agent tells you which open issues in `octo-org/app` nobody has taken, what the comments on `octo-org/app#12`
decided, or what a repository's README says about setup. It names each issue by its key, such as `octo-org/app#12`.
An open issue assigned to you becomes a [task](/llms.mdx/docs/tasks/content.md) in the local store, next to the tasks from your chats.

`gthb` is a command-line tool for your terminal and an MCP server for apps that connect to MCP servers. It copies the
repositories you choose into the WireCat local store, so `wcat` finds an issue next to your mail and chats. You need a
fine-grained personal access token from GitHub, read-only, for one user or organization.

**On this page:**

1. [What you get](#what-you-get)
2. [How it works](#how-it-works)
3. [Make a read-only token](#make-a-read-only-token)
4. [Connect and copy your repositories](#connect-and-copy-your-repositories)
5. [What it does not do yet](#what-it-does-not-do-yet)
6. [Find a guide for your task](#find-a-guide-for-your-task)

## What you get [#what-you-get]

- **Issues without the internet.** List issues by repository, state, label or assignee, open one with its comments,
  and find issues and comments by their words, or by meaning after `sync --embed`. In a list, a repository is
  `team:` and a milestone is `sprint:`, the same words as in every WireCat issue tracker.
- **One issue with what it needs.** `issues context octo-org/app#12` gives the issue with its newest comments,
  milestone, labels and assignee, and names what it cannot show yet, such as the pull requests that close it.
- **READMEs next to the issues.** The README of each repository you choose is a document in the store, and
  `documents show` reads it. A README that did not change costs none of GitHub's rate limit on the next sync.
- **Your issues become your tasks.** After each sync, every open issue assigned to you is a task. The task closes
  when the issue is closed, deleted or goes to someone else. `issues assign octo-org/app#12` makes any other issue
  your task too. Nothing is written to GitHub.
- **The rest of GitHub, read live.** Pull requests, commits, releases and the other read operations of GitHub's REST
  API are commands in the `api` group, such as `gthb work api pulls list --owner octo-org --repo app`. Operations that return code, file contents
  or secrets are left out, and diffs are removed from every answer.
- **Nothing changes in GitHub.** No command writes to GitHub. `gthb` takes only a fine-grained token and refuses a
  classic or OAuth token, which could write to every repository you can.
- **Your agent connected.** Install the tool's skill for a terminal agent such as Claude Code or Codex, or serve the
  tool over MCP to an app that connects to MCP servers.

The token stays in your system keyring, or in a private file where there is no keyring. You give it to the tool hidden
or on stdin, never as an argument, so it does not end up in your shell history. Read more in
[security](/llms.mdx/docs/gthb/security/content.md).

## How it works [#how-it-works]

- **A local store on your computer.** `gthb` keeps the issues of the repositories you choose, with their comments, labels,
  milestones and assignees, and each repository's README, in the local store, one file on your computer that every
  WireCat tool shares. Lists and search read the local store, not GitHub.
- **You choose the repositories.** `repos add octo-org/app` adds a repository and `repos remove` takes it out. The
  issues of a removed repository leave lists and search, and come back when you add it again.
- **A sync brings in changes.** The first sync copies every issue. After that it reads only what changed, and once a
  day it notices what was deleted on GitHub. A long sync stops before its time limit and the next one goes on. A
  repository the token cannot read, or one that was renamed, is named in the answer, and the others still sync.
- **Pull requests and commits are kept too.** The same sync keeps pull requests with their reviews and comments,
  branches, tags, commits and releases, never the code or a diff. The first sync reads every pull request and release.
  For commits it reads the last 30 days, and later syncs reach back further, up to 90 days. Commits keep their authors' names and e-mail
  addresses, as GitHub shows them. `gthb` has no commands of its own for them yet, so your agent reads them through
  the `api` group.
- **A profile for each owner.** A profile is a name you choose for one GitHub account and one owner, the user or
  organization whose repositories its token reads, such as `work`. Every command that uses an account names it first:
  `gthb work issues show octo-org/app#12`. A second owner is a second profile.

## Make a read-only token [#make-a-read-only-token]

GitHub describes these steps on its page about
[personal access tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token).
`gthb work session start` shows the same steps before it asks for the token.

1. Open [Fine-grained personal access tokens](https://github.com/settings/personal-access-tokens/new) on GitHub.
2. Under **Resource owner**, choose the user or organization whose repositories this profile reads. You give the same
   name to `--owner` when you sign in.
3. Under **Repository access**, choose only the repositories you will add with `repos add`.
4. Under **Repository permissions**, set **Metadata**, **Issues**, **Pull requests** and **Contents** to
   **Read-only**. Give nothing else and no write access.
5. Click **Generate token** and copy it.

If the owner is an organization, its administrators may review such a token first. Until they approve it, GitHub
marks it pending and the token cannot read that organization's repositories.

## Connect and copy your repositories [#connect-and-copy-your-repositories]

1. Install `gthb` from npm. It is not in WireCat Desktop yet. You need Node.js 22.16 or a later 22.x, or 24 or later. See [install](/llms.mdx/docs/gthb/installation/content.md).

```sh
npm install -g @wirecat/github-cli
gthb doctor
```

2. Sign in. `work` is a profile, and `octo-org` is the owner your token reads. The tool asks for the token hidden and
   checks it with GitHub before it keeps it.

```sh
gthb work session start --owner octo-org
```

3. Choose a repository, copy it, then look at the open issues nobody has taken.

```sh
gthb work repos add octo-org/app
gthb work sync
gthb work issues list type:unstarted assignee:none
gthb work issues context octo-org/app#12
gthb work issues search login token
```

`issues search` finds the issues and comments that have every word, in any order. Words in quotes are matched as one
phrase. Run `sync` again later to bring in what changed.

4. Connect your agent. A terminal agent gets the skill:

```sh
gthb skill install
```

An app that connects to MCP servers gets the server, as described in [use it](/llms.mdx/docs/gthb/usage/content.md#agents). `mcp add` asks you
to confirm with `--allow-writes` when the profile has tools that may write. In `gthb` those write only to the local
store on your computer, such as notes, tags and your tasks, never to GitHub.

## What it does not do yet [#what-it-does-not-do-yet]

- It has no commands of its own to read pull requests, commits and releases from the local store. Your agent reads them
  live through the `api` group.
- It does not copy GitHub Projects boards.
- It signs in only with a fine-grained personal access token, not through the browser.
- It is not in WireCat Desktop yet.

## Find a guide for your task [#find-a-guide-for-your-task]

| Task | Guide |
|---|---|
| Install or update the tool | [Install](/llms.mdx/docs/gthb/installation/content.md) |
| Learn how a command is built and connect an agent | [Use it](/llms.mdx/docs/gthb/usage/content.md) |
| Find a command or an option | [Commands](/llms.mdx/docs/gthb/commands/content.md) |
| Change a setting or a permission | [Settings](/llms.mdx/docs/gthb/configuration/content.md) |
| Fix an error | [When something goes wrong](/llms.mdx/docs/gthb/troubleshooting/content.md) |
| Learn what the tool keeps and sends | [Security](/llms.mdx/docs/gthb/security/content.md) |
| Compare it with other GitHub tools | [Compared with other tools](/llms.mdx/docs/gthb/compare/content.md) |
