MCP and access tokens
A personal access token lets a script or an AI client use your account without your dashboard session. The MCP server uses the same tokens, so clients that speak the Model Context Protocol (Claude Desktop, Claude Code, Codex and others) can ask about your backups and queue runs.
Create a token
- In the dashboard, open Settings > Access tokens.
- Give the token a name that says where it is used, for example
claude-code on my laptop. - Choose the access:
- Read only: reads backups, runs, logs and analytics.
- Read and write: can also queue backup runs, record fixes and change alerts.
- Choose when it expires: after 30, 90 or 365 days, or never.
- Select Create token and copy it. It starts with
ghb_pat_and is shown only once.
An account can hold 20 tokens. Revoking one under Settings > Access tokens stops every client that uses it at once.
Send the token in the Authorization header of each request:
curl -H "Authorization: Bearer $TOKEN" "$API/api/backups"
$API is the address in the link command on the Settings > Agents page.
Connect an MCP client
The MCP server is reached over HTTPS at its own address, which ends in /mcp; it is not the API's address. The address and the commands below, with the address filled in, are on Settings > Access tokens under Connect an MCP client. Every call runs for the account of the token it carries.
Claude Code:
claude mcp add --transport http github-backup <MCP address> \
--header "Authorization: Bearer $GHB_TOKEN"
claude mcp list
Other clients take the same two values. For example, in a client that reads an mcpServers file:
{
"mcpServers": {
"github-backup": {
"type": "http",
"url": "<MCP address>",
"headers": { "Authorization": "Bearer ghb_pat_..." }
}
}
}
Keep the token out of files you share or commit; most clients can read it from an environment variable.
What the tools can do
| Tool | Access | What it does |
|---|---|---|
get_dashboard_summary | Read | Total runs, success rate, repositories, archive size and the latest run, as on the dashboard. |
get_backup_metrics | Read | Runs, success rate and average duration per day, over the days you ask for. |
list_tracked_repositories | Read | Your repositories and the latest result of each. |
list_backup_runs | Read | Runs, newest first. |
get_backup_run_details | Read | One run with every repository's result. |
get_execution_logs | Read | Log lines, filtered by level, run or repository. |
diagnose_backup_failure | Read | For a failed run (the latest by default): the failed repositories, their errors and logs, and the newest recorded fixes. |
search_backup_knowledge | Read | Searches past failures, fixes and investigations. |
get_system_health | Read | Whether the service and its database answer. |
trigger_backup_run | Write | Queues a backup of every repository or of one. Your machine runs it at its next hourly check. |
record_backup_fix | Write | Records how a problem was fixed, so later diagnoses can use it. |
Ask your client to confirm before it uses a write tool. A read-only token gets "this token is read-only" and nothing changes.
The server also lists three archive tools (verify_archive_integrity, inspect_archive_contents, extract_backup_file). They read archives stored on our server, and yours are on your own storage, so they answer with an error. To check your archives, use verify on your machine.
Limits
- 120 tool calls a minute per account. A tool that needs several lookups counts each one.
- Queued backups: 10 an hour, and one waiting request per repository at a time. Queueing a repository that is already waiting returns the waiting request instead of a new one.