Laravel Restify Package: Build REST APIs for... AI Agents?

Laravel Daily| 00:08:25|Apr 11, 2026
Chapters9
Introduces Restify and its goal of creating REST APIs without controllers or API resources and shows a sample repository setup for a model.

Laravel Restify lets you build REST APIs for humans and AI agents from the same codebase, with no controllers or routes, plus MCP-powered agent tools.

Summary

Laravel Daily’s video showcases Laravel Restify, a package that builds REST APIs without the boilerplate of controllers, API routes, or API resources. Daniel from Laravel Daily demonstrates defining a repository for an Eloquent model, and Restify generates the endpoints, relationships, and actions automatically. He notes other abstractions exist (Orion, API Platform), but Restify adds the MCP tools bridge for AI agents. The demo uses a Post model with login via Sanctum, token-based auth, and querying projects with related tasks via the generated API. You can enable MCP for AI agents to query the same data in two formats: a human-facing JSON API and an AI-friendly structure exposed through an MCP server. Under the hood Restify leverages Laravel Sanctum, policies, and standard Eloquent, while exposing a simple repository interface for fields, relationships, and actions. The video also touches the MCP workflow, where Cloud Code or Codex can query, discover tools, and operate on the database through an AI prompt. Finally, Daniel highlights setup steps and points to the official docs at laravel-restify.com for deeper syntax and configuration details.

Key Takeaways

  • Composer install and Restify setup are followed by repository generation, after which the REST API is produced for each Eloquent model.
  • Auth is powered by Laravel Sanctum and the same underlying Laravel policies, with Restify automatically enforcing typical authorization methods.
  • For each model, you define a Restify repository listing fields, relationships, and actions, enabling queryable, filterable endpoints without writing controllers.
  • MCP tools enable AI agents to interact with the API by exposing an AI-accessible toolset; you can restrict operations (e.g., only index) to secure interaction.
  • Two outputs from a single codebase exist: a human-facing JSON API and an AI-agent-friendly API via MCP, with tool discovery and cloud code prompts.
  • The package is positioned as an all-in-one alternative to separate packages like Spatie Query Builder, wrapping routing, authorization, and querying in one package.

Who Is This For?

Laravel developers who want to reduce boilerplate by auto-generating REST endpoints and who are exploring AI agent integrations via MCP. It’s especially useful for teams experimenting with AI-assisted data access in Laravel apps.

Notable Quotes

"Hello guys. In this video I will show you a package in action called Laravel Restify to build your Laravel REST APIs without controllers, API routes, or API resources."
Intro to Restify and its no-controller API approach.
"What is new with that Restify and what it intrigued me with is this, MCP tools for AI agents."
Highlighting the MCP feature for AI agents.
"There are policies that are used automatically."
Restify integrates with Laravel policies under the hood.
"From one code base you would have two outputs, typical JSON API for humans and then for AI agents..."
Two-output capability via MCP.
"This is powered by the open source package Laravel MCP, which is also powering Laravel Boost."
MCP origin and relation to Laravel Boost.

Questions This Video Answers

  • How does Laravel Restify generate REST endpoints without explicit routes or controllers?
  • Can I run AI agent queries against a Laravel Restify API using MCP, and how secure is it?
  • What is the setup workflow for Restify repositories and enabling MCP tools?
  • How does Restify compare to Orion or API Platform for Laravel REST APIs?
  • How do I configure policies and permissions when using Restify with Sanctum?
Laravel RestifyLaravel MCPAI agentsREST API without controllersLaravel SanctumEloquent repositoriesMCP toolsOrionAPI PlatformLaravel Daily review
Full Transcript
Hello guys. In this video I will show you a package in action called Laravel Restify to build your Laravel REST APIs without controllers, API routes, or API resources. All you would need to configure for managing eloquent model is something like this. Here's example repository for post model where you define the fields and then the package Restify takes care of most of the internals. And this is not the first package to abstract the API layer. Similar packages in the past, I've seen Orion for Laravel, which is also for REST API with Laravel. Also, there's API Platform, which is for Symphony initially, but they have a version for Laravel. I also reviewed it on my channel a few years ago. So, the idea to abstract API into some kind of repository layer is not new. What is new with that Restify and what it intrigued me with is this, MCP tools for AI agents. And I will also show it to you in action. So, from one code base you would have two outputs, typical JSON API for humans and then for AI agents, you would have something, some structure that you could query from, for example, Cloud Code or Codex. I will show it to you at the end of this video, but for now, let me show you the basic functionality of that package for those who don't even care about MCP and AI stuff. So, here I have a demo project database with a few users and then we have projects and tasks in that project and we can query that API in Postman. First, you log in with post API login, you send and then you get the token. So, this is the token and then I will put that token in another Postman tab with authorization bearer token. I will paste it here and then I will query the projects, for example, with including tasks and then I get the projects. This is, by the way, the JSON API schema, which I covered in another video pretty recently on this channel and I will link that in the description below. So, attributes these are the main attributes of project and then in relationships, we have tasks of that project. So, now in the code, in the routes API, there's nothing about route get projects or route resource or something like that. There's just Restify auth, which is powering login and register using the same Laravel Sanctum under the hood. And then for each eloquent model, you create repositories like this. So, here's my folder app Restify and then repository classes that extend repository from the package. And here you define the fields, you define the relationships, you define actions, and you define basically everything that this eloquent model should be doing. In the documentation, the setup is really easy. So, after composer require, you do Restify setup, you do repository generation, and then you may enable MCP for AI agents and I will talk about that later, as I mentioned. And then here's the example repository. And then there's a separate documentation page laravel-restify.com with a lot of sections, how to define that repository and what is the syntax here. And for example, if we launch PHP Artisan route list in this project, you will see the APIs Restify. These are the auth endpoints and then for each repository, there are these actions possible with repository as a parameter and ID and other parameters depending on endpoint. So, this is what is generated by the package. And in that repository, not sure if you noticed, for example, there's searchable and sortable for every field, so you can query something like project status active, you send and then the search will filter only active projects and stuff like that. So, it's similar to Spatie Laravel query builder package, just all-in-one package API, not separate eloquent. And we can briefly take a look at other repositories, for example, comment repository. Here's the eloquent model and you see the pattern, the array of relationships, the fields, task repository looks like this, more relationships and more fields, also with filters and actions. So, with that, you don't need to create any controllers. As you can see, there's no controller, no API resources, no routes, it's just powered by this package. But under the hood, this package uses all the standard things of Laravel. So, Laravel Sanctum, eloquent models, and for example, policies. There are policies that are used automatically. So, there's allow Restify special method, but then other methods are typical Laravel policy, which Restify takes automatically. And now some of you may have noticed that in the repositories, we have has MCP tools. So, let me show you MCP in action and what you can get from that. If you set up the MCP server and I'll show you how to do that in a minute, you can run Cloud Code in the same folder, for example, and launch the prompt something like this, "What are my active projects?" And it will identify that it needs MCP server and specific tool within that MCP server, pretty similar how Laravel Boost works for Laravel. It gets the documentation from the database from specific API of Laravel Docs. So, as you can see, it queried the database and returns the data for the projects from that database. You can see projects all assigned to user ID one and those projects are returned for AI agent. This is, of course, only the surface demo and there are many more details inside, but I will show you the basics in the code. So, under the hood, Laravel Restify uses the open source package Laravel MCP, which is also powering Laravel Boost. And if you're not familiar with MCP, I have a separate video on my channel 6 months ago when it was released. It's pretty complex to understand at first, but with this specific package example, you may understand the use cases why you would use MCP. So, that Laravel MCP allows you to have routes API PHP file with web or local MCP server. There are choices and there various ways how to set that up. But for example, in this case, Restify server has the tools and the instructions when to enable that server. So, this is the description and this is a typical Laravel MCP server with boot method with discovering the tools and those tools are actually what is performing the database query. So, this is where we get back to that trait of use has MCP tools. This is a trait that you can add to any repository of Laravel Restify and then here you list what tools are available. For security purpose, we enable only index, so only the list of projects, for example, and other methods return false, which means they will not return any answer. If you, for example, try to create a project with AI agent, it will return an error. But this is all configurable again. So, within the same repository, you can basically enable or disable specific operations that may be performed from AI agent instead of API client like Postman. This is the general most common use cases of MCP as a concept. So, you have AI agent as a client of MCP to perform some kind of operation on the back end on the server. Of course, you need to be very careful and validate a lot of things and enable only what you need to enable. This is pretty early days of such agentic setup, but this package Restify has MCP logic inside, pretty easy to configure. So, yeah, this is Laravel Restify. The about description says Laravel API for AI agents and humans. This is a new trend, whether you're happy with that or not, but I think we will see more and more MCPs and tools for AI agents in Laravel and I will, of course, review them on this channel and also probably will go deeper dives in Laravel Daily as courses or longer videos with examples. And only this week, 2 days left for this promotion. If you want to be a part of that future and support my work of keep shooting these videos, until April 12th, you can get yearly or lifetime membership with 40% off, no coupon code required. That's it for this time and see you guys in other videos.

Get daily recaps from
Laravel Daily

AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.