Claude can already work with your Laravel app. Not by you hand-building a REST API, writing a client, and describing every endpoint to it, but by exposing a few tools over the Model Context Protocol (MCP) and letting the model call them directly. The official laravel/mcp package turns that into an afternoon's work.

This is the hands-on version. We'll build a small MCP server for an online shop: tools the model can call, a resource it can read, input validation, auth, and a test to keep it honest. The full write-up of how the protocol fits together lives on our site, Use Laravel to create your own MCP server. Here we're going to write the code.

First, the short version of what we're building. An MCP server exposes three things to a connected AI client: tools (actions the model can call, like searching orders), resources (read-only data it can pull in for context), and prompts (reusable templates). The client and server talk JSON-RPC, and laravel/mcp handles that wire format so you only write PHP.

Prerequisites

A recent Laravel application (12.x works well).