semitexa/laravel-ai-verify
AI-powered verification for Laravel: validate user input, content, and requests through configurable AI checks with a simple, fluent API. Drop-in service provider, customizable prompts, and sensible defaults make it easy to add intelligent verification to any app.
Install the package as a dev dependency and publish its config:
composer require --dev <vendor>/ai-verify
php artisan vendor:publish --tag=ai-verify-config
The first thing to read is config/ai-verify.php. It is where the Boost/MCP integration is toggled (ai-verify.mcp.boost) and where suite/timeout defaults live. Next, read the guideline and agent skill the package ships — with Boost installed these get surfaced to the agent, and they name the tools, so they double as the canonical usage documentation.
First use case: run a verification and look at the JSON shape.
php artisan ai-verify --json
Get comfortable with the verdict field (pass / fail) and the surrounding payload before wiring it into an agent. A fail is a normal result, not an error — the payload is the useful part.
If you use Laravel Boost, install laravel/boost and laravel/mcp, restart the Boost MCP server, and confirm ai-verify, ai-graph, and ai-verify-receipt appear in your agent's tool list. There is nothing to register by hand: the package adds itself to Boost's boost.mcp.tools.include list only when laravel/mcp is present.
Agent loop: edit → verify → repair. The intended daily workflow is to let the agent make changes and then call the ai-verify tool rather than shelling out. Because Boost executes each MCP call in a fresh process, the tool always sees the agent's latest edits — no reload, no stale snapshot, no need to bounce the MCP server between turns.
Graph before, receipt after. Use ai-graph when the agent needs orientation (what nodes/tests/impact surface a change touches) before editing, and ai-verify-receipt to produce an impact report/receipt for the change set. The receipt is the artifact to attach to a PR description or keep in the agent transcript; the verdict is the gate.
Two consumers, one output. Treat --json as the contract. In CI, run the artisan command and rely on the exit code plus the JSON; inside an agent, call the MCP tool and parse the JSON, ignoring exit semantics entirely. Same payload, different failure handling.
Conditional registration is the integration point. The tools are included via Boost's boost.mcp.tools.include only when laravel/mcp is installed. If you maintain your own Boost tool list, verify the merge rather than assuming the package's entries survive your customization.
Tune timeouts per call, not globally. ai-verify accepts a timeout argument for long suites; Boost's default is 180 seconds. Pass an explicit timeout on the tool call for slow suites rather than raising it everywhere.
Opt out per environment. AI_VERIFY_MCP_BOOST=false in the environment, or ai-verify.mcp.boost => false in config, disables the Boost tools without uninstalling anything. Useful for CI runners and for developers who want the CLI but not the MCP surface.
laravel/mcp. No Boost, no tools, no warning. If the agent can't see ai-verify, check that both laravel/boost and laravel/mcp are installed before debugging anything else.fail verdict is an answer, not a tool error. Don't build MCP-level retry or error-handling around it — inspect the JSON verdict and the payload. Retrying on fail just re-runs the same failing suite.timeout argument on ai-verify calls explicitly, and keep suite scope tight enough that the default is rarely the constraint.AI_VERIFY_MCP_BOOST is read in the MCP server's process, not your interactive shell. Set it where Boost is launched, and make sure boolean casting is explicit — a string "false" is a common footgun in config files.boost.mcp.tools.include list, a Boost upgrade or a re-published config can drop the entries. Verify the tools are listed after bumping laravel/boost.How can I help you explore Laravel packages today?