Skip to content

Laravel Boost MCP intermittently exits through MCPHub/OpenCode, leaving server "Not connected" #795

Description

@ramhaidar

Boost Version

2.4.6

Laravel Version

13.8.0

Agent/IDE Name & Version

Visual Studio Code w/ OpenCode

PHP Version

PHP 8.5.5 NTS Windows x64; also reproduced with PHP 8.4.x

System Info

Windows 11

Description

Laravel Boost MCP starts successfully through MCPHub/OpenCode, but the underlying php.exe process intermittently exits. After that, MCPHub/OpenCode still appears to know about the Laravel Boost MCP server, but tool calls fail with:

Error: Error | Not connected

I observed two exit modes:

  1. Crash exit with code 1

    In this case, Laravel logs an exception while Boost is handling a prompt request:

    local.ERROR: File does not exist at path
    <project-root>\storage\framework\views\<hash>.blade.php
    
    Illuminate\Contracts\Filesystem\FileNotFoundException
    
    Laravel\Boost\Mcp\Prompts\LaravelCodeSimplifier\LaravelCodeSimplifier->handle()
    Laravel\Boost\Concerns\RendersBladeGuidelines->renderBladeFile()
    Illuminate\Support\Facades\Blade::render()
    

    The wrapper log shows the Boost MCP PHP process exiting with code 1.

  2. Clean exit with code 0

    I also observed the Boost MCP PHP process exiting with code 0, with no new Laravel error log entry. After this clean exit, the MCP client still reports Laravel Boost as not connected.

In both cases, the result is the same: the Laravel Boost MCP PHP process is gone, and subsequent MCP calls fail as disconnected/not connected.

Expected behavior: Laravel Boost MCP should remain running while MCPHub/OpenCode is connected. If a prompt/tool fails, the failure should be returned as an MCP error response without terminating the MCP server process.

Actual behavior: the Laravel Boost MCP PHP process exits. MCPHub/OpenCode still exposes the server/tool entry, but calls fail with Error: Error | Not connected.


Steps To Reproduce

  1. Install Laravel Boost in a Laravel project.

  2. Configure Laravel Boost MCP through MCPHub/OpenCode using stdio. Example:

    {
      "mcpServers": {
        "laravel-boost": {
          "type": "stdio",
          "command": "<path-to-php>\\php.exe",
          "args": [
            "<project-root>\\artisan",
            "boost:mcp"
          ],
          "env": {
            "APP_ENV": "local",
            "APP_DEBUG": "true"
          }
        }
      }
    }
  3. Start MCPHub/OpenCode.

  4. Let the MCP client load or call Laravel Boost MCP prompts/tools.

  5. Observe that the Laravel Boost php.exe process exits.

  6. The MCP client then reports:

    Error: Error | Not connected
    
  7. Check Laravel logs:

    Get-Content <project-root>\storage\logs\laravel.log -Tail 100
  8. In one observed failure, the log contains an exception similar to:

    Illuminate\Contracts\Filesystem\FileNotFoundException:
    File does not exist at path <project-root>\storage\framework\views\<hash>.blade.php
    
    Laravel\Boost\Mcp\Prompts\LaravelCodeSimplifier\LaravelCodeSimplifier->handle()
    Laravel\Boost\Concerns\RendersBladeGuidelines->renderBladeFile()
    Illuminate\Support\Facades\Blade::render()
    
  9. In another observed failure, the Boost MCP PHP process exits with code 0 and no new Laravel error log entry, but subsequent MCP calls still fail as not connected.

Environment

  • OS: Windows
  • Shell: PowerShell 7.6.1
  • MCP client: OpenCode + MCPHub
  • PHP: 8.5.5 CLI, NTS, Visual C++ 2022 x64, with OPcache
  • Reproduced with: PHP 8.4.x
  • Laravel Framework: v13.8.0
  • laravel/boost: v2.4.6
  • laravel/mcp: v0.7.0

Notes

This does not appear to be only a PHP 8.5-specific issue. I reproduced the same LaravelCodeSimplifier / Blade temp-view crash using PHP 8.4.x.

It also does not appear to be only a LaravelCodeSimplifier prompt issue. That is one observed crash path with exit code 1, but there is also an observed clean exit with code 0 and no new Laravel error log entry. In both cases, the MCP client ends up reporting Error: Error | Not connected because the Laravel Boost MCP PHP process is gone.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions