jj-mcp
v1.0.8
Published
MCP server for the Jujutsu (jj) version control system — expose jj commands as MCP tools and resources
Downloads
47
Maintainers
Readme
Jujutsu MCP Server
A Model Context Protocol (MCP) server for the Jujutsu version control system. Exposes jj commands as MCP tools so AI assistants can read and manipulate jj repositories directly.
Requirements
- Node.js 26.2.0+
jjCLI 0.4+ installed and in PATH
Installation
npm install -g jj-mcpOr run without installing:
npx jj-mcpClient Configuration
Add to your MCP client config. All clients use the same JSON shape:
{
"mcpServers": {
"jj": {
"command": "jj-mcp"
}
}
}| Client | Config file |
|--------|-------------|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| Cursor | ~/.cursor/mcp.json |
| Cline | MCP settings in VS Code extension |
For a local build, point command at the compiled binary instead:
{
"mcpServers": {
"jj": {
"command": "node",
"args": ["/path/to/jj-mcp/dist/index.js"]
}
}
}Available Tools
Core
| Tool | Description |
|------|-------------|
| jj_status | Working copy status |
| jj_log | Commit history (supports revset expressions) |
| jj_diff | Show differences |
| jj_describe | Edit commit message |
| jj_commit | Create commit from working copy |
| jj_new | Create new empty commit |
| jj_abandon | Remove a commit |
| jj_rebase | Rebase commits |
| jj_squash | Combine commits |
| jj_split | Split a commit |
| jj_undo | Undo last operation |
| jj_redo | Redo undone operation |
| jj_restore | Restore files from a revision |
| jj_edit | Set working copy to a revision |
| jj_next | Move to next child revision |
| jj_prev | Move to previous parent revision |
Bookmarks
| Tool | Description |
|------|-------------|
| jj_bookmark_list | List bookmarks |
| jj_bookmark_create | Create bookmark |
| jj_bookmark_delete | Delete bookmark |
Git Integration
| Tool | Description |
|------|-------------|
| jj_git_fetch | Fetch from a Git remote |
| jj_git_push | Push to a Git remote |
| jj_git_import | Import Git refs into jj |
| jj_git_export | Export jj changes to Git |
| jj_git_clone | Clone a Git repo and initialize jj |
Operations & History
| Tool | Description |
|------|-------------|
| jj_obslog | Obslog for a revision (mutation history) |
| jj_op_log | Operation log |
| jj_bisect | Binary search for regressions, e.g. jj_bisect({range: "v1.0..main"}) |
Files & Tags
| Tool | Description |
|------|-------------|
| jj_file_show | Show file contents at a revision |
| jj_tag_list | List tags |
| jj_tag_create | Create a tag |
Workspaces & Config
| Tool | Description |
|------|-------------|
| jj_workspace_list | List workspaces |
| jj_workspace_add | Add a workspace |
| jj_config_get | Get a config value |
| jj_config_set | Set a config value |
| jj_sparse | Manage sparse checkout patterns |
| jj_init | Initialize a new jj repo |
| jj_sanity_check | Verify jj is installed and repo is valid |
Available Resources
Resources provide read-only repository state without a tool call:
| URI | Description |
|-----|-------------|
| jj://status | Working copy status |
| jj://log/recent | Recent commits (default limit: 10) |
| jj://bookmarks | All bookmarks |
| jj://config | Repository configuration |
All URIs accept a cwd query parameter, and jj://log/recent also accepts limit:
jj://log/recent?cwd=/path/to/repo&limit=20Revset Expressions
All tools that accept a revset parameter support jj's revision syntax:
| Expression | Meaning |
|------------|---------|
| @ | Working copy |
| @- | Parent of working copy |
| main | Bookmark named "main" |
| ::main | All ancestors of main |
| main..@ | Commits between main and working copy |
Safety Features
Pre-Execution Confirmation Gate
Dangerous operations require explicit confirmation before execution. This prevents accidental data loss or repository corruption.
Affected tools: jj_abandon, jj_rebase, jj_squash, jj_split, jj_restore, jj_edit, jj_git_push, jj_git_export, jj_bookmark_delete, jj_config_set, jj_sparse (with remove)
How it works:
Elicitation mode (clients that support it): A confirmation dialog appears describing the risk. Accept to proceed.
Token fallback (all other clients): The tool returns a
PRE-EXECUTION WARNINGand refuses to execute. To proceed, re-call the tool with the same arguments plusconfirmed: true:{ "name": "jj_abandon", "arguments": { "revset": "abc123", "confirmed": true } }
Additional hard blocks: Some commands have mandatory safety checks that cannot be bypassed:
jj_abandonrequires a non-emptyrevsetjj_rebaserequires bothsourceanddestinationjj_restorerequires at least one ofpaths,from, orto
Troubleshooting
jj command not found — ensure jj is on your PATH:
which jj && jj --versionVerify the server:
jj-mcp --check # checks jj is found and cwd is a jj repo
jj-mcp --versionLarge output — the server uses a 10 MB buffer. For very large diffs or logs, use the limit parameter.
