Laravel created three AI packages: the Laravel AI SDK, Laravel Boost, and Laravel MCP. Each one solves a different problem, and if you’re trying to figure out which one you need (or whether you need all three), we’ll break it down for you in this post.
The tl;dr:
- AI SDK helps you build AI features into your app.
- Boost helps AI agents write better Laravel code for you.
- MCP helps external AI tools interact with your app.
They work together, but they are not interchangeable. Read the full AI SDK docs, the Boost docs, and the MCP docs to learn more.
The Problem All Three Packages Solve
AI is now part of how developers build and ship software. The tooling, however, has been scattered. Developers were writing their own wrappers around OpenAI's API, managing provider-specific quirks manually, and hoping their coding agents would produce Laravel-idiomatic code instead of generic PHP.
Laravel’s CEO, Taylor Otwell, described the motivation this way during a live demo of the AI SDK:
"It's such an important part of the dev workflow at this point. It felt like we needed some sort of first-party opinion on interacting with AI providers. Just like we have opinions on sending email or queuing jobs."
Each of the three packages addresses a layer of this problem: one for building AI features, one for writing code with AI, and one for exposing your app to AI clients.
What Is the Laravel AI SDK?
The Laravel AI SDK is a unified PHP package for adding AI capabilities to your Laravel application. You install it with:
1composer require laravel/ai
It gives you a single API to work with text generation, image generation, audio, transcription, embeddings, and more across providers like OpenAI, Anthropic, Google Gemini, Groq, and xAI. You configure your default providers once in config/ai.php, and the SDK routes requests to the right endpoint without you specifying a model string every time.
The core concept is the agent. You generate one with an Artisan command:
1php artisan make:agent SalesCoach
This creates a class where you define system instructions, tools, output schemas, and conversation context. You reuse this class anywhere in your app: inside a controller, a queued job, an event listener. The logic lives in one place.
1class SalesCoach implements Agent2{3 use Promptable;4 5 public function instructions(): string6 {7 return 'You are a sales coach analyzing call transcripts and providing actionable feedback.';8 }9}
Prompting the agent is one line:
1$response = (new SalesCoach)->prompt('Analyze this sales transcript...');
What You Can Build with the AI SDK
The AI SDK covers every major AI capability you would want in a production Laravel app:
- Text generation and structured output. Prompt agents to return freeform text or JSON that matches a defined schema. Structured output is useful when you need to parse the response and store it in a database.
- Streaming. Use the
streammethod to push responses to your frontend using server-sent events. Livewire and Inertia both have hooks to consume streams. - Background processing. Call
queueinstead ofpromptto push generation to a Laravel queue job, then handle the result in a callback. This prevents users from waiting on slow AI responses. - Image generation. Generate images from text prompts using OpenAI, Gemini, or xAI. Store generated images directly to any Laravel filesystem disk in one line.
- Audio generation and transcription. Generate speech from text using OpenAI or ElevenLabs. Transcribe audio files with speaker diarization and timestamped segments.
- Embeddings and semantic search. Generate vector embeddings from text using
Str::of('...')->toEmbeddings()and store them in a Postgres database with pgvector. Use the built-inSimilaritySearchtool to query them from an agent. - File and vector stores. Upload PDFs and documents to OpenAI or Gemini for semantic file search across conversations.
- Automatic failover. Pass an array of providers and the SDK will fall back to the next one if your primary provider is rate-limited or unavailable.
Taylor described why the SDK's API design matters even when AI agents are writing the code:
"I think it matters in the sense that LLMs still do well with things that are easy to parse and understand. Frameworks that lean into conventions and structure do well with LLMs. There's this very conventional structure to the projects where it's like, there's a models’ directory, there's a controllers' directory. It's very discoverable."
That predictability makes it easier for both developers and AI to read and reason about AI code in a Laravel project.
When to Use the AI SDK
Use the Laravel AI SDK when you are adding AI features to your application. If you want users to interact with AI inside your product, whether that is text summarization, image generation, semantic search, voice transcription, or a chat interface, the AI SDK is the right tool.
Laravel Nightwatch uses the AI SDK to summarize exceptions in production. When an error occurs, users click a button to get an AI-generated summary of what happened, what caused it, and what to check next. That is a straightforward text generation task: the agent reads the exception data and returns a structured response.
A more data-intensive example is lead qualification. A LeadExtractor agent can read a CSV of contact form submissions, filter spam, identify high-value prospects, and return structured JSON with scores and extracted needs. Storing embeddings alongside each qualified lead then makes semantic search possible later:
1$response = (new LeadExtractor)->prompt( 2 "Extract and qualify leads from this CSV: {$csv}" 3); 4 5foreach ($response['leads'] as $lead) { 6 if ($lead['is_qualified']) { 7 Lead::create([ 8 'name' => $lead['name'], 9 'email' => $lead['email'],10 'embedding' => Str::of($lead['qualification_reason'])->toEmbeddings(),11 ]);12 }13}
What Is Laravel Boost?
Laravel Boost is a developer tool, not an application feature. It’s included by default in new Laravel projects, and can be added as a dev dependency to existing compatible applications.
1composer require laravel/boost --dev2php artisan boost:install
Boost gives AI coding agents like Claude Code and Cursor two things they need to write good Laravel code: context about your project and knowledge about the Laravel ecosystem. It provides both through two mechanisms: AI guidelines and agent skills.
AI Guidelines
Guidelines are composable instruction files loaded upfront at the start of your coding session. They tell the agent to follow Laravel conventions, use the correct APIs for your installed package versions, and write tests when appropriate. Boost ships guidelines for the Laravel framework, Livewire, Inertia, Pest, Tailwind CSS, Flux UI, and more. If you maintain a third-party package, you can ship your own guidelines alongside it so Boost automatically picks them up.
Agent Skills
Skills are a newer, more targeted approach. Where guidelines are broad and loaded upfront, skills are focused knowledge modules that agents activate on-demand when working on a specific task.
Boost installs skills automatically based on what it detects in your composer.json. If your project includes livewire/livewire, the livewire-development skill is installed. You can also write custom skills for your own application's domain logic:
1.ai/skills/creating-invoices/SKILL.md
The Laravel Skills directory is an open collection of reusable skills built by the community. Install any skill with a single command:
1php artisan boost:add-skill
The Documentation API
Boost connects agents to a hosted documentation API with over 17,000 pieces of versioned Laravel ecosystem documentation, indexed with semantic search. The API covers the Laravel framework, Livewire, Inertia, Filament, Nova, Pest, and more, filtered to the major versions your project uses.
Taylor explained the gap this fills:
"We release a feature tomorrow in Laravel because we release every Tuesday. LLMs have no idea that that feature exists because they've been trained on old data. But Boost actually allows us to feed them the latest info. They always have access to the most up-to-date docs."
When to Use Boost
Use Laravel Boost when you are writing Laravel code with an AI coding agent. Boost makes Claude Code, Cursor, and similar tools generate more accurate, idiomatic, and version-appropriate Laravel code. It is a developer productivity tool. Your end users never interact with it.
In practice, when you ask Claude Code to build a Livewire component, the livewire-development skill loads the specific patterns and conventions for that domain. When you move on to writing tests, the pest-testing skill takes over. Each skill loads only when relevant, so the agent has focused, current context at every step. The result is fewer hallucinated methods and less time cleaning up the diff.
What Is Laravel MCP?
Laravel MCP is a library for building Model Context Protocol servers inside your Laravel application. You install it with:
1composer require laravel/mcp2php artisan vendor:publish --tag=ai-routes
MCP is an open standard that lets AI clients like ChatGPT, Claude, and Cursor interact with external services in a structured way. When you build an MCP server into your app, you are giving AI tools a way to call your application's functionality directly.
Boost itself is built on Laravel MCP. Every tool Boost exposes to your coding agent, like Tinker and Schema, is an MCP tool defined using this same library.
You generate an MCP server with:
1php artisan make:mcp-server InvoiceServer
MCP supports three primitives:
- Tools expose callable functionality. An AI agent can invoke a tool to take an action in your application, like creating an invoice, querying data, or triggering a workflow. Anything you can code can be a tool.
- Resources expose content. An AI client can read resources and use them as context: documents, database records, configuration files.
- Prompts offer reusable prompt templates. Users can pick a prompt from the server (like "Review my code") so they don't have to type it each time.
MCP servers can be web-accessible (over HTTP) or local (as an Artisan command). Web servers support OAuth authentication through Laravel Passport and token authentication through Laravel Sanctum.
When to Use Laravel MCP
Use Laravel MCP to expose your application to external AI clients. If you want ChatGPT to be able to create invoices in your app, or Claude to search your knowledge base, or Cursor to query your API, you build an MCP server. Your product becomes an AI integration without requiring users to leave their AI chat of choice.
An invoicing application, for example, can expose a CreateInvoice tool through an MCP server. A user in ChatGPT says "Create an invoice for Acme Corp for $2,400," and the tool validates the input using Laravel's validation, creates the record, and returns a structured response. The user never left their chat interface.
How the Three Packages Work Together
These tools are not alternatives to each other. They operate at different layers:
| Package | Who uses it | What it does |
|---|---|---|
| Laravel AI SDK | Your application | Adds AI features your users interact with |
| Laravel Boost | You, the developer | Helps AI agents write better Laravel code |
| Laravel MCP | External AI clients | Exposes your app to tools like ChatGPT and Claude |
A production Laravel app might use all three. The AI SDK powers an AI-driven search feature inside the app. Boost helps the team build that feature faster with Claude Code. An MCP server lets users query the same search from inside ChatGPT.
The relationship between Boost and MCP is a good example of how they layer. Boost uses Laravel MCP internally to expose its development tools to coding agents. If you build your own internal dev tooling, you could do the same thing.
A Note on Tools and Context
The AI SDK supports custom tools, and so does Laravel MCP. These are related but serve different purposes.
Tools in the AI SDK give your agents the ability to call external functionality during a generation: searching the web, querying a vector store, running a calculation. These run server-side during a user interaction in your Laravel app.
Tools in Laravel MCP expose your application's functionality to external AI clients. They are the entry point for AI tools calling into your app from the outside.
Taylor flagged one practical consideration when using tools with the AI SDK: exposing too many tools at once can cause context bloat.
"You shouldn't have like 50, 60, 70 tools probably exposed to the LLM because you get what's called context bloat. You also have to send all of the tool definitions, what they do, and you have to send that on every message. So if you have too many tools, you can consume a lot of tokens and a lot of context."
The agent class design in the AI SDK helps here. Because tools are defined per-agent, you can scope what each agent has access to. A customer support agent gets search tools. A lead qualification agent gets none. This keeps token usage predictable.
Getting Started with AI-Powered Laravel Development
Install all three packages independently based on what you need:
1# Add AI features to your application 2composer require laravel/ai 3 4# Improve AI-assisted development (install as dev dependency) 5composer require laravel/boost --dev 6php artisan boost:install 7 8# Expose your application to external AI clients 9composer require laravel/mcp10php artisan vendor:publish --tag=ai-routes
If you are just getting started, install Laravel Boost first. It will immediately improve the quality of AI-generated Laravel code in your editor. Then add the Laravel AI SDK as you start building AI features into your application.
The three packages form a complete AI layer for Laravel: one for building, one for developing, one for integrating. Used together, they close the loop from writing code faster with Boost, to shipping AI features with the AI SDK, to reaching users wherever they already are with MCP.
We must ship. Read the Laravel AI docs and start building even faster.
FAQ
Do I need all three packages?
Not necessarily. Most Laravel developers who are building AI features into their apps will want both Boost (for development) and the AI SDK (for features). Laravel MCP is only needed if you want to expose your application to external AI clients.
Is the Laravel AI SDK a replacement for Prism?
Yes, the AI SDK replaces the need to use Prism in your application directly. Taylor described the relationship: "I think of Prism and the AI SDK a little bit as I think of Query Builder and Eloquent. Prism has this kind of fluid interface. The AI SDK is a layer of abstraction on top of that with agent classes, testing, and things like that."
Can I use local models instead of OpenAI or Anthropic?
Yes. The AI SDK supports Ollama for local model inference. You can also use OpenRouter to access multiple providers through a single API key. Configure the base URL override in config/ai.php for any OpenAI-compatible endpoint.
How does the AI SDK integrate with Laravel's queue system?
Instead of calling prompt(), call queue(). The SDK creates a background job on your Laravel queue. You pass callbacks for when the job completes or fails. This is useful for long-running tasks like audio transcription or large document analysis, where you don't want to block the HTTP request.
Does Laravel Boost affect my production app?
No. Boost is installed as a dev dependency and runs as a local MCP server on your development machine. Nothing in Boost affects your production build.
What authentication does Laravel MCP support?
Laravel MCP supports OAuth 2.1 through Laravel Passport (recommended for maximum compatibility with MCP clients) and token-based authentication through Laravel Sanctum. You can also write custom authentication middleware.
Can tools in the AI SDK be packaged and shared?
Yes. Tools and agents are plain PHP classes that can be distributed as Composer packages. If you build a reusable tool, you can publish it for other Laravel developers to use.