loading…
Search for a command to run...
loading…
Enables hierarchical orchestration of Claude instances via tmux with a bridge pattern architecture reducing memory usage by 85%.
Enables hierarchical orchestration of Claude instances via tmux with a bridge pattern architecture reducing memory usage by 85%.
A highly efficient Model Context Protocol (MCP) server enabling hierarchical orchestration of Claude instances via tmux. Features a bridge pattern architecture that reduces memory usage by 85% compared to traditional multi-server approaches.
Hierarchical orchestration showing Executive, Manager, and Specialist instances working together
Web-based monitoring dashboard displaying active instances and system metrics
New to this repository? If you're a Claude Code instance, start with the Claude Getting Started Guide for a quick orientation and practical examples.
Due to MCP's documented 1:1 stdio architecture, multiple Claude instances cannot directly access MCP tools. Our bridge pattern solution:
tmux-claude-mcp-server/
├── README.md # Project overview and usage
├── LICENSE # MIT license
├── package.json # Node.js dependencies
├── package-lock.json # Locked dependencies
├── .gitignore # Version control ignore patterns
├── src/ # Core source code
│ ├── simple_mcp_server.js # Main MCP server
│ ├── instance_manager.js # Instance lifecycle management
│ ├── mcp_tools.js # MCP tool implementations
│ ├── tmux_interface.js # tmux integration layer
│ ├── reliable_tmux_sender.js # High-reliability message delivery
│ ├── orchestration/ # Orchestration components
│ ├── dashboard/ # Web monitoring dashboard
│ ├── role_templates/ # Standardized role templates
│ └── workflow/ # Workflow orchestration system
│ ├── actions/ # Modular action implementations
│ ├── workflow_engine.cjs # Main workflow engine
│ └── run_workflow.cjs # Workflow runner CLI
├── scripts/ # Utility scripts
│ ├── mcp_bridge.js # Bridge for multi-instance MCP access
│ ├── scheduled_continue.js # Schedule "Plz continue" messages
│ ├── check/ # Session checking utilities
│ ├── restart/ # Session restart utilities
│ ├── utils/ # Shared utilities
│ │ └── time_parser.js # Time parsing for scheduling
│ └── api/ # API scripts for monitoring
├── docs/ # Documentation
│ ├── CHANGELOG.md # Version history
│ ├── CONTRIBUTING.md # Contribution guidelines
│ ├── WORKFLOW_GUIDE.md # Workflow system guide
│ ├── CLAUDE_GETTING_STARTED.md # Quick start for Claude instances
│ ├── DOCUMENTATION_INDEX.md # Documentation map
│ ├── scheduled_continue/ # Scheduled continue feature docs
│ │ ├── CLI_INTERFACE_DESIGN.md
│ │ ├── TIME_FORMAT_SPECIFICATION.md
│ │ └── SCHEDULING_MECHANISM_ANALYSIS.md
│ ├── analysis/ # Technical analysis & findings
│ ├── archive/ # Historical documentation
│ └── guides/ # User guides and specifications
├── tests/ # Test suites
│ ├── test_workflow_standalone.cjs # Standalone workflow tests
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ ├── e2e/ # End-to-end tests
│ └── performance/ # Performance benchmarks
├── workflows/ # Workflow system
│ ├── README.md # Workflow documentation
│ ├── CURRENT_STATUS.md # Current status and usage
│ ├── library/ # Reusable workflow components
│ ├── examples/ # Example workflows
│ ├── tests/ # Workflow test files
│ ├── scripts/ # Workflow utilities
│ ├── state/ # Workflow state storage
│ └── user/ # User-created workflows
├── state/ # Default state directory
├── config/ # Configuration files
├── logs/ # Log directory
└── vm-integration/ # Cloud VM management
├── README.md # VM integration documentation
├── vm_manager.js # Core VM management class
├── vm_cli.js # Command-line interface
├── vm_mcp_tools.js # MCP tools integration
├── integrate_vm_mcp.js # MCP server integration
├── setup-scripts/ # VM initialization scripts
│ └── claude-dev-setup.sh
└── tests/ # VM integration tests
└── test_vm_integration.js
--project flag for conversation isolationexec_1, mgr_1_1, spec_1_1_1 for clear parent-child relationships--continue flagThis implementation harvests and adapts ~20-30% of the existing tmux-manager codebase:
src/tmux_interface.js - Core tmux operationssrc/instance_manager.js - Instance lifecycle management src/instance_manager.js - Registry and coordinationsrc/instance_manager.js - Session operationscd tmux-claude-mcp-server
npm install
CRITICAL: You MUST configure the MCP server globally for all Claude instances:
claude mcp add tmux-claude -s user node /path/to/tmux-claude-mcp-server/src/simple_mcp_server.js
Important notes:
-s user flag is REQUIRED for hierarchical orchestration to workVerify configuration:
claude mcp list
# Should show: tmux-claude: node /path/to/simple_mcp_server.js
The MCP server runs automatically when Claude starts (after proper configuration above).
{
"name": "spawn",
"arguments": {
"role": "executive",
"workDir": "/jobs/auth_system",
"context": "# Executive: Auth System\\n\\nYou are responsible for orchestrating the implementation of a JWT authentication system..."
}
}
{
"name": "spawn",
"arguments": {
"role": "manager",
"workDir": "/jobs/auth_system",
"context": "# Manager: Auth Implementation\\n\\nPlan and coordinate the JWT auth system implementation...",
"parentId": "exec_1"
}
}
{
"name": "spawn",
"arguments": {
"role": "manager",
"workDir": "/jobs/auth_system",
"context": "# Manager: Feature Implementation\\n\\nCoordinate multiple specialists...",
"parentId": "exec_1",
"workspaceMode": "shared" // Enable git integration
}
}
{
"name": "spawn",
"arguments": {
"role": "specialist",
"workDir": "/jobs/auth_system",
"context": "# Specialist: User Model\\n\\nImplement the User model with Mongoose...",
"parentId": "mgr_1_1"
}
}
{
"name": "send",
"arguments": {
"instanceId": "spec_1_1_1",
"text": "Please implement the User model with email, password, and timestamps fields"
}
}
{
"name": "read",
"arguments": {
"instanceId": "spec_1_1_1",
"lines": 50
}
}
{
"name": "list",
"arguments": {}
}
{
"name": "list",
"arguments": {
"parentId": "mgr_1_1"
}
}
{
"name": "terminate",
"arguments": {
"instanceId": "spec_1_1_1"
}
}
Located at ./state/instances.json:
{
"instances": {
"exec_1": {
"instanceId": "exec_1",
"role": "executive",
"parentId": null,
"sessionName": "claude_exec_1",
"projectDir": "/jobs/auth_system/exec_1",
"paneTarget": "claude_exec_1:0.0",
"status": "active",
"created": "2024-01-01T10:00:00Z",
"children": ["mgr_1_1"]
}
}
}
/jobs/auth_system/
├── exec_1/
│ ├── CLAUDE.md # Executive context
│ └── project files...
├── mgr_1_1/
│ ├── CLAUDE.md # Manager context
│ └── project files...
└── spec_1_1_1/
├── CLAUDE.md # Specialist context
└── implementation files...
The server implements nearly-free recovery using Claude's --continue flag:
{
"name": "restart",
"arguments": {
"instanceId": "spec_1_1_1"
}
}
This will:
claude --project . --continue The server enforces this by checking the caller's role and rejecting MCP tool calls from Specialists.
Each spawned instance:
--project <dir> for conversation isolation~/.claude/projects/-jobs-auth_system-<instance_id>/The MCP interface is designed to support all phases without code changes - only configuration differences.
The Scheduled Continue feature allows you to schedule "Plz continue" messages to all tmux sessions at a specified time. This is useful for automating session management and ensuring work resumes at specific times.
# Schedule in 30 minutes
node scripts/scheduled_continue.js "+30m"
# Schedule at 3:30 PM today
node scripts/scheduled_continue.js "15:30"
# Schedule at 9:45 AM with AM/PM format
node scripts/scheduled_continue.js "9:45am"
# Schedule using natural language
node scripts/scheduled_continue.js "in 2 hours"
# Custom message
node scripts/scheduled_continue.js "+1h" -m "Time to review progress"
# Dry run (test without executing)
node scripts/scheduled_continue.js "+5m" --dry-run
# Verbose logging
node scripts/scheduled_continue.js "+15m" --verbose
# Show help
node scripts/scheduled_continue.js --help
+30m, +2h, +90m15:30, 09:45, 23:593:30pm, 9:45am, 11:59PM"in 30 minutes", "in 2 hours"For detailed documentation, see:
npm test # Run all tests
./scripts/run_all_tests.sh # Run comprehensive test suite
npm run dev # Start with file watching
For complete implementation details, see:
docs/main/tmux-manager-MCP.md - MCP server specificationdocs/main/tmux-claude-implementation.md - Complete architecturedocs/main/tmux-mvp-implementation.md - Phase 1 MVP approachdocs/GIT_INTEGRATION_GUIDE.md - Git integration and workspace modesdocs/WORKSPACE_MODES.md - Detailed workspace mode documentationdocs/GIT_INTEGRATION_REFINEMENT_PLAN.md - Technical implementation detailsRun in your terminal:
claude mcp add tmux-claude-mcp-server -- npx Security
Low riskAutomated heuristic from public metadata — not a security guarantee.