Git Worktree Toolbox MCP Server logo

Git Worktree Toolbox MCP Server

Community
ben-rogerson

Easily manage git worktrees, launch tasks and work on multiple features in parallel.

Publisherben-rogerson
Repositorygit-worktree-toolbox
LanguageTypeScript
Forks
2
Stars
19
Available tools
9
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    Git Worktree Toolbox MCP Server exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 9 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    19 stars and 2 forks from the linked repository.

Git Worktree Toolbox

npm minzip package size

🌳 Git Worktree Toolbox is a MCP server and CLI for managing git worktrees.

Create isolated workspaces without the hassle of stashing changes and switching branches.

Ideal for AI-assisted development workflows requiring multiple features in parallel.

As a backup, use the gwtree command to run any of the mcp tools yourself.

Available MCP Tools (10)

  • list - List projects and their worktrees
  • new - Create a new worktree with a matching branch
  • archive - Archive worktrees and branches
  • go - Open worktree folder in your editor
  • changes - Review changes and optionally commit and push
  • grab - Pull in changes from a specific worktree
  • pr - Generate a link to create a pull/merge request
  • prompt - Resume AI agent sessions or setup AI agent auto-prompt (Claude/Cursor)
  • doctor - Fix worktree metadata issues
  • clean - Archive unused worktrees

Usage Examples

Once the MCP server is added, here's how you might phrase requests to activate each tool:

  • List worktrees: "List worktrees", "Show me all my projects and worktrees", "What worktrees do I have?"
  • Create new worktree: "New worktree for fixing the login bug", "Set up a new workspace for the user dashboard feature", "Make a worktree for the API refactor"
  • Archive worktree: "Archive this worktree", "Clean up the completed feature worktree", "Remove the old worktree and its branch"
  • Open worktree: "Open the login bug worktree in my editor", "Switch to the dashboard worktree", "Go to the API refactor workspace"
  • Review/Push changes: "Show changes from task-245", "What files have I modified?", "Push changes for task-245"
  • Grab changes: "Get login bug worktree changes", "Merge updates from the dashboard branch", "Pull in changes from the API worktree"
  • Create PR: "Generate a pull request link", "Create a merge request for task-245", "Make a PR for the current changes"
  • AI agent prompt: "Resume Claude session for task-245", "Setup Claude auto-prompt", "Setup Cursor Agent", "Continue conversation in this worktree"
  • Fix issues: "Fix my worktree metadata", "Repair worktree configuration", "Doctor the worktree setup"
  • Clean up: "Clean unused worktrees", "Archive old worktrees", "Remove completed worktrees"

Get Started

Add the MCP Server to Cursor / Claude Desktop:

json
{
  "mcpServers": {
    "git-worktree-toolbox": {
      "command": "npx",
      "args": ["-y", "git-worktree-toolbox@latest"]
    }
  }
}

The gwtree CLI is also available after a global installation:

bash
npm install -g git-worktree-toolbox

Run gwtree help to see the available tools and their flags.

bash
# List all projects with worktrees
gwtree list

# Create a new worktree with a matching branch
gwtree new "Fix login bug and flow"

# Archive current worktree (with branch removal)
gwtree archive -r

# Open current worktree and branch in editor
gwtree go

# Show the changes from all associated worktrees
gwtree changes

# Pull in changes from a specific worktree
gwtree grab fix-login-bug-1242

# Commit and push changes in a specific worktree
gwtree changes fix-login-bug-1242 -c

# Generate a link to create a pull/merge request
gwtree pr

# Fix worktree metadata issues
gwtree doctor

# Archive unused worktrees
gwtree clean

# Setup AI agent auto-prompt plugin (Claude by default)
gwtree prompt setup

# Setup with Cursor Agent instead
gwtree prompt setup --cursor

# Resume AI agent session for a worktree
gwtree prompt <worktree-id>

# Show help with advanced flag usage examples
gwtree help

AI Agent Prompt Plugin

When using the CLI, an interactive session with either Claude CLI or Cursor Agent can be automatically spawned in the new workspace, ready to use.

Quick Start

bash
# 1. Setup AI agent plugin (one-time)
gwtree prompt setup              # Claude (default)
gwtree prompt setup --cursor     # Cursor Agent

# 2. Create worktree - AI agent auto-launches
gwtree new "Add user authentication"
# → AI agent starts with task context
# → Session ID saved in worktree metadata

# 3. Resume AI agent session later
gwtree prompt user-authentication-123
# → Continue conversation with full history

Features

  • Auto-launch: AI agent starts automatically with task context
  • Session persistence: Each worktree gets a unique session
  • Resume capability: Continue conversations anytime with gwtree prompt
  • Customizable prompts: Edit ~/.gwtree/ai-agent.yaml to customize templates
  • Switchable providers: Switch between Claude CLI and Cursor Agent
  • Optional: Disable globally or per-worktree

See src/plugins/claude-prompt/README.md and src/plugins/cursor-agent/ for more information.

Configuration

Optionally, configure the worktrees folder and project directories using environment variables:

bash
# Storage directory for worktrees
# Default: ~/.gwtree/worktrees
export BASE_WORKTREES_PATH=~/my-custom-worktrees

# Custom project directories for discovery (colon-separated)
# Default: ~/Projects, ~/Code, ~/Developer
export PROJECT_DIRECTORIES="$HOME/custom-projects:$HOME/work"

Add these to your shell profile (~/.zshrc, ~/.bashrc, etc.) to persist across sessions.

Installation

TypingMind
{
  "mcpServers": {
    "git-worktree-toolbox": {
      "command": "npx",
      "args": [
        "-y",
        "git-worktree-toolbox"
      ]
    }
  }
}

Available Tools

  • list

    Show git repositories with worktrees

  • go

    Open worktree in editor/terminal

  • create

    Create a new worktree with matching branch

  • changes

    Show all changes in a worktree or current repo. Optionally commit and push changes.

  • archive

    Archive a worktree and its matching branch

  • clean

    Archive all worktrees that don't have any changes compared to their base branch

  • doctor

    Check all worktrees and initialize missing metadata. Run this to ensure all worktrees have proper metadata.

  • mr

    Generate a merge request link for a worktree

  • grab

    Merge all changes from another worktree into the current worktree

Use Git Worktree Toolbox MCP Server MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Git Worktree Toolbox MCP Server is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Git Worktree Toolbox MCP Server as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Git Worktree Toolbox MCP Server MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "git-worktree-toolbox": {
      "command": "npx",
      "args": [
        "-y",
        "git-worktree-toolbox"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Git Worktree Toolbox MCP Server MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Git Worktree Toolbox MCP Server MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Git Worktree Toolbox MCP Server to help me with this task?
Git Worktree Toolbox MCP Server
Sure. I read it.
Here is what I found using Git Worktree Toolbox MCP Server.

Frequently asked questions

What is the Git Worktree Toolbox MCP Server MCP server used for?

Git Worktree Toolbox MCP Server is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Git Worktree Toolbox MCP Server MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Git Worktree Toolbox MCP Server with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Git Worktree Toolbox MCP Server MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Git Worktree Toolbox MCP Server connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Git Worktree Toolbox MCP Server MCP to TypingMind?

Git Worktree Toolbox MCP Server runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Git Worktree Toolbox MCP Server MCP provide in TypingMind?

Git Worktree Toolbox MCP Server exposes 9 MCP tools that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Git Worktree Toolbox MCP Server MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Git Worktree Toolbox MCP Server requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇