Skip to content

Tinker tool crashes mcp due to memory usage #176

@mortenscheel

Description

@mortenscheel

Laravel Package Version

v1.0.18

Laravel Version

v12.19.3

PHP Version

8.3.24

System Info

macOS Sequoia 5.6 (24G84), php from homebrew. mcp used from claude code

Description

⏺ laravel-boost - tinker (MCP)(code: "echo 123;")
⎿  Error: Inline tool execution failed: Failed to set memory limit to 134217728 bytes (Current memory usage is 200278016 bytes)

This happens in Tinker.php when it tries to set memory_limit to 128M.

I've tried to debug this by logging the memory usage when Tinker.php's handle method is called.

Calling the tool manually, the memory usage is 56 MB, number of declared classes: 1304

php artisan boost:execute-tool 'Laravel\Boost\Mcp\Tools\Tinker' eyJjb2RlIjoiZWNobyAxMjM7In0=

When the same command sent from Claude Code, the memory usage is 191 MB, number of declared classes: 4701

I've also tried debugging with mcp:inspector, but the results are the same.

Note: this is happening in a very large Laravel application with ~400 models and a total of 4626 php files in the app/ folder.

Steps To Reproduce

Run the tinker mcp tool in a very large Laravel project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions