catidegla/laravel-agent-kit
A Laravel toolkit for building AI agents and adding agentic workflows to your app. It offers a structured way to define agents, manage prompts and tools, and connect them with Laravel services, making AI-powered features easier to organize, test, and ship.
Architecture fit. The package sits in a well-understood Laravel seam: a service provider registers MCP tool classes that map Eloquent models to agent-callable endpoints, with authorization delegated to Laravel policies and output shaped by explicit field allowlists. That is idiomatic for the framework and keeps the security boundary in the place reviewers already know how to audit — policies — rather than in a bespoke permission layer. The v0.5.0 notes confirm the package builds its tool classes as real laravel/mcp artifacts and round-trips them through that library's own serialization, which is the difference between an integration and an imitation.
Integration feasibility. Low ceremony for a Laravel shop: one provider registration, policies the team likely already has, and per-model exposure declarations. The support matrix is explicitly widened rather than shifted — Laravel 12 support is unchanged, and Laravel 13 support is added with the PHP 8.3 floor that Laravel 13 itself imposes. That is the least disruptive way to add a major-version target and means an upgrade of the host app is not a forced upgrade of this package.
Technical risk. Three items dominate. First, this is a v0.x package whose core value proposition is a security boundary; a pre-1.0 version signal on an authorization-critical component deserves weight regardless of test counts. Second, the dependency on laravel/mcp means upstream API churn is a live risk, partly mitigated by the fact that the tests exercise the real library rather than a stub. Third, the PHP 8.2 row staying on Laravel 12 creates a permanent two-track test matrix that will need pruning when 8.2 reaches end of life.
The test evidence itself is the strongest signal in these notes. The suite asserts properties — absent fields stay absent, one principal's records do not appear in another's list, a model without a policy throws, a denied read is indistinguishable from a missing record, no field values reach the audit record, relations cannot traverse to unexposed models — rather than asserting that methods return non-null. Property-style assertions on security behavior age far better than shape assertions and are the right thing to have written first. 58 tests is a modest number, not a coverage claim; it should be read as evidence of intent, not proof of completeness.
Key questions.
get is indistinguishable from a missing one" is correct for information leakage but is it diagnosable? Is there a server-side log that distinguishes the two?laravel/mcp — caret range or exact?Stack fit. Targets Laravel 12 (PHP 8.2–8.4) and Laravel 13 (PHP 8.3–8.4). For most organizations this is a non-event: applications on Laravel 11 or below are out of scope and should not attempt this package, and applications on 12 need no changes at all. The natural adoption unit is a single bounded-context service, not the whole estate.
Migration path. There is no migration in the conventional sense — the package adds a new surface rather than altering an existing one. The real work is inventory: enumerate candidate models, confirm each has a policy, and decide the field allowlist per model. That is design work, not porting work. Because a model without a policy throws, the package is fail-closed by default and an incomplete inventory will surface as errors at wiring time rather than as silent exposure. Treat that as a feature and schedule the inventory accordingly.
Compatibility. Two axes to verify before commitment. The PHP/Laravel matrix above is stated and tested per commit, which is credible. The second axis — laravel/mcp version compatibility — is not addressed in the notes and should be pinned and tracked explicitly. Also confirm the host application's Laravel major is on the supported side of the 12/13 line, and confirm that policy discovery conventions (auto-discovery vs. explicit registration) match how the team already names and locates policies.
Sequencing. Suggested order:
laravel/mcp; freeze the pair.Maintenance. Expect to track releases closely while the package is pre-1.0 — budgeting for a minor-version review each cycle is realistic, and breaking changes in a 0.x line should be assumed possible rather than exceptional. The upstream laravel/mcp dependency is a second maintenance stream; pin it and review deliberately. The PHP 8.2/Laravel 12 track is a temporary obligation that will need an explicit retirement date tied to PHP 8.2 end of life.
Support. The failure that will generate tickets is the fail-closed one: "the tool throws for model X." The first-line runbook should say plainly that this means the model lacks a policy, and point at the fix. The second, subtler ticket class is the security property working as designed — a caller receiving "not found" for a record they can see in the database. Support staff must understand that denied and missing are deliberately indistinguishable, or they will file it as a bug and ask for the distinction to be removed. Document that before rollout, not after.
Scaling. Two load characteristics matter. Tool invocations carry the cost of policy resolution, query execution, and output shaping per call, so agent-driven traffic patterns (many small reads) differ from typical request traffic and should be load-tested with realistic call shapes rather than assumed to be equivalent. Separately, the audit record is a write on every invocation; at agent-scale call volumes this becomes a meaningful write stream and needs a retention and sampling policy from day one, not after the table grows.
Failure modes. Enumerated: (1) model exposed without a policy — throws, fail-closed, loud; (2) relation traversal to an unexposed model — blocked by design, but confirm it fails closed rather than returning an empty set, which would be a silent wrong answer; (3) field allowlist drift — a column added to the model later is presumably not auto-exposed, verify this; (4) laravel/mcp version skew — tool classes fail to load or serialize, caught by the pin; (5) audit sink unavailable — unclear whether the call fails or proceeds unlogged, and this is the most important unanswered question in the release notes, since a security-relevant audit that silently drops is worse than one that blocks.
Ramp-up. Moderate for a Laravel-fluent engineer — the concepts (providers, policies, Eloquent) are all native, and the unfamiliar piece is MCP tool modeling. Budget roughly a day to the first working read-only tool and a week to a confident second model with relations and a reviewed allowlist. The real ramp-up cost is not the package API but the security review discipline: someone must own the exposed-model inventory and the field allowlists as standing artifacts, because that is where the risk actually lives.
How can I help you explore Laravel packages today?