Add start_claude_session and start_claude_subagent MCP tools#1085
Conversation
The desktop client was responsible for fetching task data and building the claude prompt, which coupled it to the DB schema. Now the MCP server builds the full command (prompt + heredoc escaping) and sends it to the desktop as an opaque string. The desktop tool accepts a required `name` param used for both workspace name and branch name.
Two changes: - New `start_claude_subagent` MCP + desktop tool that adds a terminal pane to the active workspace instead of creating a new one. This keeps it naturally hidden from Slack (which has no workspace context). - Update buildPrompt to have Claude implement after planning instead of stopping at the plan phase.
📝 WalkthroughWalkthroughTwo new tools—startClaudeSession and startClaudeSubagent—are added to both the desktop renderer and MCP server components. Desktop implementations manage workspace creation, git branching, and terminal command queueing; MCP implementations provide server-side task validation, command composition, and device-level execution registration. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Desktop as Desktop App
participant WorkspaceStore as Workspace Store
participant WSInitStore as WS-Init Store
participant Navigation as Navigation
User->>Desktop: Request startClaudeSession
Desktop->>WorkspaceStore: Get current/recent workspace
alt No workspaces exist
Desktop-->>User: Error: No workspaces
else Workspace found
WorkspaceStore-->>Desktop: projectId
Desktop->>WorkspaceStore: Create new worktree
WorkspaceStore-->>Desktop: New workspaceId
Desktop->>WSInitStore: Queue command in initialCommands
WSInitStore-->>Desktop: Updated pending data
Desktop->>Navigation: Navigate to workspace
Desktop-->>User: Success with workspaceId & branch
end
sequenceDiagram
participant MCP as MCP Server
participant DB as Database
participant Device as Device Handler
participant Result as Result
MCP->>MCP: Validate deviceId & taskId
alt Invalid args
MCP-->>Result: ERROR_DEVICE_AND_TASK_REQUIRED
else Valid
MCP->>DB: fetchTask(taskId, organization)
alt Task not found
DB-->>Result: ERROR_TASK_NOT_FOUND
else Task found
DB-->>MCP: Task details
MCP->>MCP: buildCommand(task)
MCP->>Device: executeOnDevice with command
Device-->>Result: Success with result
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
Some hacky tools in the mcp to get us started on multi-agent stuff / automations
Test plan
start_claude_sessioncreates workspace with task slug as branch name and workspace namestart_claude_subagentadds a terminal pane to the active workspaceSummary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.