diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 6cd9fe02..99c3c4da 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -353,10 +353,20 @@ protected function selectTargetAgents(): Collection return collect(); } + $defaults = $this->config->getAgents(); + + if ($this->selectedTargetMcpClient->isNotEmpty()) { + $defaults = $this->selectedTargetMcpClient + ->filter(fn (McpClient $client): bool => $client instanceof Agent) + ->map(fn (McpClient $client): string => $client->name()) + ->values() + ->toArray(); + } + return $this->selectCodeEnvironments( Agent::class, sprintf('Which agents need AI guidelines for %s?', $this->projectName), - $this->config->getAgents(), + $defaults, ); }