shaxzodbek-uzb/laravel-model-mcp
Laravel Model MCP exposes your Eloquent models to AI assistants through the Model Context Protocol, letting tools like Claude query, inspect, and work with your app's data from a single package.
composer require <vendor>/<package>:^0.2.2 and read the changelog for 0.2.1 → 0.2.2 in one pass. The 0.2.x line is stabilising its dependency graph rather than changing behaviour, so expect no code changes on your side.AbstractModelTool. That base class is the seam everything flows through: validation rules, the model resolution, and the ValidationException handling that the v0.2.2 fix touches.composer why illuminate/validation and composer why illuminate/auth. Both should now report a direct requirement from this package. If either still shows only a transitive path, your lock file is stale — composer update <vendor>/<package> --with-dependencies.One tool per intent, thin subclasses. Extend AbstractModelTool, declare the model and the validation rules, and keep handle() to a couple of lines. The base class owns validation and exception translation; duplicating that in your subclass means your error shape drifts from every other tool.
Treat validation rules as the public contract. Rules on a tool are consumed by an LLM or an API client, not just a form. Keep rule messages descriptive and explicit ('exists:users,id' rather than a bare required) — the failure text is often the only feedback the caller gets to self-correct.
Gate at the tool boundary, not inside handle(). Combine the package's auth integration with Laravel policies so each tool declares who may invoke it. Checking inside handle() means an unauthorised call still passes validation and burns a query.
Wrap mutating tools in transactions. A tool call is an untrusted, single-shot request. DB::transaction() around writes keeps a partially-validated multi-model operation from leaving debris, since validation failures surface as exceptions that will bubble.
Register tools centrally and keep the list explicit. Whether you register via a service provider, a config array, or an attribute, avoid auto-discovery over a directory — an accidentally exposed model tool is a data-leak vector. An explicit array is auditable in code review.
Test tools as units, not through the agent. Instantiate the tool, call it with a payload array, and assert on both the success path and the ValidationException path. This is fast, deterministic, and independent of whatever model or client sits in front of it.
illuminate/validation was resolving only because something else in your tree pulled it in. Nothing broke — but on a leaner install, or after another package drops that dependency, AbstractModelTool would fatal on the missing ValidationException. The upgrade is cheap; take it.illuminate/* components. Now that the package declares illuminate/validation and illuminate/auth explicitly, your own pinned versions must agree. Run composer update --dry-run before committing the lock file, especially on older Laravel majors.illuminate/* component you use — a use statement is a dependency, whether or not Composer knows it.ValidationException. The base class translates it into a caller-friendly error payload. Catching it in your subclass to return false or a custom array breaks that contract and silently drops field-level detail.AbstractModelTool yourself keeps the upgrade path to 0.3.x a one-file change.How can I help you explore Laravel packages today?