An open source MCP server that connects AI agents, IDEs and apps to databases with prebuilt tools or custom tool definitions.
MaestroError/LarAgent
A PHP framework for building AI agents in Laravel projects, with an Eloquent-style API, tools, chat history and multi-provider support.
- Stars
- 645
- Forks
- 56
- Open issues
- 7
- Last commit
- 3 months ago
What is it?
LarAgent is a framework for creating AI agents inside Laravel applications. Agents are defined as classes that look much like Eloquent models, with properties for the model, provider, chat history and tools, plus an artisan command to generate them. Developers can attach tools as attribute-annotated methods or classes, and run an agent per user or under a custom history name.
The framework covers the common building blocks of agent work: multiple chat history backends such as in-memory and cache storage, structured output, image input, and parallel tool calls that can be turned off. Providers can be configured per agent, and an ordered provider list gives automatic failover to fallback providers. An event system exposes hooks across agent interactions, and agents can be exposed through an OpenAI-compatible API. It also supports MCP servers as a tool source.
LarAgent requires PHP 8.3 or higher and Laravel 10.x or higher, and it can also be used outside Laravel in standalone mode. It is distributed as the maestroerror/laragent Composer package under the MIT license.
Key features
- 01Define agents as Eloquent-style classes generated with an artisan command.
- 02Attach tools as annotated methods or classes, with optional parallel execution.
- 03Store chat history in memory, cache, JSON and other backends, per user or by custom name.
- 04Automatic failover across an ordered list of LLM providers.
- 05Structured output and image input support.
- 06Event hooks across agent interactions and an OpenAI-compatible API exposure.
Use cases
- Adding a conversational assistant to an existing Laravel product.
- Automating internal operations with agents that call application tools.
- Building per-user chat experiences with stored conversation history.
- Running agents with fallback providers to reduce downtime from a single LLM vendor.
Quick start
- 1
Install the package with Composer
composer require maestroerror/laragent - 2
Publish the config file
php artisan vendor:publish --tag="laragent-config" - 3
Generate your first agent
php artisan make:agent YourAgentName
Things to know
- Requires Laravel 10.x or higher and PHP 8.3 or higher.
- Needs an API key from an LLM provider such as OpenAI to run agents.
In collections
Topics
FAQ
- What is LarAgent?
- A PHP framework for building AI agents in Laravel projects, with an Eloquent-style API, tools, chat history and multi-provider support. LarAgent is a framework for creating AI agents inside Laravel applications. Agents are defined as classes that look much like Eloquent models, with properties for the model, provider, chat history and tools, plus an artisan command to generate them. Developers can attach tools as attribute-annotated methods or classes, and run an agent per user or under a custom history name.
- Is LarAgent free to use? What license does it have?
- LarAgent is open source under the MIT license. Check the license terms before using it in commercial products.
- Is LarAgent still maintained?
- Updated within 6 months. The last commit to LarAgent was on Aug 20, 2026.
- What can I use LarAgent for?
- Adding a conversational assistant to an existing Laravel product. Automating internal operations with agents that call application tools. Building per-user chat experiences with stored conversation history. Running agents with fallback providers to reduce downtime from a single LLM vendor.
- How do I install LarAgent?
- Install the package with Composer: composer require maestroerror/laragent Publish the config file: php artisan vendor:publish --tag="laragent-config" Generate your first agent: php artisan make:agent YourAgentName
- Where can I get LarAgent?
- The source code and installation instructions are on GitHub: https://github.com/MaestroError/LarAgent
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Laravel package for building, tool-equipping and deploying LLM-powered AI agents with persistent memory, tracing and a web dashboard (now retired; v0.0.48 is final).
Official Python SDK for building Model Context Protocol servers and clients that connect LLM applications to tools, data and prompts.
A Go implementation of the Model Context Protocol for building MCP servers that expose tools, resources and prompts to LLM applications.
An opinionated, batteries-included agent harness for Python that runs long multi-step tasks out of the box on LangGraph.
Type-safe, provider-agnostic TypeScript SDK for streaming chat, tool calling, agents, and multimodal apps across major LLM providers and UI frameworks.