Skip to content

relgap mcp ​

Runs a Model Context Protocol server on stdin and stdout, for agents such as Claude Code. Logs go to stderr. Each tool returns the JSON envelope 'relgap <command> --format json' prints:

text
digest            relgap digest <tool> <from>..[<to>], with only, min_confidence and line
breaking_changes  the same digest with only the breaking and deprecation entries
outdated          relgap outdated <path>
drift             relgap drift <roots...>, with tools, latest and ignore_constraints
resolve           relgap resolve <tool>

The tools are read-only. They never start a process: the mise registry comes from the embedded snapshot, scans walk directories instead of asking git (so .gitignore doesn't apply), and the GitHub token comes from GH_TOKEN, GITHUB_TOKEN or gh's config file, not from 'gh auth token'. They write nothing except the HTTP cache, which they share with the other commands, so repeated calls are cheap. --offline, --refresh and --no-cache apply to every call.

outdated and drift read only directories inside the roots: the --root directories, else the roots the client lists (Claude Code lists its launch directory and the directories added with --add-dir), else the current directory. A relative path starts at the first root, and repositories are named relative to it. The config file is read once at startup, as for every command, but the search for .relgap.yaml also stops at the first --root.

A result over --max-result-bytes (default 50,000, Claude Code's limit for showing a result to the model) is split. The envelope then has a page field, and the agent passes page.next_cursor back to the same tool for the rest. Breaking changes, failed and outdated pins, and drifting tools come first. A digest page lists only the versions its entries cite. A cursor lasts 15 minutes after its last use.

The prompt upgrade_review <tool> <from> [<to>] tells the agent to call breaking_changes, list the required actions and cite the id of every entry it uses, such as [e-3f9a01c2]. An entry keeps its id in every page, filter and run. Claude Code offers the prompt as /mcp__relgap__upgrade_review.

Usage ​

sh
relgap mcp [flags]

Flags ​

FlagDescriptionTypeDefaultValuesConfig keyNotes
--max-result-bytessplit results larger than this many bytes of JSON into pages; 0 never splitsint50000
--rootdirectory that outdated and drift may read; repeatable (default: the client's roots, else the current directory)string, repeatable

The global flags work with every command.

Output formats ​

This command ignores --format.

Exit codes ​

CodeMeaning
0The command finished. With --fail-on, nothing matched.
1The command failed: a read, a write, a child process or a check failed.
2Wrong usage: an unknown command or flag, a bad value or argument, an invalid config file, or a prompt with no terminal.
130Interrupted by Ctrl-C (SIGINT) or a cancelled context.

All codes are listed on the exit codes page.

Examples ​

sh
claude mcp add --transport stdio --scope user relgap -- relgap mcp
relgap mcp --root ~/src/infra --root ~/src/apps
relgap mcp --offline