yoanbernabeu/webmcp-bundle
Symfony bundle that turns your app into a WebMCP/Model Context Protocol server, letting AI agents discover and call your tools, resources, and prompts over HTTP. Register capabilities with PHP attributes and integrate cleanly with Symfony services, routing, and security.
Architecture fit — headline mismatch. yoanbernabeu/webmcp-bundle is a Symfony bundle, not a Laravel package. A Symfony bundle depends on the Symfony kernel, bundles.php registration, and the DI compiler-pass pipeline. Laravel has none of these — its service providers and container are not bundle-compatible. As a direct composer require dependency, fit is effectively zero. As a reference implementation, fit is moderate: the portable core is small (PHP 8 attributes for tool declaration + route introspection + tool-schema emission), and Laravel routes are equally introspectable via Route::getRoutes() with action reflection. Both frameworks use PHP 8 attributes, so attribute classes themselves could be reused near-verbatim.
Integration feasibility. Two viable paths: (a) port the concept — a Laravel service provider that walks the route collection after boot, builds a tool descriptor inventory, and serves/registers it; (b) fork the bundle and maintain a Laravel adapter. Neither is a drop-in. Sizing: the surface is attributes + a scanner + an emitter, likely a few hundred LOC; 3–10 engineering days for a hardened port with auth, caching, and tests.
Technical risk. Three stacked risks. First, WebMCP itself is an early browser-level proposal — the underlying navigator.modelContext-style surface is not a ratified standard and browser support is unproven; spec churn will affect both the bundle and any port. Second, exposing controller routes as agent-callable tools is an authorization boundary change: every exposed route becomes an API endpoint invocable by an agent carrying a user's session, so CSRF, rate limiting, idempotency, per-tool scoping, and destructive-action confirmation all need explicit design — the bundle is unlikely to solve this for you. Third, the package itself has no production signal: 11 stars, 0 dependents, single maintainer, very recent release.
Key questions.
registerTool) or a server-side discovery manifest — or both?Stack fit. Target Laravel 10/11/12 on PHP 8.1+. Laravel already vendors several Symfony components (HttpFoundation, Console, etc.) but not HttpKernel bundles, so there is no shared runtime to lean on. Treat the bundle as a design reference, not a dependency.
Migration path. Recommended stance: reference implementation, not dependency. Extract three artifacts from the bundle — (1) attribute definitions, (2) the route-scanning logic, (3) the tool-descriptor/schema emitter — and reimplement (2) and (3) as a first-party Laravel package. Critically, compute the tool inventory into a cached artifact (build/deploy step), not per-request reflection.
Compatibility. Keep the emitted tool descriptors framework-agnostic (plain JSON Schema). That way, if the bundle later ships a Laravel adapter or the WebMCP ecosystem matures, you swap the emitter without changing the contract. Avoid coupling to Symfony DI tags anywhere in your port.
Sequencing.
Maintenance. Forking means you own the code. MIT licensing makes that clean, and the small surface makes it cheap — but you inherit spec-churn maintenance as WebMCP evolves. Budget this as a recurring line item, not a one-time port. Do not pin production behavior to the upstream bundle.
Support. No vendor, no community (0 dependents, 11 stars). Internal ownership with a named DRI is mandatory. Treat the upstream repo as abandonment-risk by default; unanswered issues and stalled releases should be the planning assumption.
Scaling. Server-side cost is negligible if the tool inventory is cached and registration is client-side. The real scaling risk is agent-side: unbounded agent invocation of routes designed for human cadence will amplify DB and queue load. Enforce per-tool quotas, timeouts, and circuit breakers at the edge — assume the bundle provides none of this.
Failure modes.
Ramp-up. Engineering lift is low: PHP 8 attribute fluency and Laravel routing internals are already in-house; reading the Symfony source costs hours, not a skills gap. The genuine ramp-up cost is governance — product and security stakeholders need a shared model of what "route as tool" means for the threat surface. Net read: low engineering lift, moderate governance lift, speculative payoff tied to WebMCP adoption. Worth a timeboxed spike; not yet worth a roadmap commitment.
How can I help you explore Laravel packages today?