Skip to content

Conversation

soleinjast
Copy link
Contributor

Summary

On Windows, running mcp:inspector produced guidance output with backslashes and relied on getcwd() to resolve artisan.
This caused confusing or incorrect paths in some setups.


Changes

  • Resolve the artisan entrypoint via base_path('artisan') instead of getcwd().
  • Normalize Windows paths to forward slashes for guidance output only.
  • Keep the raw resolved path for Symfony Process execution.
  • Added tests for Windows-style, mixed, and Unix paths.
  • Retained existing validation for invalid handles and missing arguments.

Benefit

Improves cross-platform consistency and clarity of console output without breaking existing functionality.


Before (Windows)

Arguments => D:\Herd\cyborgfinance\artisan mcp:start demo

After (Windows)

Arguments => D:/Herd/cyborgfinance/artisan mcp:start demo

@soleinjast soleinjast changed the title fix(console): resolve artisan path via base_path and normalize for Windows fix(console): normalize Windows artisan path Sep 6, 2025
@nunomaduro nunomaduro merged commit 907e5c8 into laravel:main Sep 8, 2025
3 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants