rft
Integrations

MCP Integration

Control rft from AI agents using the Model Context Protocol

Overview

rft includes a built-in MCP (Model Context Protocol) server. This allows AI agents like Claude Code to manage Docker Compose worktree stacks directly.

Setup

Add to your Claude Code MCP configuration (.mcp.json or project settings):

{
  "mcpServers": {
    "rft": {
      "command": "rft",
      "args": ["mcp"]
    }
  }
}

Available Tools

The MCP server exposes 6 tools:

ToolDescription
rft_listList all worktrees with ports and status
rft_startStart Docker Compose stacks
rft_stopStop running stacks
rft_restartRestart stacks
rft_promoteTransfer changes from a worktree
rft_cleanFull cleanup of all resources

Starting the Server

The MCP server runs via stdio transport:

rft mcp

This is intended to be called by the AI agent, not run manually. The agent communicates with the server over stdin/stdout using the MCP protocol.

Use Cases

With MCP integration, an AI agent can:

  • Check worktree status before making changes
  • Start and stop stacks needed for testing
  • Promote changes from a feature branch worktree
  • Clean up after completing a task

On this page