Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class InstallCommand extends Command
{
use Colors;

private const SAIL_PATH = 'vendor/bin/sail';

private CodeEnvironmentsDetector $codeEnvironmentsDetector;

private Herd $herd;
Expand Down Expand Up @@ -462,6 +464,8 @@ private function installMcpServerConfig(): void
)->toArray()
);

$projectUsesSail = file_exists(base_path(self::SAIL_PATH));

/** @var CodeEnvironment $mcpClient */
foreach ($this->selectedTargetMcpClient as $mcpClient) {
$ideName = $mcpClient->mcpClientName();
Expand All @@ -471,8 +475,14 @@ private function installMcpServerConfig(): void

if ($this->shouldInstallMcp()) {
try {
$artisan = $mcpClient->useAbsolutePathForMcp ? base_path('artisan') : './artisan';
$result = $mcpClient->installMcp('laravel-boost', 'php', [$artisan, 'boost:mcp']);
if ($projectUsesSail) {
$command = $mcpClient->useAbsolutePathForMcp ? base_path(self::SAIL_PATH) : self::SAIL_PATH;
$artisan = 'artisan';
} else {
$command = 'php';
$artisan = $mcpClient->useAbsolutePathForMcp ? base_path('artisan') : './artisan';
}
$result = $mcpClient->installMcp('laravel-boost', $command, [$artisan, 'boost:mcp']);

if ($result) {
$results[] = $this->greenTick.' Boost';
Expand Down