Skip to main content
Glama

iTerm2 Worktree MCP Server

4
  • Apple

iTerm2 Worktree MCP Server

A Model Context Protocol (MCP) server that automates git worktree management with iTerm2 integration for Claude Code.

https://github.com/user-attachments/assets/16188878-8fe8-450c-b2a3-cfd617d74f43

Installation

Add to Claude Code:

claude mcp add -s user worktree -- python3 path/to/worktree_mcp_server.py

Features

Core Worktree Management

  • Create Worktree: Creates a new git worktree with a feature branch and opens it in a new iTerm2 tab
  • Close Worktree: Safely closes worktrees after verifying they're clean and pushed
  • Open Worktree: Opens an existing worktree in a new iTerm2 tab (with force option to override if already open)
  • Active Worktrees: Lists all git worktrees and shows which iTerm2 tabs they're running in
  • Switch to Worktree: Quickly switch to a worktree's iTerm2 tab by name or specific tab ID

Smart Tab Detection

  • Dynamic Discovery: No metadata files - finds tabs by analyzing their working directories in real-time
  • Multi-Tab Support: Shows all tabs running the same worktree across different windows
  • Window Context: Identifies which tabs are in the current window with thisWindow flag

Available Tools

ToolDescriptionParameters
createWorktreeCreate new worktree + branch, open in iTerm2 tabfeature_name, branch_name, worktree_folder, description, start_claude?
closeWorktreeValidate, close, and cleanup worktreeworktree_name
activeWorktreesList all worktrees and their iTerm2 tabsNone
switchToWorktreeSwitch to worktree's iTerm2 tabworktree_name, tab_id?
openWorktreeOpen existing worktree in new tabworktree_name, force?

Workflow

  1. Create: createWorktree - Specify feature name, branch name, and worktree folder - automatically creates the worktree and switches to a new iTerm2 tab
  2. Navigate: switchToWorktree or openWorktree - Seamlessly move between worktrees
  3. Monitor: activeWorktrees - See all worktrees and their active tabs
  4. Develop: Work in isolated worktree environments with full iTerm2 integration
  5. Close: closeWorktree - Verify changes are committed and pushed, then safely remove the worktree

Perfect for feature development with isolated git environments and seamless iTerm2 integration.

-
security - not tested
F
license - not found
-
quality - not tested

Automates git worktree management with iTerm2 integration for Claude Code, allowing users to create, manage, and close git worktrees in isolated environments with automatic tab handling.

  1. Installation
    1. Features
      1. Core Worktree Management
      2. Navigation & Discovery
      3. Smart Tab Detection
    2. Available Tools
      1. Workflow

        Related MCP Servers

        • -
          security
          A
          license
          -
          quality
          A comprehensive code analysis and management tool that integrates with Claude Desktop to analyze code at project and file levels, helping adapt changes to projects intelligently.
          Last updated -
          37
          Python
          MIT License
        • -
          security
          F
          license
          -
          quality
          A Multi-Claude Program for interacting with GitHub APIs through Claude Desktop, allowing users to search repositories, manage issues, pull requests, repository settings, workflows, and collaborators.
          Last updated -
          1
          Python
          • Linux
          • Apple
        • A
          security
          F
          license
          A
          quality
          Enables comprehensive GitHub operations through natural language including file management, repository administration, issue tracking, and advanced code searching.
          Last updated -
          47
          1
          1
          TypeScript
        • -
          security
          A
          license
          -
          quality
          Connects Claude Desktop to GitHub repositories, enabling users to perform git operations and GitHub API interactions through natural conversation.
          Last updated -
          JavaScript
          MIT License
          • Apple

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/timoconnellaus/claude-code-iterm-worktree-mcp'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server