opscale-co/nova-mcp
An MCP server for Laravel Nova that exposes your resources and tools to AI clients via the Model Context Protocol, letting assistants query and manage Nova data securely through your existing authentication and policies.
composer require opscale-co/nova-mcp and let Laravel auto-discover the service provider.php artisan vendor:publish --tag=nova-mcp-config or similar — check the package's README for the exact tag) so you get the server name, route prefix, and middleware settings into config/nova-mcp.php.mcp-inspector) pointing at the package's HTTP endpoint — typically /nova-mcp or whatever you set as the prefix. If the transport is stdio in your setup, use the artisan command the package ships instead of the HTTP route.Article or Ticket resource) and ask the model "list the 5 most recent tickets". This validates auth, routing, and schema generation end-to-end before you widen the surface.Look first at the package's config/ file and its src/Tools (or equivalent) directory — that's where resource-to-tool mapping lives, and it tells you more about behaviour than the README does.
Resource-driven tools. The common pattern is that each Nova resource you opt in becomes an MCP tool with CRUD-ish operations derived from its fields. Start by whitelisting resources explicitly rather than exposing everything Nova knows about — the default surface for a mature app is far too large for a model to choose well from.
Per-resource customisation. Where a resource needs a narrowed tool, override the generated schema or add a dedicated tool class. Good candidates: strip internal fields (tenant_id, audit columns), rename operations to intent-shaped verbs (close_ticket rather than update with a status field), and hard-code filters the model shouldn't be able to change.
Prompts (new in 1.2.0). The release adds a prompts resolver, so you can now ship prompt templates alongside tools. This is the pattern worth adopting immediately: rather than relying on the user to phrase "summarise open tickets older than 7 days" well, register a named prompt with that instruction and the expected arguments. Implement a resolver that returns your prompts (name, description, arguments, and the rendered messages), and keep them next to the tools they drive so a change to a tool's schema and its prompt ship together. Treat prompts as versioned product surface — they're user-facing strings, not internal glue.
Auth and scoping. In practice you want the MCP endpoint behind your normal auth stack (Sanctum token or session middleware), and you want the token to determine which Nova resources are visible. Don't rely on the model to respect tenancy; enforce it in the tool layer so a prompt-injected request can't cross boundaries.
Local vs production. Run against a seeded local database during development — MCP clients retry aggressively and a slow production endpoint makes debugging miserable. In production, keep write-capable tools behind a feature flag or a separate token scope until you've watched the read-only traffic for a while.
curl first.VerifyCsrfToken deliberately rather than debugging 419s.mcp-inspector rather than through your chat client — it shows the raw tool schemas and response payloads, which is where the actual problems are.nova-mcp tracks Nova internals; a Nova upgrade plus an unpinned MCP package is a compound failure you don't want to bisect. Commit the lockfile.How can I help you explore Laravel packages today?