Packstub

Filament Agents

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).

Features

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.