@@ -34,6 +34,8 @@ class InstallCommand extends Command
34
34
{
35
35
use Colors;
36
36
37
+ private const SAIL_PATH = 'vendor/bin/sail ' ;
38
+
37
39
private CodeEnvironmentsDetector $ codeEnvironmentsDetector ;
38
40
39
41
private Herd $ herd ;
@@ -462,6 +464,8 @@ private function installMcpServerConfig(): void
462
464
)->toArray ()
463
465
);
464
466
467
+ $ projectUsesSail = file_exists (base_path (self ::SAIL_PATH ));
468
+
465
469
/** @var CodeEnvironment $mcpClient */
466
470
foreach ($ this ->selectedTargetMcpClient as $ mcpClient ) {
467
471
$ ideName = $ mcpClient ->mcpClientName ();
@@ -471,8 +475,14 @@ private function installMcpServerConfig(): void
471
475
472
476
if ($ this ->shouldInstallMcp ()) {
473
477
try {
474
- $ artisan = $ mcpClient ->useAbsolutePathForMcp ? base_path ('artisan ' ) : './artisan ' ;
475
- $ result = $ mcpClient ->installMcp ('laravel-boost ' , 'php ' , [$ artisan , 'boost:mcp ' ]);
478
+ if ($ projectUsesSail ) {
479
+ $ command = $ mcpClient ->useAbsolutePathForMcp ? base_path (self ::SAIL_PATH ) : self ::SAIL_PATH ;
480
+ $ artisan = 'artisan ' ;
481
+ } else {
482
+ $ command = 'php ' ;
483
+ $ artisan = $ mcpClient ->useAbsolutePathForMcp ? base_path ('artisan ' ) : './artisan ' ;
484
+ }
485
+ $ result = $ mcpClient ->installMcp ('laravel-boost ' , $ command , [$ artisan , 'boost:mcp ' ]);
476
486
477
487
if ($ result ) {
478
488
$ results [] = $ this ->greenTick .' Boost ' ;
0 commit comments