Filament Agents

An in-panel AI assistant and an MCP server for Filament v5 panels, built on laravel/ai and laravel/mcp. One tool list serves both: the chat inside the panel and Claude Code, Claude Desktop, Cursor or any other MCP client, with the panel's own authorization deciding who may run what. Free and open source (MIT).
- Engine: packstub/agents — the same tools, MCP server, turns and budgets in a plain Laravel app; this plugin adds the panel pages on top
- Repository: github.com/packstub/filament-agents
- Packagist: packstub/filament-agents
- Support: GitHub issues
- Demo: the 90-second video — install in one line, a question answered with the live orders table, a chart, a change approved in one click, and the same tools in Claude Code over MCP
Features
- One tool list, two front doors: the panel's chat and any MCP client (Claude Code, Cursor) call the same tools.
- The panel's authorization: the assistant never does more than the signed-in person could, and a token narrows it further.
- Approve-in-chat writes: a change waits as a question with Approve and Reject, showing what it would change.
- A chat that feels current: streamed answers, attachments,
@mentions, a slide-over on any page, chats you can pin and search. - Live tables and charts: the resource's own Filament table under the answer, and charts from the numbers.
- Beyond the records, with guard rails: a cited knowledge base, web search within an allow-list, a prompt guard, redaction and a topic for every chat.
- A bounded bill: answer and token limits per user and per workspace, edited on an operator page.
- Your assistant, your prompt: a scaffolded agent class on Anthropic, OpenAI, Gemini or xAI, with failover.
- Tenancy-aware: workspace-bound tokens, tenant databases and per-workspace keys, or no tenancy at all.
Guides
| Guide | What it covers |
|---|---|
| Installation | Requirements, the install command, the queue worker (or the sync driver), the theme @source, registering the plugin, the provider key |
| Tools | Writing an AgentTool, abilities, read-only versus write tools, the server class, errors, the scaffold command |
| The assistant | The chat page, how a turn runs, Stop, Retry, regenerate and edit, long chats, approvals, feedback, the model picker, web search and the knowledge base, classification, the guard rails, and the Agent class with its persona, domain, rules, context and middleware |
| Tables and charts | AgentResource, InteractsWithAgent, the Filter vocabulary, show-table and the full-table page, draw-chart, page context |
| MCP clients | The Agent access page, tokens, abilities, tool scopes and expiry, connecting Claude Code, Claude Desktop and Cursor, the endpoint's middleware |
| Budgets and limits | The platform ceiling in config, the AI limits resource, inheritance, AgentBudget, what each turn cost: the AI turns page and the log line |
| Tenancy | The {tenant} path, workspace-bound tokens, per-workspace keys and limits, database-per-tenant migrations |
| Configuration | Every config key and environment variable, the fluent AgentsPlugin API |
| Security | The threat model: trust boundaries, prompt injection, the prompt guard, redaction, what the package enforces and what stays yours |
| Testing | Faking the model, driving tools, testing the MCP endpoint in your app |
At a glance
composer require packstub/filament-agents
php artisan packstub-agents:install
php artisan filament:assets
php artisan packstub-agents:tool SearchOrders --ability=orders.view
use Packstub\Agents\AgentsPlugin;
->plugin(
AgentsPlugin::make()
->name('Ask Acme')
->agent(\App\Ai\Agents\Assistant::class)
->server(\App\Mcp\Servers\AcmeServer::class)
->authorizeUsing(fn (string $ability) => auth()->user()->can($ability)),
)
Put ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY or XAI_API_KEY in .env (with AGENT_PROVIDER), run php artisan queue:work (or set AGENT_TURN_DRIVER=sync), open the panel, and press Ask Acme.