Laravel Boost Documentation
repository·main·Indexed 25 days ago
https://github.com/laravel/boostA development tool designed to enhance AI-assisted coding by providing structured context optimized for the Laravel framework. It includes an MCP (Model Context Protocol) server with tools for database interaction, log analysis, and PHP code execution via Tinker, as well as utilities for managing AI guidelines, agent skills, and project rules.
What's inside Laravel Boost
- Laravel Boost is a tool designed to accelerate AI-assisted development. It provides the necessary context and structure required for AI agents to generate high-quality, Laravel-specific code effectively.
Migrate Custom Agents to Boost 2.x
mainBoost 2.x introduces significant terminology and namespace changes for custom agents.
CodeEnvironmenthas been replaced withAgent.Terminology Mapping
Old Term New Term CodeEnvironmentAgentCodeEnvironmentsDetectorAgentsDetectorsrc/Install/CodeEnvironment/src/Install/Agents/Laravel\Boost\Install\CodeEnvironmentLaravel\Boost\Install\AgentsregisterCodeEnvironment()registerAgent()getCodeEnvironments()getAgents()Contract Renames
Old Contract New Contract Laravel\Boost\Contracts\AgentLaravel\Boost\Contracts\SupportsGuidelinesLaravel\Boost\Contracts\McpClientLaravel\Boost\Contracts\SupportsMcpLaravel\Boost\Contracts\SupportSkillsLaravel\Boost\Contracts\SupportsSkillsImplementation Example
Update your custom agent class to extend the new
Agentclass and implement the appropriate contracts.<?php namespace Appoost; use Laravel\Boost\Contracts\SupportsGuidelines; use Laravel\Boost\Install\Agents\Agent; class MyCustomAgent extends Agent implements SupportsGuidelines { // ... } // If supporting MCP or skills: use Laravel\Boost\Contracts\SupportsMcp; use Laravel\Boost\Contracts\SupportsSkills; class MyCustomAgent extends Agent implements SupportsGuidelines, SupportsMcp, SupportsSkills { // ... }Upgrade Boost from 1.x to 2.x
mainIf you are not using custom agents or overriding Boost, upgrading to 2.x is straightforward. After upgrading the package, run the installation command to handle migrations automatically.
Requirements for Boost 2.x:
- PHP: 8.2 or higher
- Laravel: 11.x or higher
If you use external packages that add custom agents, ensure they are updated to versions compatible with Boost 2.x.
php artisan boost:installUpdate Boost Configuration Keys
mainIf you have overridden configuration options in
config/boost.php, you must update the top-level key fromcode_environmenttoagentsto maintain compatibility with Boost 2.x.- config('boost.code_environment.junie.guidelines_path') + config('boost.agents.junie.guidelines_path')Configure MCP tool inclusion and exclusion
mainThe
ToolRegistrymanages which Model Context Protocol (MCP) tools are available to the Boost server. You can control tool availability using theboost.mcp.toolsconfiguration keys:boost.mcp.tools.exclude: An array of fully qualified class names (FQCN) to prevent from being discovered in the defaultLaravel\Boost\Mcp\Toolsdirectory.boost.mcp.tools.include: An array of FQCNs for additional tools located outside the default directory that you want to register.
Configure Laravel Boost MCP Tool inclusion and exclusion
mainYou can control which MCP tools, resources, or prompts are exposed to the AI client by modifying the
boost.mcpconfiguration. This is useful for enabling or disabling specific capabilities based on your environment or security requirements.Use the following configuration keys:
boost.mcp.tools.exclude: A list of class names to prevent from being registered as tools.boost.mcp.tools.include: A list of class names to explicitly include as tools.boost.mcp.resources.exclude: A list of class names to prevent from being registered as resources.boost.mcp.resources.include: A list of class names to explicitly include as resources.boost.mcp.prompts.exclude: A list of class names to prevent from being registered as prompts.boost.mcp.prompts.include: A list of class names to explicitly include as prompts.
Enable the Tinker MCP tool
mainThe Tinker tool, which allows executing PHP code within the Laravel application context via MCP, is disabled by default. To enable it, set theboost.tinker_tool_enabledconfiguration key totrue.Configure RecordRule tool availability
mainThe
RecordRuleMCP tool is only registered with the server if the following configuration setting is set totrue:config('boost.rules.enabled', true)Use the updated boost:install command flags
mainThe
boost:installcommand flags in Boost 2.x have changed from negative opt-out flags to positive opt-in flags. Use the following flags to include specific features during installation:php artisan boost:install {--guidelines} {--skills} {--mcp}Validate or reset the boost.json configuration file
mainThe
Configclass provides utility methods to maintain the integrity of theboost.jsonfile:isValid(): Returnstrueif theboost.jsonfile exists in the base path and contains valid JSON.flush(): Deletes theboost.jsonfile from the application base path.
Access application information via MCP resource
mainThe Model Context Protocol (MCP) server provides a resource that contains comprehensive application metadata. This resource can be requested to retrieve details such as the PHP version, Laravel version, database engine, and a list of all installed packages with their respective versions.
- URI:
file://instructions/application-info.md - MIME Type:
text/markdown - Content Format: JSON (containing the parsed application metadata)
- URI:
Manage Boost configuration via the Config class
mainTheLaravel\Boost\Support\Configclass manages project settings stored in aboost.jsonfile located at the application's base path. You can use this class to programmatically get and set various configuration flags and arrays related to guidelines, skills, MCP, and environment tools like Sail or Cloud.